Welcome to the Wolf CMS administration guide. This book is a collection of wiki pages from the wolfcms.org documentation wiki that are gathered together to form a book-like total.
By accessing this book and selecting the “Export to ODT” button, you can generate an Open Office document for your viewing/printing pleasure. You can of course also use Open Office to turn the ODT document into a PDF file.
Getting Wolf CMS installed on your server or hosting package involves a number of steps. Fortunately, the steps are fairly simple and are applicable to most hosting providers. (Most of the steps below are illustrated in this 4m45s video, also available on YouTube), which demonstrates how to install Wolf CMS (0.7.3) with mySQL as the database on localhost.)
Wolf CMS depends on a database being available. Creating one yourself1) or having one created for you depends on your exact environment or hosting provider and is beyond the scope of this document.
For our installation purposes, we will assume that you can or already have created a database for use by Wolf CMS.
If you are using mySQL, it is probably best to have the db prepared before proceeding with the rest of the installation instructions. You will need to know:
and, if your specific environment differs from what Wolf expects, you may additionally need to know:
If you are using SQLite, it is probably best to create the db during the Wolf install process. Wolf's installation screen will suggest a location and filename for your db outside the Wolf directory structure. You will need to create the folder/file that the Wolf install screen recommends, or alternatively, another one of your own choosing.
In any case, this needs to be an absolute path, with full write permissions for Wolf to be able to use it. Ensure this has been done before proceeding to the final “Install” step.
After having retrieved the Wolf CMS package from our download pages, you will need to copy it to your webserver. Unzip the package in the appropriate directory on your server.
This will usually be a “www” or “public_html” directory or a subdirectory of that. Wolf CMS is quite happy to work inside a subdirectory.
If you wish to use 'clean' - without '?' - URLs:
It is recommended to switch off 'magic_quotes_gpc' and this is done in the .htaccess file with 'php_flag magic_quotes_gpc off'. However, some servers are configured to not allow this and the install will fail. You will therefore need to comment this out of .htaccess by starting the line with '#'.
Your host may allow use of php.ini to do this by setting 'magic_quotes_gpc off'. If using php.ini produces a blank screen, you may need to provide additional instructions in this file. See this forum discussion for details.
After you have copied the files onto your webserver, you will need to run the installation routine.
Your <wolf path> will likely be something like http://www.mysite.com/ if you placed the Wolf CMS files in the root, or http://www.mysite.com/wolfcms/ if you placed Wolf CMS in a subdirectory.
After finishing the installation, you will get a message that includes a link to your <wolf path>/admin/ section. This page also shows you the administrator's username and generated password.
A number of post installation steps are required and advised for you to do. These will help secure your Wolf CMS installation.
You should always change your administrator's password to something private and secure!
Optionally, you may also wish to change the name of the admin folder to further enhance the security of your Wolf site.
The default installation of Wolf CMS generates a question mark in the URLs it generates. This is for compatibility purposes, so Wolf CMS will run on almost any HTTP server by default.
However, most people (and search engines) don't really like this question mark. You can disable/remove the question mark after you installed Wolf CMS.
By default, Wolf CMS supports Apache. Other HTTP servers are supported based on user input.
Updated to reflect Wolf CMS 0.6.0
You must carry out both the “General actions” and the additional instructions for your specific webserver (Apache, Lighttpd, etc.).
The following actions should always be executed in order for Wolf CMS to use clean urls.
The paths used in the rewrite code below assume that your Wolf CMS installation lives at the root of the site, i.e. http://www.example.com.
Since Lighttpd does not have an equivalent of Apache's RewriteBase command, you will have to manually alter the paths below to conform to your Wolf CMS root.
#
# Wolf CMS mod_rewrite rules for lighttpd
#
# If your Wolf CMS install lives in a sub-directory like: http://www.example.com/mywolf/
# you should add the subdirectory between ^ and / in the rules below and in the
replacement
# value, for example: "^/mywolf/admin(.*)$" => "/mywolf/admin/index.php?$1",
#
url.rewrite-once = (
"^/install/index.html$" => "/install/index.php?rewrite=1",
"^/install/index.php$" => "/install/index.php?rewrite=1",
"^/install/$" => "/install/index.php?rewrite=1",
"^/install/(.*)$" => "/install/$1",
"^/admin/(images|javascripts|stylesheets|themes)/(.*)" => "/admin/$1/$2",
"^/admin/index.php\?(.*)$" => "/admin/index.php?$1",
"^/admin(.*)$" => "/admin/index.php?$1",
"^/favicon\.ico$" => "$0",
"^/(public|wolf)/(.*)$" => "/$1/$2",
"^(?:(?!/admin/))/([^?]*)(\?(.*))$" => "/index.php?WOLFPAGE=$1&$2",
"^/(.*)$" => "/index.php?WOLFPAGE=$1"
)
If you are using Wolf CMS 0.7.x, the location of some of the pages has changed. You will need to use the following instead. Since this uses url.rewrite-if-not-file, you will need at least version 1.4.24 of lighttpd.
url.rewrite-once = (
"^/wolf/install/index.html$" => "/wolf/install/index.php?rewrite=1",
"^/wolf/install/index.php$" => "/wolf/install/index.php?rewrite=1",
"^/wolf/install/$" => "/wolf/install/index.php?rewrite=1",
"^/wolf/install/(.*)$" => "/wolf/install/$1",
)
url.rewrite-if-not-file = (
"^/([^\?]+)(\?(.*)$)?" => "/index.php?WOLFPAGE=$1&$3"
)
The paths used in the rewrite code below assume that your Wolf CMS installation lives in a “site” directory below the root of the system, i.e. http://www.example.com/site.
Since Hiawatha does not have an equivalent of Apache's RewriteBase command, you will have to manually alter the paths below to conform to your Wolf CMS root.
You will need an UrlToolkit similar to this where 'site' is the folder in the web root where Wolf CMS is unpacked.
UrlToolkit {
ToolkitID = wolfcms
Match ^/site/install/index.html$ Rewrite /site/install/index.php?rewrite=1
Match ^/site/install/index.php$ Rewrite /site/install/index.php?rewrite=1
Match ^/site/install/$ Rewrite /site/install/index.php?rewrite=1
RequestURI exists Return
Match ^/site/admin(.*)$ Rewrite /site/admin/index.php?$1
Match ^/site(.*)$ Rewrite /site/index.php?WOLFPAGE=$1
}
Remember to enable this toolkit in your Virtual Host.
The 3 regex above RequestURI are used for clean url validation during installation only. They must be above RequestURI and can be commented out after installation.
You must have PreventSQLi disabled (is also the default I think).
The paths used in the rewrite code below assume that your Wolf CMS installation lives at the root of the site, i.e. http://www.example.com.
Since Nginx does not have an equivalent of Apache's RewriteBase command, you will have to manually alter the paths below to conform to your Wolf CMS root.
Put this in your server block:
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?WOLFPAGE=$1 last;
break;
}
You may also have to set the URL suffix to be blank
define('URL_SUFFIX', '');
in config.php
map path into SCRATCH:path from %{URL}
look for file at %{SCRATCH:path}
if exists then goto END
look for dir at %{SCRATCH:path}
if exists then goto END
match URL into $ with ^/(.*)$
if matched
look for file at $1
if not exists
set URL=/index.php?WOLFPAGE=$1
goto END
endif
endif
Available from Wolf CMS release: 0.6.0 (optional)
Cron is a daemon that executes commands at specified intervals. These commands are called “cron jobs.” Cron is available on Unix, Linux and Mac servers. Windows servers use a Scheduled Task to execute commands.
Wolf CMS itself does not require cron, but cron.php provides a cron_run event that can be used by plugins.
In the following example, the crontab command shown below will activate the cron tasks automatically on the hour:
0 * * * * wget -O - -q -t 1 http://www.example.com/wolf/app/cron.php
The above sample assumes you've installed Wolf CMS to the root of your site.
In the above sample, the 0 * * * * represents when the task should happen. The first figure represents minutes – in this case, on the “zero” minute, or top of the hour. (If the number were, say, 10, then the action would take place at 10 minutes past the hour.) The other figures represent, respectively, hour, day, month and day of the week. A * is a wildcard, meaning “every time.”
The rest of the line basically tells the server to “ping” the url http://www.example.com/wolf/app/cron.php.
Here is a diagram of the general crontab syntax, for illustration:
# +---------------- minute (0 - 59) # | +------------- hour (0 - 23) # | | +---------- day of month (1 - 31) # | | | +------- month (1 - 12) # | | | | +---- day of week (0 - 7) (Sunday=0 or 7) # | | | | | * * * * * command to be executed
Thus, the cron command example above means “ping http://www.example.com/wolf/app/cron.php at the zero minute on every hour of every day of every month of every day of the week.”
Cron jobs are scheduled by setting up a “crontab.” A crontab is a text file that contains the commands to be run. This file can be created and edited either through the command line interface, or, if you manage your website through a web-based control panel such as cpanel or Plesk, you will use the web interface. Check with your hosting company for detailed instructions if you are using a web-based control panel.
To edit a crontab through the command line, type:
crontab -e
If this fails, see the Troubleshooting Cron Jobs section below.
Add ONE of the following lines:
45 * * * * /usr/bin/lynx -source http://example.com/wolf/app/cron.php 45 * * * * /usr/bin/wget -O - -q -t 1 http://www.example.com/wolf/app/cron.php 45 * * * * curl --silent --compressed http://example.com/wolf/app/cron.php
This would have a lynx, wget, or curl visit your cron page 45 minutes after every hour.
Three options are provided in case either wget, lynx or curl are not installed on the server. Any will do the job well.
Learn more about the crontab file syntax here to set up the cron job to run more or less often.
There are many ways to configure a cron job. If you have full access to crontab features, you should be able to simply paste in one of the above example commands – be sure to replace “example.com” with your own web domain or docroot.
If you're on shared hosting, you should be able to find cron job configuration somewhere in your hosting control panel. Some hosts even have cron “wizards” that walk you through the cron configuration, making it much easier if cron is new to you. On a Windows system you can accomplish the same thing with scheduled tasks to launch Internet Explorer pointed to the URL.
If your hosting company restricts access to cron you have many options.
Cron doesn't guarantee your commands will run at the specified interval. But Wolf CMS will try its best to come as close as possible. The more you visit cron.php, the more accurate cron will be.
Since not everyone has access to cron or Scheduled Tasks on their system, we’ve also added “poormans cron” support. This allows a cron job to be started at certain intervals and works on the basis of visits you get to your site.
To use poormans cron, edit config.php and set:
define('USE_POORMANSCRON', true);
define('POORMANSCRON_INTERVAL', 3600);
This will enable the poorman's cron support and set the run interval to once every hour.
Please note that this works based on the visits to your site. This means if you have few visitors, the mechanism will be increasingly inaccurate. With more visitors, it will be more accurate. A normal cron job or sheduled task should always be preferred to the poorman's cron option!
If you receive a permission denied error after starting crontab -e, you may need to use sudo:
sudo crontab -e
You may need to adjust the path to wget, lynx or curl in your crontab. For example, the cron example listed above contains the line:
45 * * * * /usr/bin/lynx -source http://example.com/wolf/app/cron.php
However, Lynx may be in a different location on your server, or not installed at all. To find out where Lynx is installed, enter:
whereis lynx
or
which lynx
If it is not located at /usr/bin/lynx, adjust the path as needed. The same applies for wget and curl. If none are installed ask a server administrator for help.
It may be necessary to change http://example.com/wolf/app/cron.php to the location of your Wolf CMS installation. For example, if you have Wolf CMS installed in a subdirectory, for example “wolfcms”, it will be http://www.example.com/wolfcms/wolf/app/cron.php).
Taking this approach allows cron.php to be blocked to prevent remote access.
To block remote access to cron.php, in the server, .htaccess or vhost configuration file add this section:
<Files "cron.php">
Order Deny,Allow
Deny from all
Allow from localhost
Allow from 127.0.0.1
Allow from xx.xx.xx.xx <-- your IP address
</Files>
If you take this approach to call cron.php, it is probably best not to use the root user to run the cron job. A non-privileged user account, or the Apache account user, for example http-service or www-data, is a better choice. To do so, call crontab -e when logged in as a non-privileged user, or for the Apache account on a Debian server, for example, you can add a user parameter:
sudo crontab -e -u www-data
To setup a Windows machine to run cron.php at a specific time follow the specific instructions below. This can be useful if you are not familiar with Linux/Unix, or if your web host does not offer the ability to run cron jobs; you can run them remotely from your own computer.
Note: These instructions were written for Windows XP but should be similar in other versions of Windows.
Another way to perform the above commands is by using the schtasks (or at in Windows 2000) command from the command line. To duplicate the example above, which runs Firefox hourly to execute http://www.example.com/wolf/app/cron.php, open a command prompt (Start > Programs > Accessories > Command Prompt) and enter:
schtasks /create /tn "Wolf CMS Cron Job" /tr "C:\PROGRA~1\MOZILL~1\firefox.exe http://www.example.com/wolf/app/cron.php" /sc hourly
Enter your password if prompted.
If for whatever reason you'd rather not deal with a browser window popping up on the machine, you can use wget, the Windows port of which works more or less the same as it does in UNIX. curl and lynx also have windows ports but wget is probably the easiest to set up and use.
Grab a copy of wget from your choice of either the author's site or from SourceForge. Install it to the location of your choice.
Follow the steps for Creating A Scheduled Task above, except select wget.exe as the program to run (you may need to click the Browse button to locate it if you installed from a .zip file, for example). When you get to the Advanced Properties dialog, paste in the following after the program path:
-O - -q -t 1 http://www.example.com/wolf/app/cron.php
Adjust the rest of the options as described above and test it.
Every stable release of Wolf CMS includes upgrading instructions from the preceding version. Look in docs/upgrading.txt for full information.
There are some general tips you may want to follow in upgrading to new Wolf CMS versions. Please be aware though that these tips and this document cannot take into account any customizations you may have done on the Wolf CMS core or plugins code.
Please be aware that we only support single version upgrades.
This is a suggested update scenario. Please be aware that we cannot take any responsibility for any possible data loss that may occur. Also please be aware that this scenario does not take into account any possible customizations you may have done to the database structure, Wolf CMS core code or Wolf CMS plugins.
This upgrade scenarios re-uses the old database and its contents. This should work flawlessly, however, it does mean you will not have any new default data available to you.
Should re-using the database not work or if you want to have all of the data that comes with Wolf CMS by default, you will need to remove the old database, install from scratch using a clean database and then carefully copy over the contents of the old database for each table.
For obvious reasons, this is a much more time-consuming and risky scenario. Post 0.6.0 update methods of Wolf CMS include a BackupRestore plugin to aid you and help simplify this scenario.
As all administrators are aware, having correct backups of your machines and software is extremely important in the event of a calamity.
This section describes the best way to make a backup for disaster recovery purposes and documents the various methods used to create database backups.
DISCLAIMER - While we make every effort to give you correct and useful backup techniques, we are not responsible for any damage or loss of information that might occur.
Creating a filesystem backup is very easy in both a Unix/Linux and a Windows environment assuming you have the right tools available. We expect you to have:
We will describe the Unix/Linux and Windows procedures separately.
An example set of commands assuming Wolf CMS lives in a “wolf” subdirectory would be:
cd /home/myuser/www/wolf tar -cf /home/myuser/wolf-filebackup-20090325.tar * gzip /home/myuser/wolf-filebackup-20090325.tar
Your Wolf CMS database contains most of your site. It includes the layouts, snippets, users, plugin configurations and actual site contents. It is therefore crucial to have a complete and working backup.
Since each database system has its own unique backup techniques, we will describe the generally accepted methods to create a correct backup for each database type.
Generally speaking, you can create backups of a MySQL database with web-based tools like phpMyAdmin or the commandline tool mysqldump.
If you have an account with a hosting provider, you will need to check with them on how you can make a database backup. Some hosting provider provide you with backup options in the control panel that belongs to your site's account.
If you have commandline/ssh access to your account and want to use the mysqldump command:
# mysqldump --opt -u username -p databasename > database_backup_file.sql
For more detailed information on backup and recovery of MySQL databases, please see the following resources:
Nothing yet..
This administration book is an experimental product and consists of dynamically generated content consisting of other wolfcms.org wiki pages. We hope you like it!
If you enjoy and use Wolf CMS, consider donating to the project.
This content is licensed under the Creative Commons Attribution Non-Commercial Share Alike license.
That license lets others remix, tweak, and build upon this work non-commercially, as long as they credit the original author and license their new creations under the identical terms. Others can download and redistribute this work just like the by-nc-nd license, but they can also translate, make remixes, and produce new stories based on this work. All new work based on this work will carry the same license, so any derivatives will also be non-commercial in nature.
For the full license details, please see the original license text at:
http://creativecommons.org/licenses/by-nc-sa/3.0/ (Human readable)
http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode (Full legal text)