How to install MyBB Forum Software on Ubuntu 18.04 LTS
MyBB is a free, open source and powerful forum software written in PHP language and uses MariaDB to store their data. It provides lots of features such as support of various plugins, widget support, customizable themes and many more.
In this tutorial, we will learn how to install MyBB forum on Ubuntu 18.04 server.
Requirements
- A server running Ubuntu 18.04.
- A root password is setup to your server.
Getting Started
Before starting, you will need to update your system with the latest version. You can do this by running the following command:
apt-get update -y
apt-get upgrade -y
Once your server is updated, restart your server to apply the changes.
Install LAMP Server
Next, you will need to install Apache, MariaDB server, PHP and other required packages to your server. You can install all of them by running the following command:
apt-get install apache2 mariadb-server php7.2 php7.2-mysql php7.2-curl php7.2-json php7.2-cgi libapache2-mod-php7.2 php7.2-xmlrpc php7.2-gd php7.2-mbstring php7.2 php7.2-common php7.2-xmlrpc php7.2-soap php7.2-xml php7.2-intl php7.2-cli php7.2-ldap php7.2-zip php7.2-readline php7.2-imap php7.2-tidy php7.2-recode php7.2-sq php7.2-intl wget unzip -y
Once all the packages are installed, open php.ini file and make some changes:
nano /etc/php/7.2/apache2/php.ini
Make the following changes:
file_uploads = On allow_url_fopen = On memory_limit = 256M upload_max_filesize = 30M post_max_size = 40M max_execution_time = 60 max_input_vars = 1500
Save and close the file. Then, start Apache and MariaDB service and enable them to start on boot time with the following command:
systemctl start apache2
systemctl start mariadb
systemctl enable apache2
systemctl enable mariadb
Configure Database
By default, MariaDB is not secured. So, you will need to secure it. You can do this by running the mysql_secure_installation script:
mysql_secure_installation
Answer all the questions as shown below:
Enter current password for root (enter for none): Set root password? [Y/n]: N 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 MariaDB is secured, log in to MariaDB shell with the following command:
mysql -u root -p
Enter your root password when prompt. Then, create a database and user for MyBB using the following command:
MariaDB [(none)]> CREATE DATABASE mybbdb;
MariaDB [(none)]> CREATE USER 'mybb'@'localhost' IDENTIFIED BY 'password';
Next, grant all the privileges to MyBB database with the following command:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mybbdb.* TO 'mybb'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Next, flush the privileges and exit from the MariaDB shell with the following command:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
Install MyBB
Next, you will need to download the latest version of MyBB from their official website. You can do it with the following command:
wget https://resources.mybb.com/downloads/mybb_1815.zip
Once the download has been completed, extract the downloaded file to the Apache web root directory with the following command:
unzip mybb_1815.zip -d /var/www/mybb
Next, you will need to rename default config file. You can do it with the following command:
cd /var/www/mybb/Upload/inc
cp config.default.php config.php
Next, give proper permissions to the mybb directory with the following command:
chown -R www-data:www-data /var/www/mybb/
chmod -R 755 /var/www/mybb/
Once you have done, you can proceed to the next.
Configure Apache for MyBB
Next, you will need to create an Apache virtual host file for MyBB. You can create it with the following command:
nano /etc/apache2/sites-available/mybb.conf
Add the following lines:
<VirtualHost *:80> ServerAdmin [email protected] ServerName example.com DocumentRoot /var/www/mybb/Upload/ <Directory /var/www/mybb/Upload/> AllowOverride All allow from all </Directory> ErrorLog /var/log/apache2/mybb_error.log CustomLog /var/log/apache2/mybb_access.log combined </VirtualHost>
Save and clsoe the file, when you are finished. Then, enable mybb virtual host file with the following command:
a2ensite mybb
Next, enable Apache rewrite module and restart Apache service with the following command:
a2enmod rewrite
systemctl restart apache2
Next, verify the status of Apache web server with the following command:
systemctl status apache2
You should see the following output:
? apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Drop-In: /lib/systemd/system/apache2.service.d ??apache2-systemd.conf Active: active (running) since Wed 2019-01-27 8:56:45 UTC; 6s ago Process: 6498 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 6517 (apache2) Tasks: 1 (limit: 1114) CGroup: /system.slice/apache2.service ??6517 /usr/sbin/apache2 -k start March 27 8:56:45 ubuntu1804 systemd[1]: Starting The Apache HTTP Server... March 27 8:56:45 ubuntu1804 apachectl[6498]: AH00557: apache2: apr_sockaddr_info_get() failed for ubuntu1804 March 27 8:56:45 ubuntu1804 apachectl[6498]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127$ March 27 8:56:45 ubuntu1804 systemd[1]: Started The Apache HTTP Server.
Access MyBB Web Interface
MyBB is now installed and configured, it's time to access MyBB web interface.
Next, open your web browser and type the URL http://example.com. You will be redirected to the following page:
Now, click on the Next button. You should see the License agreement in the following page:
Now, accept the license agreement by clicking on the Next button. You should see the following page:
Make sure all the required packages has been installed. Then, click on the Next button. You should see the following page:
Next, provide your database details like database name, username, and password. Then, click on the Next button. You should see the following page:
After creating all the tables. Click on the Next button. You should see the following page:
Now, click on the Next button to populate the table. You should see the following page:
Now, click on the Next button to load and import them and template. You should see the following page:
Now, provide all the required board configuration details and click on the Next button. You should see the following page:
Now, click on the admin account details and click on the Next button. Once the installation has been completed successfully, you should see the following page:
Now, click on the Admin Control Panel. You should see the following page:
Now, provide your admin username and password. Then, click on the Login button. You should see the MyBB default dashboard in the following page:
Congratulations! you have successfully installed and configured MyBB forum on Ubuntu 18.04 server. Feel free to ask me if you have any questions.