phpBB is an open source internet forum software written in PHP. phpBB is one of the most widely used bulletin board system.
In this tutorial we will guide you on how to install phpBB using the LAMP stack.
Let’s start with the installation.
Installing PHP and PHP extensions
In this section we will install PHP and PHP extensions required to run phpBB.
First Let us update our system.
sudo apt update && apt upgrade
Let us install PHP and PHP extensions.
sudo apt install php libapache2-mod-php-zip php-xml php-gd php-curl openssl php-imagick php-intl php-json php-ldap php-common php-mbstring php-mysql php-imap php-sqlite3 php-net-ftp unzip php-pgsql php-ssh2
2. Creating Database and Database user
In this step we will create a Database and Database user for our phpBB site. To do that we first we need to enter to the MySQL terminal.
mysql -u root -p
Let us create a database.
MariaDB [(none)]> create database phpBB;
MariaDB [(none)]> grant all privileges on phpBB.* to 'phpbb_user'@'localhost' identified by 'mypassword';
Please don’t forget to change ‘mypassword‘ to your desired password.
Let us save the changes we made and exit;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;
3. Download phpBB
Now that PHP and MariaDB is setup we will now download Drupal. The version of phpBB as of this writing is 3.3.5.
First we need to change directory.
cd /var/www/
Let us download phpBB.
wget https://download.phpbb.com/pub/release/3.3/3.3.5/phpBB-3.3.5.zip -O phpBB.zip
Let’s extract the file.
unzip phpBB.zip
Remove the phpBB.zip file and rename the extracted directory.
rm -r phpBB.zip
mv phpBB3 phpBB
Change the ownership of the phpBB directory to the Apache user www-data.
chown -R www-data:www-data /var/www/phpBB/
Fix the permission of the Drupal directory.
sudo find /var/www/phpBB/ -type d -exec chmod 755 {} \;
sudo find /var/www/phpBB/ -type f -exec chmod 644 {} \;
The first command will find and set all directories to 755 and the second will look for all the files and set the permission to 644.
4. Creating Apache Virtual Host
Let us create a virtual host for our phpBB site.
sudo nano /etc/apache2/sites-available/phpbb.com.conf
Add the following on the phpbb.com.conf file.
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/phpBB
ServerName domain.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/phpBB/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Don’t forget to change the Servername directive to your domain.
Then save and exit.
Before we restart the Apache web server we need to enable the Apache mod_rewrite. To do that run this command.
sudo a2enmod rewrite
Now Let’s enable the virtual host we created.
sudo a2ensite phpbb.com.conf
Then restart the Apache webserver.
sudo systemctl restart apache2
5. Finalizing the phpBB Installation
Now that the Apache virtual host is setup you can now access your site to finalize the phpBB installation. To do that you need to open your Web Browser and access your site http://domain.com.
To start the installation, click the install tab then click install.
Fill up the administrator configuration form, then click submit.
Fill up the database configuration:
DSN: localhost
Database server port: 3306
Database username: database user set in step 2
Database password: database password set in step 2
Database Name: database name set in step 2
Prefix for tables in database: Just leave the default
After filling up the database configuration click submit.
For the server configuration you can just leave the default settings and click submit.
In this steps you will ask to provide your SMTP settings, but you can leave the default settings if you don’t want to setup the SMTP settings at this time. Please click submit to proceed.
Set the title and description of your bulleting board then click submit.
Wait for the installation to finish.
Congratulations you have successfully installed phpBB forum.
Conclusion
You have learned how easy to install phpBB on Ubuntu 20.04 with the LAMP stack. If you like this article you might like also our article on SMF .
If you have questions, feel free to leave a comment and we will try to answer it.
Thank you and hope you enjoy our tutorial ?