phpBB on Almalinux 9

How to Install phpBB on AlmaLinux 9

phpBB is an acronym for PHP Bulletin Board. It is a fully scalable and customizable open-source forum written in PHP. It can be used to to create forums, start topics and share ideas.

In this tutorial we will show you how to install phpBB on AlmaLinux 9 using the LAMP stack.

Step 1: Update Operating System

Update your AlmaLinux 9 operating system to make sure all existing packages are up to date:

# dnf update

Also, install:

# dnf install wget nano unzip

Step 2: Install Apache web server

To install Apache web server, run the following command:

# dnf install httpd

Apache does not start automatically when it is installed, you need to start it:

# systemctl start httpd

Then enable it to start on boot time.

# systemctl enable httpd

If firewalld is enabled consider allowing HTTP and HTTPS services:

# firewall-cmd --permanent --add-service={http,https}
# firewall-cmd --reload

Step 3: Install PHP and required PHP modules

In this section we will install PHP and PHP extensions required to run phpBB with the following command:

# dnf install php php-mysqli php-gd php-zip php-intl php-mbstring php-json

Once the installation is complete, verify the version of PHP installed:

# php -v
Output:
PHP 8.0.13 (cli) (built: Nov 16 2021 18:07:21) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.13, Copyright (c) Zend Technologies
with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies

Step 4: Install MariaDB and create a database

To be able to install MariaDB on AlmaLinux 9 you need to add the MariaDB YUM repository:

# curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

Once the repository has been added to the system, installing MariaDB is an easy task that can be accomplished with the following command:

# dnf install mariadb-server

Start the database server daemon, and also enable it to start automatically at the next boot with the following commands:

# systemctl start mariadb
# systemctl enable mariadb

Verify the installed version of MariaDB.

# systemctl status mariadb

Output:

 mariadb.service - MariaDB 10.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running)
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 47677 (mariadbd)
Status: "Taking your SQL requests now..."
Tasks: 11 (limit: 10951)
Memory: 71.2M
CPU: 2.238s
CGroup: /system.slice/mariadb.service
└─47677 /usr/libexec/mariadbd --basedir=/usr

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script:

mysql_secure_installation

Configure it like this:

Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Once the database server is installed, log into the MariaDB prompt:

#  mysql -u root -p

To create a database, database user, and grant all privileges to the database user run the following commands:

MariaDB [(none)]> CREATE DATABASE phpbb_db;
MariaDB [(none)]> CREATE USER 'phpbb_user'@'localhost' IDENTIFIED BY 'Passw0rd';
MariaDB [(none)]> GRANT ALL ON phpbb_db.* TO 'phpbb_user'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT

Step 5: Download phpBB forum

The phpBB forum is not available to download or install using the AlmaLinux package repositories. We have to download its files manually from its official website.

The version of phpBB as of this writing is 3.3.8.

Change directory to /tmp directory, you can use any directory:

# cd  /tmp

Use the following command to download phpBB forum:

# wget https://download.phpbb.com/pub/release/3.3/3.3.8/phpBB-3.3.8.zip

Extract file into the folder /var/www/html with the following command,

# unzip phpBB-3.3.8.zip -d /var/www/html

Rename the extracted directory:

# mv /var/www/html/phpBB3 /var/www/html/phpbb

Enable permission for the Apache webserver user to access the phpBB files,

# chown -R apache:apache /var/www/html/phpbb

Step 6: Configure Apache Web Server for phpBB forum

Navigate to /etc/httpd/conf.d directory and run the following command to create a configuration file for your phpBB installation:

# nano /etc/httpd/conf.d/phpbb.conf

Add the following content:

<VirtualHost *:80>

ServerName your-domain.com

ServerAdmin [email protected]
DocumentRoot /var/www/html/phpbb

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

ErrorLog /var/log/httpd/your-domain.com_error.log
CustomLog /var/log/httpd/your-domain.com_access.log combined

</VirtualHost>

Save the file and Exit.

Restart the Apache web server.

# systemctl restart httpd

Step 7: Install phpBB forum on AlmaLinux 9

Open your browser and complete the final steps e.g http://your-domain.com

phpBB install

To start the installation, click the ‘Install’ tab then click install.

phpbb on AlmaLinux 9

Fill in the details of the Administrator user and password and click on ‘Submit‘.

Administrator Configuration

Fill up the database configuration:

Database Configuration

For the server configuration you can just leave the default settings and click ‘Submit’:

phpBB server configuration

 

In this steps you will ask to provide your SMTP settings, if email functionality is not configured, simply click ‘Submit‘ without changing any parameter.

Email Configuration

Specify the settings of the Bulletin Board such as the default language, Board Title, and a short description of the board. Then click ‘Submit‘:

Bulletin board Configuration

Finally, the installation should be complete!

phpBB on AlmaLinux 9

Click on ‘the ACP‘ link provided. This takes you to the Admin panel shown:

Administration Control Panel

Now, delete the ‘Install‘ folder to access the create, delete the posts and access the features of the phpBB forum software.

Go to your server terminal and run this command:

# rm -rf /var/www/html/phpbb/phpbb/install

Comments and Conclusion

That’s it. You have successfully installed phpBB on AlmaLinux 9.

If you have any questions please leave a comment below.

Leave a Reply

Your email address will not be published. Required fields are marked *