Cookbook: Setting up phpBB

You will need PHP support correctly configured in Cherokee, and PHP with the MySQL module installed. The default configuration already provides a valid PHP configuration for Cherokee if you have php-cgi installed, but you can follow the appropriate recipe about setting up PHP in case you don’t have it available for some reason.

Under these conditions, you could start the installation and you would already be able to have your site up and running.


phpBB can be installed quite easily. Download the latest package, decompress it and point your browser to the corresponding URL.

In this example, we will be installing everything under /var/www/phpBB3 and will set that as document root in cherokee-admin for our server, which will be hosting contents for the domain You can modify this going to Virtual serversdefaultBasicsDocument Root. You can delete all the unnecessary rules of your default out-of-the-box configuration.

Rule list

This is all you need to do with Cherokee, for now.

If you intend to use the same domain, insert the appropriate entry in your /etc/hosts or equivalent file.

Entry for your /etc/hosts       localhost

First download the phpBB3 package and proceed decompressing it to the desired path.

Second, create the database for the installation. Log in to MySQL with your administration user and password:

mysql -u root -p

And create the database. We will be using the name phpbb, the user phpbbuser and the password phpbbpassword, but you should set up your own.

GRANT ALL PRIVILEGES ON phpbb.* TO phpbbuser@localhost IDENTIFIED BY 'phpbbpassword';
GRANT ALL PRIVILEGES ON phpbb.* TO [email protected] IDENTIFIED BY 'phpbbpassword';

Configuring with the Wizard

Cherokee-Admin provides a wizard for phpBB that will configure the web server appropriately. Just find it under the Web Applications category, provide some basic information and you are good to go.

Then point your web browser to and follow all the steps. Basically you will have to provide the database information and troubleshoot any possible warning, but the process is fairly straight forward.

Database settings
Administrator details
Configuration file
Advanced settings
Create database tables
Final stage

Once you are done you will be redirected to the Administration control panel. If not, you should have a link at the bottom of the page. You need to eliminate the /var/www/phpBB3/install subdirectory or you will not be allowed to go any further.


It is just a security precaution. Once you have done this, you can proceed.

After deletion

The basic installation is done. You can see the software running just by accessing

phpBB running

URL rewrites

To beautify your URLs you will need to write some redirection rules and apply some patches. This feature seems to not be supported in phpBB, so you will have to download phpBB’s mod_rewrite module and apply the patch. There are several alternative patches available from different sources. Since you will need to modify by hand some code, your best alternative is probably sticking to some pre-modded version.

One such version is phpBB SEO. Make sure the release you are using matches that of your installed phpBB.

After applying the fixes, mostly overwriting the files with the ones provided, you will have to generate an .htaccess file. It will not work for Cherokee, but it will give you the rewrite-directives that need to be translated.

These need to be created as Regular Expression type rules that match our translated directives. The rules must be Final and managed by the Redirection handler. Within the handler you will need to specify only the type -Internal - and substitution to perform. The regular expression is inherited, so no need to re-type it.

Just one precaution must be taken before you start playing around with rewriting rules. Despite these, you will probably want to ensure that existing files, directories or symbolic links are used instead of matching (and re-directing) them with rewrite rules. To do this you will have to create one File exists-type rule that matches any file and that is both Final and managed by the list & send or static handlers.

Once you start creating new rules, just make sure to keep the PHP -non final- one at the top of the list and that the next one is your static file managing rule.

This is a set of rewrites that is known to have worked with phpBB3 and phpBB-SEO simple. Please use them as an orientation, since they could very well fail with the specific phpBB mod_rewrite patch you are using.

Basic forum access

Regular Expression




Topics with virtual folder

Regular Expression




Global announces with virtual folder

Regular Expression




Topic without forum ID & DELIM

Regular Expression





Regular Expression




User messages

Regular Expression





Regular Expression





Regular Expression




The team

Regular Expression

^/the-team\.html$ /memberlist.php?mode=leaders


^/[a-z0-9_-]+/?(p([0-9]+)\.html)?$ /viewforum.php?start=$2