Install MyBB on Ubuntu Server

Published on April 21, 2016 by Daniel Lanza

 ubuntu  mybb

This tutorial will explain how to install MyBB in Ubuntu Server.

Requirements

A Ubuntu Server virtual machine with:

Check out these posts to get ready:

Our virtual machine has two network adapters. The second one (eth1) is a host-only adapter with a static IP address -> 192.168.56.101

Apache Web Server

Apache Web Server needs to be running. The installation and configuration was indicated in the previous post.

sudo apt-get install apache2

Install MySQL

MySQL will be the database management system.

We have installed MySQL. However, we are going to install other libraries and modules that let MyBB communicate easily with the database.

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

Install PHP

PHP is a requirement for MyBB.

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

Restart Apache2.

sudo service apache2 restart

Check out PHP is working.

By default, HTML and PHP files needs to be placed in /var/www/html. So, we are going to create a simple PHP file in that path.

sudo nano /var/www/html/info.php

Type the following content and save the file.

<?php phpinfo(); ?>

Check out you can display the PHP file on your local machine by typping http://192.168.56.101/info.php.

PHP info file
PHP info file

MySQL configuration

MySQL database needs to be initialized with the following command:

sudo mysql_install_db

Then, our database needs to be secure. Run the following command:

sudo mysql_secure_installation

And answer the following questions. Feel free to change your answers 😃

Apache configuration

PHP files needs to take preference over HTML files. Hence, we are going to change Apache file configuration.

sudo vim /etc/apache2/mods-enabled/dir.conf

Make sure index.php is before index.html

<IfModule mod_dir.c>
      DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

Save and restart Apache.

sudo service apache2 restart

Database for MyBB

We need to create a database for our application. Log into MySQL as root user.

mysql -u root -p

You will be in MySQL interface (mysql >).

Create an empty database.

CREATE DATABSE mybb;

Create a user.

CREATE USER 'mybbuser'@'localhost' IDENTIFIED BY 'password';

Grant permissions to the new user.

GRANT ALL PRIVILEGES ON mybb.* TO 'mybbuser'@'localhost';

Reload all privileges with a flush command and exit the MySQL interface.

FLUSH PRIVILEGES;
exit

Install MyBB

We are going to download the MyBB package, so we are going to create a temp folder to place them.

mkdir ~/temp
cd ~/temp

Download MyBB package, unzip and place Upload directory in ~/temp. You can do it by FTP or Samba.

sudo mv ~/temp/Upload /var/www/htm/forum

The installation wizard is available in the following address: http://192.168.56.101/forum/install/

Installation wizard
Installation wizard
Requirements check
Requirements check

As you can see, there are some errors because we need to meet MyBB requirements.

First, we place into /var/www/htm/forum

cd /var/www/htm/forum

Rename inc/config.default.php to inc/config.php.

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

Check again the MyBB requirements by the following url -> http://192.168.56.101/forum/install/.

Requirements check
Requirements check

Give write permissions to cache/, uploads/ and uploads/avatars/.

sudo chmod 777 cache
sudo chmod 777 uploads
sudo chmod 777 uploads/avatars

Check out again the MyBB requirements, and now we meet them. So, we can follow the installation.

Requirements check
Requirements check

Fill out the database configuration.

Database configuration
Database configuration

The installation wizard will create tables for MyBB application.

Table creation
Table creation
Table population
Table population
Theme insertion
Theme insertion
Board configuration
Board configuration
Create administrator account
Create administrator account
Finish setup
Finish setup

Congratulations! You have successfully installed your MyBB. Go to your new MyBB forum -> http://192.168.56.101/forum/.

Remove install directory
Remove install directory

Ups! Remove the install directory from your server to prevent other user runs the installation again.

sudo rm -r /var/www/forum/install

Try again the forum url -> http://192.168.56.101/forum/.

MyBB forum
MyBB forum

You got it! Enjoy your new MyBB forum on Ubuntu Server 😃

comments powered by Disqus

See also

Setting up a Virtual Web Server with VirtualBox, Apache, MySQL, FTP, Ubuntu, and Samba

This tutorial will explain how to set up a Ubuntu Server virtual machine with: Apache FTP Samba First, check out how to install Ubuntu Server on VirtualBox to get ready a virtual machine to test. Our virtual machine has two network adapters. The second one (eth1) is a host-only adapter with a static IP address -> 192.168.56.101 Apache Web Server Apache Web Server needs to be running. The installation and configuration was indicated in the previous post.

Read more

Install Ubuntu Server 14.04.4 on VirtualBox

This tutorial will explain how to install Ubuntu Server on a virtual machine. First, you need to have Ubuntu Server ISO file and VirtualBox installed. VirtualBox Ubuntu Server Create a new virtual machine on VirtualBox by clicking on New. Create new virtual machine Select type and version of the virtual machine. In this case, Linux and Ubuntu (64-bits). Select type and version of the virtual machine Select the amount of memory (RAM).

Read more