PhpBB/Installation

From r00tedvw.com wiki
Jump to: navigation, search

Installation done on a VM running Ubuntu 14.04LTS

Contents

Download required pacakages

~$ sudo apt-get update && sudo apt-get -y install apache2 mysql-server mysql-client php5 php5-mysql php5-gd imagemagick

If you're going to install MediaWiki aswell, then add an extra pacakge

~$ sudo apt-get install -y libapache2-mod-php5

Configure MySQL

login to db

~$ mysql -u root -p

Create mysql phpBB user

~$ mysql> CREATE USER 'phpBB'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';
~$ mysql> exit

login as new user to verify account works

~$ mysql -u phpBB -p
~$ mysql> exit

create DB

~$ mysql -u root -p
~$ mysql> CREATE DATABASE phpBB;

verify DB creation

~$ mysql> SHOW DATABASES;

assign rights to wiki user for new database created

~$ mysql> GRANT ALL PRIVILEGES ON phpBB.* TO 'phpBB'@'localhost' IDENTIFIED BY 'phpBBuserpassword' WITH GRANT OPTION;
~$ mysql> exit

verify permissions have been granted

~$ mysql -u phpBB -p
~$ mysql> SHOW GRANTS;
+--------------------------------------------------------------------------------------------------------------+
| Grants for phpBB@localhost                                                                                   |
+--------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'phpBB'@'localhost' IDENTIFIED BY PASSWORD '*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' |
| GRANT ALL PRIVILEGES ON `phpBB`.* TO 'phpBB'@'localhost' WITH GRANT OPTION                                   |
+--------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Download phpBB

download the latest version (at the time of this writing was 3.0.12)

~$ wget https://www.phpbb.com/files/release/phpBB-3.0.12.zip
--2014-09-28 04:51:36--  https://www.phpbb.com/files/release/phpBB-3.0.12.zip
Resolving www.phpbb.com (www.phpbb.com)... 140.211.15.9
Connecting to www.phpbb.com (www.phpbb.com)|140.211.15.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2487985 (2.4M) [application/zip]
Saving to: ‘phpBB-3.0.12.zip’

100%[=====================================================================================================================>] 2,487,985    1.11MB/s   in 2.1s   

2014-09-28 04:51:38 (1.11 MB/s) - ‘phpBB-3.0.12.zip’ saved [2487985/2487985]

verify the md5. this is available on the downloads page, in this case it was MD5: e86ffc334ea53d934c0c1c0588429803

~$ md5sum phpBB-3.0.12.zip
e86ffc334ea53d934c0c1c0588429803  phpBB-3.0.12.zip

create your site's directory where phpBB will live. If you're using a subsite design, like the example below, make sure to create the directories in the same path structure.

~$ mkdir /var/www/yoursite.com/forums

make sure your apache user has appropriate permissions to write to this directory

~$ chown www-data:www-data ./forums

unzip the phpBB zip to the new directory you created

~$ unzip phpBB-3.0.12.zip -d /var/www/yoursite.com/forums

this will unfortunately create a directory called phpBB3 underneath, which is not desired. we'll have to move the contents of phpBB3 into the forums directory. You may need to modify permissions of the forums directory for this to work, so i've included that step in my instructions.

~$ ls -la
total 12
drwxr-xr-x  3 www-data www-data 4096 Sep 28 05:03 .
drwxr-xr-x  4 root     root     4096 Sep 28 04:59 ..
drwxr-xr-x 13 www-data www-data 4096 Sep 28 05:15 forums
~$ chmod 777 ./forums/
~$ cp -r /var/www/yoursite.com/forums/phpBB3/ /var/www/yoursite.com/forums/
~$ rm -rf /var/www/yoursite.com/forums/phpBB3/
~/forums$ ls
adm    common.php  cron.php  download  feed.php  images    index.php  language  memberlist.php  report.php  store      styles   viewforum.php   viewtopic.php
cache  config.php  docs      faq.php   files     includes  install    mcp.php   posting.php     search.php  style.php  ucp.php  viewonline.php  web.config
~$ chmod 755 ./forums/

Configure Apache2

Since we're going with a subsite configuration, the virutalhost file is going to be simple and only point to the site's root directory

~$ sudo vi /etc/apache2/sites-available/yoursite.com.conf
add:
<VirtualHost *:80>
        ServerName yoursite.com
        ServerAdmin [email protected]
        DocumentRoot /var/www/yoursite.com
        TransferLog /var/log/apache2/yoursite.com-access_log
        ErrorLog /var/log/apache2/yoursite.com-error_log
</VirtualHost>

Set File/Folder Permissions

There are a few specific folders and files will need to be opened so users can upload data to them, such as images/avatars

/var/www/yoursite.com/config.php
/var/www/yoursite.com/store
/var/www/yoursite.com/cache
/var/www/yoursite.com/files
/var/www/yoursite.com/images/avatars/upload/
~/forums$ sudo chmod 777 config.php cache files store images/avatars/upload/

And for good measure, restart apache2

~$ sudo service apache2 restart
 * Restarting web server apache2
   ...done.

Enable site and test connectivity

Moment of truth, enable the site

~$ sudo a2ensite yoursite.com.conf

Required restart of apache2

~$ sudo service apache2 restart
 * Restarting web server apache2
   ...done.

Navigate to the installation webpage

The rest of the installation/configuration is going to be done directly from the webpage, similar to mediawiki, but with the difference that it directly writes to the config.php file unlike mediawiki which requires you to cut and paste the contents of the config file.
In the case of this server, since the forums were created as a subsite, I navigated over to:

http://yoursite.com/forums/install

Before you being with the configuration, make sure you have the following information (which you should if you followed the steps above)

  • Database Type : mysql
  • Database server hostname: localhost (if on the same host) OR hostname of the database server (if on another machine)
  • Database name: phpBB
  • Datebase username & password: phpBB:phpBBuserpassword

On the website, you simply have to do the following steps:

  1. click the Install tab
  2. click Proceed to next step
  3. now you'll land on the Requirements page, take a good look and make sure everything shows as ok. You should only have (1) Database type listed as green, the rest will be red and thats ok. Everything else though should be in green, including the files & directories that we went over earlier.
  4. if everything checks out, at the bottom of the Requirements page will be a link to "Start Install"
  5. configure the database settings that you took note of earlier and click on "Proceed to next step"
  6. from here phpBB will attempt to connect to the database. If successful, you'll see a "Successful Connection" displayed and be able to click "Proceed to next step"
  7. fill out all of the administrator user credentials, like username, password, email, etc. and click "Proceed to next step"
  8. this page will show confirmation that the admin account was created successfully. click "Proceed to next step"
  9. almost done! the installer will now indicate if it was able to write to the config.php file. You should see "The configuration file has been written. You may now proceed to the next step of the installation.", after which you'll want to click the usual "Proceed to next step"
  10. from here you'll want to go through the advanced settings to customize your phpBB instance. In my case I was fine with the default settings as I did not have a separate SMTP server and was not ready to implement SSL.
  11. on the next page you should get the following notification "The database tables used by phpBB 3.0 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB."
  12. click "Proceed to next step" one last time you should be greeted with the Final Stage page indicating that the phpBB forums have been setup.

Final Steps

Final steps are pretty easy.
Remove/move/rename the install directory. I dont like to lose copies of stuff so I created a new directory and moved the contents to it

~$ sudo mkdir install_backup
~$ sudo cp -r ./install/* ./install_backup/
~$ sudo rm -rf ./install/

Just to make sure someone couldn't access it, I also removed permissions to the backup

~$ sudo chmod 000 install_backup/

Change the permissions for config.php, writing to it on a global level is no longer needed

~$ sudo chmod 644 /var/www/yoursite.com/config.php

And once again, another restart of apache2

 ~$ sudo service apache2 restart
 * Restarting web server apache2
   ...done.



Installation should now be complete and you can move on to customizing your forums!

Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
2020 Election
Volkswagen
Covid
NCDMV
Toolbox