How To Set Up PHPBB With Template

From OpenLiteSpeed Wiki

Revision as of 18:45, 13 November 2014 by Marmstrong (talk | contribs) (Install phpBB)

In the following article we will guide you through the steps to set up virtual hosts running phpBB, a popular open source bulletin board system written in PHP. The first part of this article will cover importing the template. After the template is imported, you just need to create virtual hosts for each domain you want to run with phpBB and install phpBB in those virtual hosts. We will be installing the latest version of phpBB, phpBB 3.0.11.

Note: Any setting not specifically noted in this walkthrough can be left as the default.

Import the phpBB template

1. Download the phpBB template file.

2. Save the template file to /usr/local/lsws/conf/templates/phpbb.xml.

3. Make sure user lsadm has write permission.

chown lsadm /usr/local/lsws/conf/templates/phpbb.xml

4. Add the template on the WebAdmin console.

WebAdmin console > Configuration > Virtual Host Templates > Add
Template Name: phpbb (name it anything as long as it does not conflict with existing templates)
Template File: $SERVER_ROOT/conf/templates/phpbb.xml
Mapped Listeners: Default
Note: In order for the server to direct traffic to the proper vhost, you must have listeners set up to listen on the proper IP and port. When you use a virtual host template, you do not have to define listener-to-virtual host mappings in the listener settings. Instead you set the mapped listeners when adding a template. In the above settings, we have used the listener "Default", which is set up to listen on port 8088 of "ANY" IP by default. You must adjust your listener settings to make sure there are listeners on the IP and ports you need. (The easiest way to do this is for most sites to just change the port setting to "80" for the Default listener in WebAdmin console > Configuration > Listeners > Default > General. This gives you a listener listening on port 80 of all IPs.)

5. Graceful restart to apply changes. (Actions > Graceful Restart)

Set up virtual hosts using the template

1. Create a member virtual host from the template.

WebAdmin console > Configuration > Virtual Host Templates > phpbb > Member Virtual Hosts > Add
Virtual Host Name: test1
Note: We have named our phpBB vhost "test1". You can name it whatever you want, but remember to then replace any instances of "test1" in this tutorial with the name of your virtual host.

2. Create directories for this vhost.

As the root user, run the following commands:
mkdir -p /usr/local/lsws/test1/{html,logs,conf}
chown lsadm:lsadm /usr/local/lsws/test1/conf

3. Graceful restart to apply changes. (Actions > Graceful Restart)

Your new vhost is now live and ready for Mediawiki. All you have to do is install them.

Install phpBB

1. Install PHP

The easiest way to install PHP for OpenLiteSpeed is through our CentOS repository. If the LiteSpeed Repository was not installed and enabled during the web server installation, follow this guide to install and enable the LiteSpeed Repository.

Use the following command to install PHP with the modules required:

yum install lsphp55 lsphp55-common lsphp55-gd lsphp55-process lsphp55-mbstring lsphp55-mysql
Note: There are four versions of LSPHP (lsphp53, lsphp54, lsphp55, lsphp56) available.

Direct LSWS to the location of the installed PHP. (In this example, PHP 5.5 is installed by default in /usr/local/lsws/lsphp55/bin/lsphp. Change the value of the WebAdmin console > External App > your external application > Command setting to reflect that.)

If you are not using RedHat or CentOS, or you prefer to build PHP by yourself, see our instructions for building PHP for phpBB here.

3. Download phpBB into your virtual host document root: /usr/local/lsws/test1/html

cd /usr/local/lsws/test1/html
tar jxf phpBB-3.0.11.tar.bz2
mv phpBB3 phpbb
rm phpBB-3.0.11.tar.bz2

4. Set up a MySQL database and user for phpBB.

yum install mysql mysql-server
service mysqld start
mysql -u adminusername -p
mysql> create database phpbb
mysql> grant all privileges on phpbb.* to db_user@'localhost' identified by 'password'

5. Graceful restart to apply changes. (Actions > Graceful Restart)

6. Point your browser to http://localhost:8088/phpbb/install/index.php to run the phpBB installer.

7. Once complete, your newly installed phpBB (http://server_ip:8088/phpbb/) should be ready to use.