How to Install phpBB on Ubuntu 20.04

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Introduction

phpBB is an Internet forum package in the PHP scripting language. The name “phpBB” is an abbreviation of PHP Bulletin Board. Available under the GNU General Public License, phpBB is free and open-source.

Features of phpBB include support for multiple database engines (PostgreSQL, SQLite, MySQL, Oracle Database, Microsoft SQL Server), flat message structure (as opposed to threaded), hierarchical subforums, topic split/merge/lock, user groups, multiple attachments per post, full-text search, plugins and various notification options (e-mail, Jabber instant messaging, ATOM feeds).

It is easy to install phpBB on most web servers such as Apache and Nginx and also easy to administer and use.

In this tutorial, we learn how to install phpBB with Apache on Ubuntu 20.04.

Installation

Just follow the steps below:

  • Install LAMP stack (Apache-Mariadb-PHP)
#Update Packages
sudo apt update

#Install, start and enable apache 
sudo apt install apache2 -y
sudo systemctl start apache2
sudo systemctl enable apache2

#Install, start and enable Mariadb Database
sudo apt install mariadb-server -y
sudo systemctl start mariadb
sudo systemctl enable mariadb
  • Run the script below to secure maria database
mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current password for the root user.  If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
  • Install PHP on Ubuntu
sudo apt install php php-mysql
  • Install the following PHP modules that are required by PHPBB
sudo apt install php-net-ftp php7.4-ldap php7.4-common libapache2-mod-php7.4 php7.4-gd php7.4-curl openssl php-imagick php7.4-intl php7.4-json php7.4-imap php7.4-mbstring php7.4-mysql php7.4-zip unzip php7.4-pgsql php-ssh2 php7.4-xml php7.4-sqlite3 -y
  • Create database for phpBB using mariadb
sudo mysql -u root -p
  • Create the database for PHPBB, then create the user to the database and give all privileges to the user.
CREATE USER 'phpbb_user'@'localhost' IDENTIFIED BY 'unixcopPassword';
GRANT ALL ON phpbb_db.* to 'phpbb_user'@'localhost' IDENTIFIED BY 'unixcopPassword';
FLUSH PRIVILEGES;
\q
  • Download phpBB, At the time of writing this article, the latest release of PHPBB is version 3.3.5.
cd /mnt
sudo wget -c https://download.phpbb.com/pub/release/3.3/3.3.5/phpBB-3.3.5.zip

NOTE: You can download the latest version of phpBB from this link phpBB releases

  •  Unzip the compressed file
unzip phpBB-3.3.5.zip
  • Move it to the root directory and rename it to phpbb 
sudo mv phpBB3 /var/www/html/phpbb
  • Set the appropriate ownership and permissions
sudo chown -R www-data:www-data /var/www/html/phpbb
sudo chmod -R 755 /var/www/html/phpbb
  • Configure a virtual host for phpBB
sudo vim /etc/apache2/sites-available/phpbb.conf
  • Then add the following
<VirtualHost *:80>
      ServerAdmin [email protected]
      DocumentRoot /var/www/html/phpbb
      ServerName phpBBunixcop.com

      <Directory /var/www/html/phpbb>
                Options FollowSymlinks
                AllowOverride All
                Require all granted
       </Directory>

ErrorLog ${APACHE_LOG_DIR}/phpBBunixcop.com_error.log
CustomLog ${APACHE_LOG_DIR}/phpBBunixcop.com_access.log combined

</VirtualHost>
  • Enable the PHPBB virtual host.
sudo a2ensite phpbb
  • Enable the Apache rewrite module.
sudo a2enmod rewrite
  •  Restart the Apache
sudo systemctl restart apache2
  • Open your browser and type the URL shown http://IP_server or http://domain.com for me http://phpbbunixcop.com

The Welcome Page provides introduction to PHPBB.

  • Click on the INSTALL to complete the installation
  • Welcome to the installation, to continue click Install
  • Fill in information of the Admin user and password then click on Submit as shown belwo
  • Enter the phpbb database details that we created before then click submit
  • Next, Click submit with these default server configurations
  • Fill in the details of the SMTP server including the server address, port, SMTP username, and password, and click Submit. If email functionality is not configured, simply click Submit without changing anything
  • Configure the settings of the Bulletin Board such as the default language, Board Title, and a short description of the board. Then click Submit
  • The installer will install the files needed for PHPBB. after it finishes click on the ACP link shown below in the screenshot.
  • It takes you to the Administration control panel, Also to check phpBB version go to Administration Control Panel and click Admin index as shown below.
  • PHP version is displayed as shown belwo

Conclusion

That’s it

In this tutorial we illustrated how to install phpBB on Ubuntu 20.04.

Thank you

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
MQ-Jr
MQ-Jr
unixcop Admin

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook