How To Install Icinga 2 on Ubuntu 16.04

Install Icinga 2 on Ubuntu 16

Icinga 2 is an open source network monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting. Its Scalable and extensible, Icinga2 can monitor large, complex environments across multiple locations.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Icinga network monitoring on a Ubuntu 16.04 (Xenial Xerus) server.

Icinga 2 Features:

Monitoring of network services (SMTP, POP3, HTTP, NNTP, ping, etc.)
Monitoring of host resources (CPU load, disk usage, etc.)
Monitoring of server components (switches, routers, temperature and humidity sensors, etc.)
Simple plug-in design that allows users to easily develop their own service checks,
Parallelized service checks.
Ability to define network host hierarchy using “parent” hosts, allowing detection of and distinction between hosts that are down and those that are unreachable.
Ability to define event handlers to be run during service or host events for proactive problem resolution.
Notification of contact persons when service or host problems occur and get resolved (via email, pager, or user-defined method).
Escalation of alerts to other users or communication channels.
Two optional user interfaces (Icinga Classic UI and Icinga Web) for visualization of host and service status, network maps, reports, logs, etc.
Icinga Reporting module based on open source Jasper Reports for both Icinga Classic and Icinga Web user interfaces
Capacity utilization reporting.
Performance graphing via add-ons such as PNP4Nagios, NagiosGrapher and InGraph.

Install Icinga 2 on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 <code>php7.0-mcrypt
</code>

Step 3. Installing Icinga 2.

First, enable the add-repository feature and add the repository for Icinga with the below commands:

apt install software-properties-common
add-apt-repository ppa:formorer/icinga

Install Icinga 2 package:

apt update
apt install icinga2

Once the installation is complete. Make sure the service is up and running fine:

systemctl status icinga2.service
systemctl enable icinga2.service
systemctl start icinga2.service

By default, Icinga2 enables the following features. But we can confirm the enabled settings by running this command as below:

icinga2 feature list

Step 3. Installing Icinga2 plugin.

Icinga2 will collect the service information based on the monitoring plugins. So, we need to install nagios plugin using below command:

apt install nagios-plugins

Next, you need to install the IDO module which is crucial for the Icinga 2 web interface. It will export all configuration and status information into its database. Execute the following command:

apt install icinga2-ido-mysql

Then restart Icinga 2 for the changes to take effect:

systemctl restart icinga2.service

Once you enabled the IDO modules, Icinga 2 places the new configuration file at /etc/icinga2/features-enabled/ido-mysql.conf in which we need to update the database credentials manually:

cat /etc/icinga2/features-enabled/ido-mysql.conf

Update the above file shown like below:

root@:wpcademy.com~# nano /etc/icinga2/features-enabled/ido-mysql.conf
/**
* The db_ido_mysql library implements IDO functionality
* for MySQL.
*/
library "db_ido_mysql"
object IdoMysqlConnection "ido-mysql" {
user = "icinga2",
password = "icinga123",
host = "localhost",
database = "icinga2"
}

Step 4. Configuring MariaDB for Icinga 2.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

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

Next we will need to log in to the MariaDB console and create a database for the Icinga 2. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Icinga 2 installation:

MariaDB [(none)]> create database icinga2;
MariaDB [(none)]> grant all privileges on icingaweb.* to icinga2@localhost identified by 'icinga123';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> \q

Step 5. Installing Icinga 2 Web.

After creating the database, we can install the Web interface plugin and configure it one by one:

apt-get install icingaweb2

Step 6. Accessing Icinga 2.

Icinga2 will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/icingaweb2/setup or http://server-ip/icingaweb2/setup and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.
icingaweb2

Congratulation’s! You have successfully installed Icinga 2. Thanks for using this tutorial for installing Icinga 2 network monitoring on Ubuntu 16.04 LTS systems. For additional help or useful information, we recommend you to check the official Icinga 2 web site.

How To Install Sublime Text 3 on Ubuntu 16.04

Install Sublime Text 3 on Ubuntu 16

Sublime Text is a cross-platform text and source code editor with a Python API. It is a sophisticated text editor for code, markup and prose. Its functionality is extendable with plugins. Most of the extending packages have free-software licenses and are community-built and maintained.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Sublime Text 3 on a Ubuntu 16.04 (Xenial Xerus) server.
Sublime Text 3 Features

“Goto Anything,” quick navigation to files, symbols, or lines
“Command palette” uses adaptive matching for quick keyboard invocation of arbitrary commands
Simultaneous editing: simultaneously make the same interactive changes to multiple selected areas
Python-based plugin API
Project-specific preferences
Extensive customizability via JSON settings files, including project-specific and platform-specific settings
Cross platform (Windows, OS X, Linux)
Compatible with many language grammars from Textmate.
proprietary software, may be downloaded and evaluated for free, however a license must be purchased for continued use.

Install Sublime Text 3 on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Sublime Text 3.

The Sublime Text 3 is currently in beta. Webupd8 Team has made an installer script into PPA which automatically downloads the Sublime Text 3 archive from its website and installs it on Ubuntu. First, you have to add the PPA to your system, update the local repository index:

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update

After added the PPA, run commands to install the script:

sudo apt-get install sublime-text-installer

Once installed, open the editor from Unity Dash or Menu. To disable new version notifications, add the following to your User Preferences file (Preferences > Settings – User):

"update_check": false

Congratulation’s! You have successfully installed Sublime Text 3. Thanks for using this tutorial for installing Sublime Text editor on Ubuntu 16.04 LTS systems. For additional help or useful information, we recommend you to check the official Sublime Text web site.

How To Install Open Source Social Network on Ubuntu 16.04

Install Open Source Social Network on Ubuntu 16

Opensource-Social network (OSSN) is a social networking software written in PHP. It allows you to make a social networking website and helps your members build social relationships, with people who share similar professional or personal interests.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Open Source Social Network (OSSN) on a Ubuntu 16.04 (Xenial Xerus) server.

Install Open Source Social Network on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 <code>php7.0-mcrypt
</code>

Step 3. Installing Open Source Social Network.

First thing to do is to go to OSSN’s download page and download the latest stable version of OSSN, At the moment of writing this article it is version 4.2:

cd /opt/
wget https://www.opensource-socialnetwork.org/downloads/ossn-v4.2-1468404691.zip -O ossn.zip
unzip ossn.zip -d /var/www/html/

We will need to change some folders permissions:

chown -R www-data.www-data /var/www/html/ossn/

Step 4. Configuring MariaDB for Open Source Social Network.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

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

Next we will need to log in to the MariaDB console and create a database for the OSSN. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for OSSN installation:

MariaDB [(none)]> SET GLOBAL sql_mode='';
MariaDB [(none)]> CREATE DATABASE ossndb;
MariaDB [(none)]> CREATE USER 'ossnuser'@'localhost' IDENTIFIED BY 'y0ur-pAssW0RD';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON ossndb.* TO 'ossnuser'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Step 5. Configuring Apache web server for Open Source Social Network.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘ossn.conf’ on your virtual server:

sudo a2enmod rewrite
touch /etc/apache2/sites-available/ossn.conf
ln -s /etc/apache2/sites-available/ossn.conf /etc/apache2/sites-enabled/ossn.conf
nano /etc/apache2/sites-available/ossn.conf

Add the following lines:

ServerAdmin [email protected]
DocumentRoot /var/www/html/ossn/
ServerName your-domain.com
ServerAlias www.your-domain.com

Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common

Next, You can edit the PHP configuration file:

nano /etc/php/7.0/cli/php.ini

And modify these lines:

allow_url_fopen = On
file_uploads = On
upload_max_filesize = 32M

OSSN also needs a directory for storing the uploaded files such as images. For security reasons we will create this directory outside of the document root directory:

mkdir -p /var/www/ossndatadir

Finally, we can restart Apache web server so that the changes take place:

systemctl restart apache2.service

Step 6. Accessing Open Source Social Network.

Open Source Social Network will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/ or http://server-ip/ and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel. Log in to the OSSN administration back-end at http://your-domain.com/administrator and configure OSSN according to your needs.

Congratulation’s! You have successfully installed Open Source Social Network. Thanks for using this tutorial for installing Open Source Social Network on Ubuntu 16.04 systems. For additional help or useful information, we recommend you to check the official Open Source Social Network web site.

How To Install MediaWiki on Ubuntu 16.04

Install MediaWiki on Ubuntu 16

MediaWiki is a free and open source wiki software, used to power wiki websites such as Wikipedia, Wiktionary and Commons, developed by the Wikimedia Foundation and others. It is written in the PHP programming language and uses a backend database.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation MediaWiki on a Ubuntu 16.04 (Xenial Xerus) server.

Install MediaWiki on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install imagemagick php7.0-intl php7.0-curl php7.0-gd php7.0-mbstring php7.0-mysql

Step 3. Installing MediaWiki.

First thing to do is to go to MediaWiki’s download page and download the latest stable version of MediaWiki, At the moment of writing this article it is version 1.8.7:

wget https://releases.wikimedia.org/mediawiki/1.27/mediawiki-1.27.1.tar.gz

Unpack the MediaWiki archive to the document root directory on your server:

tar -xvzf mediawiki-1.27.1.tar.gz
mv /opt/mediawiki-1.27.1/ /var/www/html/mediawiki

We will need to change some folders permissions:

chown -R www-data.www-data /var/www/html/mediawiki

Step 4. Configuring MariaDB for MediaWiki.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

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

Next we will need to log in to the MariaDB console and create a database for the MediaWiki. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for MediaWiki installation:

MariaDB [(none)]> CREATE DATABASE wikidb;
MariaDB [(none)]> CREATE USER 'wikiuser'@'localhost' IDENTIFIED BY 'y0uR-passW0rd';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wikidb.* TO 'wikiuser'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Step 5. Configuring Apache web server for MediaWiki.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘mediawiki.conf’ on your virtual server:

sudo a2enmod rewrite
rm /etc/apache2/sites-enabled/000-default.conf
touch /etc/apache2/sites-available/mediawiki.conf
ln -s /etc/apache2/sites-available/mediawiki.conf /etc/apache2/sites-enabled/mediawiki.conf
nano /etc/apache2/sites-available/mediawiki.conf

Add the following lines:

ServerAdmin [email protected]
DocumentRoot /var/www/html/mediawiki/
ServerName your-domain.com
ServerAlias www.your-domain.com

Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common

Now, we can restart Apache web server so that the changes take place:

systemctl restart apache2.service

Step 6. Accessing MediaWiki.

MediaWiki will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com or http://server-ip and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.
mediawiki-dashboard
At the end of the installation, you will need to upload the file to /var/www/html. You can do that via FTP, but to speed up the process, just open the downloaded file with a text editor, copy all the content from it and paste it to a new LocalSettings.php file

that you can create using the following command:

nano /var/www/html/LocalSettings.php

Congratulation’s! You have successfully installed MediaWiki. Thanks for using this tutorial for installing MediaWiki in Ubuntu 16.04 LTS (Xenial Xerus) systems. For additional help or useful information, we recommend you to check the official MediaWiki web site.

How To Install Laravel on Ubuntu 16.04

Install Laravel on Ubuntu 16

Laravel is a free, open-source PHP web application framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern. It is a pretty new framework, but with a big potential to become one of the most popular PHP frameworks.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Laravel on a Ubuntu 16.04 (Xenial Xerus) server.

Install Laravel on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install imagemagick php7.0-intl php7.0-curl php7.0-gd php7.0-mbstring php7.0-mysql php7.0-mcrypt

Step 3. Install Composer.

Install Composer which is the tool for dependency management in PHP:

curl -sS https://getcomposer.org/installer | sudo php

In this tutorial we will put the composer in our /usr/local/bin/ directory. We will also rename the composer name from composer.phar to composer. To do that type the following command:

mv composer.phar /usr/local/bin/composer

Give execute permission to the composer:

chmod +x /usr/local/bin/composer

Step 4. Installing Laravel.

Download latest version of Laravel, Use below command to clone master repo of laravel from github, At the moment of writing this article it is version 5:

cd /var/www
git clone https://github.com/laravel/laravel.git

After than move to the laravel code directory and use composer to install all dependencies required for Laravel framework:

cd /var/www/laravel
composer install

This will take a while according to the network speed. After than set proper permissions on files:

chown -R www-data.www-data /var/www/laravel
chmod -R 755 /var/www/laravel
chmod -R 777 /var/www/laravel/app/storage

Now set the 32 bit long random number encrypption key, which used by the Illuminate encrypter service:

### php artisan key:generate

Application key [Lf54qKbi3mwe463qR4NtYywgf9JdRGDTN0oV9qI] set successfully

Now edit config/app.php configuration file and update above generated application key as followings. Also make sure cipher is set properly:

y' => env('APP_KEY', 'Lf54qKbi3mwe463qR4NtYywgf9JdRGDTN0oV9qI'),

'cipher' => 'AES-256-CBC',

Step 5. Configuring Apache web server for Laravel.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘laravel.conf’ on your virtual server:

sudo a2enmod rewrite
sudo a2ensite laravel.conf
touch /etc/apache2/sites-available/laravel.conf
ln -s /etc/apache2/sites-available/laravel.conf /etc/apache2/sites-enabled/laravel.conf
nano /etc/apache2/sites-available/laravel.conf

Add the following lines:

ServerAdmin [email protected]
DocumentRoot /var/www/laravel/public
ServerName your-domain.com
ServerAlias www.your-domain.com

Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common

Now, we can restart Apache web server so that the changes take place:

systemctl restart apache2.service

Step 6. Accessing Laravel.

Laravel will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com or http://server-ip and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed Laravel. Thanks for using this tutorial for installing Laravel in Ubuntu 16.04 LTS (Xenial Xerus) systems. For additional help or useful information, we recommend you to check the official Laravel web site.

How To Install Monitorix on Ubuntu 16.04

Install Monitorix on Ubuntu 16

Monitorix is a free, open source, lightweight system monitoring tool designed to monitor server, service and devices. Monitorix allows to monitor overall system performance and also help in detecting bottlenecks, failures, unwanted long response times and other abnormal activities.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Monitorix Network Monitoring Tool on a Ubuntu 16.04 (Xenial Xerus) server.
Monitorix features

Global kernel usage
Unlimited number of network ports supported.
Unlimited number of Apache servers supported.
Ability to define the number of graphs per row.
Ability to enable traffic monthly reports.
Ability to zoom in any graph.
Ability to show network metrics in MBytes/sec or Mbits/sec.
Monitors Disk drive temperatures and health.
Filesystem usage and I/O activity of filesystems.
Network traffic usage up to 10 network devices.
Netstat statistics.
System services demand (SSH, ProFTPD, Samba, CUPS, Fail2ban, IMAP, POP3, SMTP, etc…)
Squid Proxy Web Cache statistics.
Built-in HTTP server.
MTA Mail statistics including input and output connections
Network port traffic including TCP, UDP, etc.

Install Monitorix on Ubuntu 16.04

Step 1. First add the Monitorix Repository, open /etc/apt/sources.list file as shown below.

nano /etc/apt/sources.list

Place the cursor to the end of the file and add this line and save the file and exit from the file.

deb http://apt.izzysoft.de/ubuntu generic universe

Once the repository is added, we have to download (or add) the PGP key and “install” it into the system as shown below:

wget http://apt.izzysoft.de/izzysoft.asc

Go to the directory where the .asc file is saved and run the following command:

sudo apt-key add izzysoft.asc

Now, make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal:

apt-get update

Step 2. Installing Monitorix.

After updating the repository, run the following command to install Monitorix:

apt-get -y install monitorix apache2-utils

Step 3. Configure Monitorix.

To configure Monitorix, open /etc/monitorix/monitorix.conf file as shown below:

nano /etc/monitorix/monitorix.conf

Search for the following lines:

enabled = n
msg = Monitorix: Restricted access
htpasswd = /var/lib/monitorix/htpasswd

And enable authentication by changing it to “y”.

enabled = y
msg = Monitorix: Restricted access
htpasswd = /var/lib/monitorix/htpasswd

Save the file and exit.Once configured, we have to restart the monitorix service:

systemctl start monitorix

Create the password for Monitorix:

htpasswd -d -c /var/lib/monitorix/htpasswd admin

Step 4. Accessing MediaWiki.

Monitorix will be available on HTTP port 8080 by default. Open your favorite browser and navigate to http://yourdomain.com:8080/monitorix/ or http://server-ip:8080/monitorix/. If you are using a firewall, please open port 80 to enable access to the control panel.
Monitorix-network-monitoring
Congratulation’s! You have successfully installed Monitorix. Thanks for using this tutorial for installing Monitorix Network Monitoring Tool in Ubuntu 16.04 LTS (Xenial Xerus) systems. For additional help or useful information, we recommend you to check the official Monitorix web site.

How To Install MyBB on Ubuntu 16.04

Install MyBB on Ubuntu 16

MyBB, also known as MyBBoard or MyBulletinBoard, is very popular and free forum software developed using PHP and MySQL. With everything from forums to threads, posts to private messages, search to profiles, and reputation to warnings, MyBB features everything you need to run an efficient and captivating community.

Install MyBB on Ubuntu 16.04

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation MyBB on a Ubuntu 16.04 (Xenial Xerus) server.

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 <code>php7.0-mcrypt
</code>

Step 3. Installing MyBB.

First thing to do is to go to MyBB’s download page and download the latest stable version of MyBB, At the moment of writing this article it is version 1.8.7:

wget https://resources.mybb.com/downloads/mybb_1807.zip

Unpack the MyBB archive to the document root directory on your server:

unzip mybb_1807.zip -d /var/www/html

We will need to change some folders permissions:

chown -R www-data.www-data /var/www/html/mybb/

Step 4. Configuring MariaDB for MyBB.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

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

Next we will need to log in to the MariaDB console and create a database for the MyBB. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for MyBB installation:

MariaDB [(none)]&gt; create database mybb;
MariaDB [(none)]&gt; grant all privileges on mybb.* to mybbuser@localhost identified by 'your_password';
MariaDB [(none)]&gt; FLUSH PRIVILEGES;
MariaDB [(none)]&gt; \q

Step 4. Configuring Apache web server for MyBB.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘mybb.conf’ on your virtual server:

sudo a2enmod rewrite
touch /etc/apache2/sites-available/mybb.conf
ln -s /etc/apache2/sites-available/mybb.conf /etc/apache2/sites-enabled/mybb.conf
nano /etc/apache2/sites-available/mybb.conf

Add the following lines:


ServerAdmin [email protected]
DocumentRoot /var/www/html/mybb/
ServerName your-domain.com
ServerAlias www.your-domain.com

Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common

Next, rename the config.default.php file in the inc directory to config.php since you will be asked to do this later during the MyBB installation via browser. Execute the following:

mv inc/config.default.php inc/config.php

Now, we can restart Apache web server so that the changes take place:

systemctl restart apache2.service

Step 5. Accessing MyBB.

MyBB will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/ or http://server-ip/ and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed MyBB. Thanks for using this tutorial for installing MyBB in Ubuntu 16.04 LTS (Xenial Xerus) systems. For additional help or useful information, we recommend you to check the official MyBB web site.