CSUF LogoCSUF Site Navigation
optics.csufresno.edu

F14 Apache/MySQL/PHP Services & Applications phpBB

Department of Electrical and Computer Engineering
Associate Professor Gregory R. Kriehn
Forums
Wiki
F14 phpBB

phpBB is a "high powered, fully scalable, and highly customizable Open Source bulletin board package. phpBB has a user-friendly interface, simple and straightforward administration panel, and helpful FAQ. Based on the powerful PHP server language and your choice of MySQL, MS-SQL, PostgreSQL or Access/ODBC database servers, phpBB is the ideal free community solution for all web sites."

phpBB recently upgraded from Version 2 to Version 3, so this page is going to concentrate on the process of upgrading the board from V2 to V3.

Installation of the Bulletin Board requires first heading over to their website:

http://www.phpbb.com/

Click on the Download Latest Release link on the right side. At the time of this writing, the current version of phpBB is phpBB 3.0.6. Scroll down to the Full Package
section, choose the Download phpBB 3.0.6 (bz2) link, and download the compressed phpBB-3.0.*.tar.bz2 file. Once it downloads, move the file to /var/www/html:
~> sudo mv ~/Download/phpBB-3.0.*.tar.bz2 /var/www/html/.
Then decompress the source:
~> sudo tar vfjx phpBB-3.0.*.tar.bz2
Once the package has been decompressed, delete the source file, make a backup of your old directory, and move the new directory to forums:
~> sudo rm phpBB-3.0.*.tar.bz2
~> sudo mv forums forums-bak
~> sudo mv phpBB3 forums
Next change the permissions so that Apache maintains ownership using chown:
~> sudo chown -R apache.apache forums
Now, before you can install phpBB, you need to create a new database. This can be done a couple of ways. Choose either Option 1, or Option 2, but not both.


Option 1 - MySQL

Login to MySQL using root:
~> mysql -u root -p
Type in the MySQL super user password, and hit Enter.

Next, create a database called phpbb3:

mysql> create database phpbb3;
and verify its existence:
mysql> show databases;
You should now see a database called phpbb3. With the database created, exit:
mysql> exit;

Option 2 - phpMyAdmin


Login to your phpMyAdmin account. Under Create new database, enter "phpbb3". Then click on the Create button. After clicking the button, you should see a statement that says:  "Database phpbb3 has been created". Once finished, click on the green Exit icon to exit phpMyAdmin.


Run the Install Script

To run the installation script, open Firefox and go to the following address:
http://[host].[domain].[name]/forums/install/index.php
This will launch the phpBB3 Installation Page.  

Under OVERVIEW, look over the Introduction, License, and Support links.  When you are satisfied, click on the INSTALL tab, followed by Proceed to next step.

Verify that you PHP version and settings, and the mbstring extension check are all green.  If not, start Googling. Also verify that you have MySQL installed, and that the Files and Directories permissions are set correctly.  Do not worry if config.php is currently unwritable.  Click Start Install when you are satisfied with the installation compatibility settings.

Under Database type: click on MySQL from the drop down menu.  The Database server hostname or DSN: should be "localhost".  Leave the Database server port: blank, and under Database name:, type "phpbb3". For the Database username:, type "root", and for the Database password: type in the MySQL super use rpassword. Verify that "phpbb_" is being used for the Prefix for tables in database". Click Proceed to next step.

You should see Successful connection under the Database connection page. If not, did you remember to create your phpbb3 database first? Then click on Proceed to next step.

Under Administrator details, leave the Default board language: as is, and choose an Administrator username: and Administrator password: (ideally it should be the same one you are using for phpBB2). Confirm the password and type in your e-mail address under Contact e-mail address: and confirm it. Then click on Proceed to next step.

Under Administrator details, you should see Tests passed.  Then click on Proceed to next step.

Under Configuration file, you should see The configuration file has been written.  Then click on Proceed to next step.

Set your options under the E-mail settings (I left mine on default), as well as the Server URL settings (again, I used the default ones provided). When finished, click on Proceed to next step, followed by Proceed to next step once again.

If you want to convert an old phpBB 2.0.x board, make sure you click on the proceed on to the convertor link. Then click on the Convert link on the far right.

Under the Specify conversion options page, most of the options should already be in place. However, you will probably have to change the Database name:, which in my case, is "phpbb" (the database of my old board). Type in the MySQL super user password under Database password: and since we changed the old board to forums-bak, under Board path: type in "../forums-bak". Then click on Begin conversion.

Once the information has been verified, click on Begin conversion, Continue conversion. Do not worry if some of your old smilies did not overwrite themselves into the new board (they are already there).

Next, ensure that both the install/ and contrib/ directories are deleted:
~> cd /var/www/html/forums
~> sudo rm -r install/
~> sudo rm -r contrib/
Likewise, let's change the permissions on config.php so that it is no longer world writable:
~> sudo chmod go-w config.php
Finally, adjust SELinux to ensure that e-mail works on the board:
~> sudo setsebool -P httpd_can_sendmail 1
If you now point yourself to http://[host].[domain].[name]/forums, you will be taken to the phpBB page. If you click on the Log in link, you can login with your administration username and password. Do so now to verify that you can log into your board, and then exit.


Customization of phpBB - Installation of Styles

At this point, I like to install the proglass style, as it fits more closely to Fresno State's (and my web site's) color scheme. If you go to the phpBB website, perform a search for proglass, or you can go directly to the forum announcement here and here. Download the main package, as well as the MOD for extending Proglass to 1024px. Once it downloads, move the files over to the /var/www/html/forums/styles directory:
~> sudo mv ~/Downloads/proglass*.zip /var/www/html/forums/styles/.
Change to the styles directory:
~> cd /var/www/html/forums/styles
and unzip the files:
~> sudo unzip proglass.zip
~> sudo unzip proglass_1024x_mod
Once the package has been unzipped, delete the source files, and change the permissions of the directory. From there, change into the proglass directory:
~> sudo rm proglass*.zip
~> sudo chown -R apache.apache proglass*
~> cd proglass
The next thing that I like to do is change the overall header for the theme. If you open up the ./template/overall_header.tpl file using sudo, perform a search for the following code:
<div id="site-description">
    <a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>
    <h1>{SITENAME}</h1>
    <p>{SITE_DESCRIPTION}</p>
    <p class="skiplink"><a href="#start_here">{L_SKIP}</a></p>
</div>
I like to have my image link back to the main site, and create a forum link for the Site Description. Change it to:
<div id="site-description">
    <a href="http://optics.csufresno.edu/" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>
    <h1>{SITENAME}</h1>
    <p><a href="http://optics.csufresno.edu/forums/"
          title="{SITE_DESCRIPTION}">{SITE_DESCRIPTION}</a></p>
    <p class="skiplink"><a href="#start_here">{L_SKIP}</a></p>
</div>
Now edit the ./imageset/imageset.cfg file to change the logo:
img_site_logo = laserlight.png*88*88
Copy your appropriate image file into the ./imageset subdirectory. Then copy the ./imageset/en subdirectory to the ./imageset/en_us subdirectory so that your buttons work:
~> sudo cp -r ./imageset/en ./imageset/en_us
To install 1024px mod, open the /var/www/html/forums/styles/proglass_1024x_mod file and follow the directions. Then open the ./theme/common.css file and tweek the h1 and search-box definitions :
h1 {
        /* Forum name */
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        margin-right: 200px;
        color: #FFFFFF;
        margin-top: 34px;
        font-weight: bold;
        font-size: 3em;
}

...

#search-box {
        color: #FFFFFF;
        position: relative;
        position: top center;
        margin-top: 45px;
           margin-right: 5px;
          display: block;
        float: right;
        text-align: right;
        white-space: nowrap; /* For Opera */
}
I tweeked the margin-top and position elements to center things up  a bit. Save and exit.

With that done, go back to http://[host].[domain].[name]/forums, and login. Click on the bottom link that says Go to Administration Panel and type in your password once again. Then click on the STYLES tab, the Styles link under STYLE MANAGEMENT, and  on Install under proglass. The selected theme should install successfully.

Then click on the GENERAL tab, and start customizing your board.


Security and Admin Changes


There are two other mods that I like to add to phpBB3 in order to improve the security of the forum.

1.  Security Question
Under the USERS AND GROUPS tab in the ACP, click on Custom profile fields under the USERS subsection. Create a new field called security_question, and set it up for the registration screen so that an additional security question is asked of the user.

2. Crazy Maths CAPTCHA Plugin

Description:

A CAPTCHA that shows a complex math question to the user / bot in question. The administrator can define these questions and typeset them with LaTeX-style notation.

http://www.phpbb.com/community/viewtopic.php?t=1795915

Follow the directions to install the plugin.


Additional Help

If you need additional help, I suggest heading over to the phpBB website and clicking on either the Support or Community links. You should be able to get most of your questions answered there.


Upgrading phpBB

The easiest way to update your phpBB installation is to follow the appropriate directions in the Knowledge base:

http://www.phpbb.com/kb/article/how-to-update-to-the-latest-version-of-phpbb3/?sid=544e700c5cc6cd278b10700c595dc25a

Since I have MODs installed, I upgrade using the .patch files.