Forum Authority

Full Version: [Web Tutorial] How to setup & install MyBB on Ubuntu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
[Image: mybb-logo.png]

Tutorial Parts:
1. Information
2. Updating your server
3. Setting Up The Web-Server
4. Install the SQL Server
5. Installing Apache & PHP
6. Setting up the database
7. Downloading MyBB
8. Installing MyBB



Information:
Hello everyone, I see you are interested in learning how to setup & install MyBB on Ubuntu 14.04. In this tutorial I will guide you step by step on how to do that! 

My server specs:
These specs are more then enough for a new forums.
1 vCore
2.4 GHz
2 GB RAM
10 GB SSD
Ubuntu 14.04 Server

Updating your server:
[spoiler]
When you first login to your server you're going to need to update it using the command listed below:
[Image: 3c01cd6cb3e14b09a74d95633a953d04.png]
Code:
apt-get update && apt-get upgrade
[/spoiler]

Setting Up The Web-Server
In this part of the tutorial I will guide you step by step on how to successfully setup your web server in order to run MyBB. 

Install the SQL Server:
[spoiler]
We will start by installing the SQL Server known as MariaDB. If you aren't sure what MariaDB is please refer to this site.
[Image: 61f801a979914155ab0fa252b6ff82e6.png]
Code:
apt-get install mariadb-server mariadb-client

Make sure to use a secure password that you will easily remember(or write it down) to avoid any problems down the road. 
[Image: ecdd7b56daf348b49d67d12fdcca946a.png]
After MariaDB finish installing, run the following command and follow the steps listed below:
[Image: 41a0ce7ecac54d8fb5640deb99a98dd8.png]
                                                                              
Code:
mysql_secure_installation

Enter current password for root (enter for none): <-- Type in the password you used during the installment.
Change root password: [Y/n] <-- N
Remove anonymous users? [Y/n] <-- y

Disallow root login remotely? [Y/n] <-- y
Reload privilege tables now? [Y/n] <-- y

After you finished running the command above, and went through the questions. You will now need to make sure everything was a success. Run the following command, and type in the password you used during the installment of MariaDB.
[Image: f81717aa52524d85adbe67f797ec8486.png]

Code:
mysql -u root -p

If everything was setup correctly, you should see something like:
[Image: 7026549b3ef04ed4b407b277847f8c02.png]
[/spoiler]

Installing Apache & PHP
In this part of the tutorial I will guide you step by step on installing Apache 2 & PHP 5.6. 
[spoiler]
Apache 2:
Run the following command to install Apache 2 (web server). 
[Image: 44e9793077b94ccaa500038c20e0b52c.png]
Code:
apt-get -y install apache2

Now let's check if apache2 installed correctly, open your web browser and type in the IP of your server and it should display a page such as: http://image.prntscr.com/image/10f10724e...418209.png

PHP 5.6 & Apache Module:
We are now ready to install PHP 5.6 and the Apache PHP module.
[Image: e0795a4f9bf543cf8e7206cbbd4557c5.png]

Code:
apt-get -y install php5 libapache2-mod-php5

Now restart Apache 2 using the following command:
Code:
service apache2 restart

In order to ensure PHP 5.6 installed with no problems, we will create a file to view the php information:
[Image: e9bfbbede99842bbaaeb90644b3375b7.png]

Code:
nano /var/www/html/info.php
Paste the following code inside the newly created file:
Code:
<?php
phpinfo();
?>
Save it by pushing CTRL+O (to save it) followed by CTRL+X to exit out of the editor. 

Now open your web browser and type in YOURIP/info.php it should display something like this:  here.

Installing extra php extensions required by MyBB:
In this part of the tutorial I will guide you step by step on installing the required php extensions to ensure you have no problems down the road. 
[Image: 57e1b241829f437893ff0c840a6422b7.png]
Code:
apt-get -y install php5-mysqlnd && apt-get -y install php5-gd && apt-get -y install php5-xmlrpc &&
apt-get -y install php5-mysql

After the php extensions finish installing, you'll need to restart your apache 2 server by running the following command:
Code:
service apache2 restart

Now that your web server is successfully setup, you no longer need the temp info.php file we created earlier in the tutorial. Run the following command to remove it:

Code:
rm -f /var/www/html/info.php
 [/spoiler]

Setting up the database:
In this part of the tutorial I will guide you step by step on setting up the database that you'll use for your MyBB forums.
[spoiler]
Run the following command to connect to your MariaDB by running the following command:
[Image: 3dee46fc38cf4c2e9ca7e0ab5b487064.png]
Code:
mysql -u root -p

Now that you have connected to your MariaDB run the following command to create a new database & user by running the following commands.

Creating the database:
[Image: 89d8a0b663944afbbb44704c1e9391d7.png]
Code:
create database forums;

Creating a new user and granting permissions to the newly created database:
[Image: 1986ab361c9e47ea8715f7399e82ae58.png]
Code:
grant all on forums.* to 'test' identified by 'password';

Now exit the MariaDB by running the following command:
[Image: 68f28833bd75412da7bec58c586b9e40.png]
Code:
exit

[/spoiler]

Downloading MyBB
In this part of the tutorial I will guide you step by step on how to download & install MyBB. 
[spoiler]
In this tutorial we are going to be using the latest MyBB release at the moment MyBB 1.8.7.

You'll need to go to the root directory of your website for this part of the tutorial, run the following command:
[Image: dacf1325c75948e3a18758555a6bd6c4.png]
Code:
cd /var/www/html/

Download MyBB by running the following command:
[Image: 0f734b3dd73a49e08f6f8f5ed80d690e.png]
Code:
wget https://resources.mybb.com/downloads/mybb_1807.zip

When MyBB finishes downloading, you'll need to unzip it by using the following command: 
[Image: 0ff31a3f60c449338c89e4cc5feab115.png]
Code:
unzip mybb_1807.zip

We will remove two directories that we don't need to avoid having useless things on the server. Run the following command: 
[Image: fb242831bad342b889fd56a0d68df0d0.png]
Code:
rm -f Documentation/ && rm -f mybb_1807.zip

Now that you have removed the two unwanted directories, we'll need to move the MyBB files to the websites root directory by running the following command:
[Image: abea25081f4946aea0cf2b190e9b7740.png]
Code:
mv /var/www/html/Upload/* /var/www/html/

Renaming the default config file:
You'll need to rename the config.default.php to config.php by running the following command:
[Image: c1f49be5027a4cffa4d7fd9c4f39852f.png]
Code:
mv config.default.php config.php


Setting the permissions for certain files
Some files require special permissions in order to work correctly. Run the following commands to ensure these permissions are setup. 

Code:
chmod 666 inc/config.php inc/settings.php
chmod 777 cache/ cache/themes/ uploads/ uploads/avatars/

Optionally, you can also apply the following permissions:

Code:
chmod 666 inc/languages/english/*.php inc/languages/english/admin/*.php
chmod 777 cache/ cache/themes/ uploads/ uploads/avatars/ admin/backups/

[/spoiler]
Installing MyBB 
In this part of the tutorial I will guide you step by step on installing MyBB.
[spoiler]
If you followed the tutorial step by step, then your requirements check page should look kind of like this:
[Image: 95a2bf5bc4554dd7af977849683f4908.png]

During this step you will config the database settings, you'll need to use the database information you created earlier in the tutorial:
[Image: 946fb1b666614d5eb1f0e4f58b6eb938.png]


You are now ready to setup the board settings as shown below. Anywhere you see IP OR DOMAIN, please make sure to type in your own server IP and or domain. 

[Image: f489857ee7974370a561d756b131d781.png]

You have made it to the last step! You are now ready to step your account information, please do not use any of the test information I used during this tutorial as it's only there as an example. 

[Image: ecd3dfb9fce14d69a6641932c649ee37.png]

Congrats you are now finished installing MyBB! 
[Image: 73962d8eace748cdadaa90f32deee9b1.png][/spoiler]

This tutorial took a few hours to write up, so I hope it helps at least one person. Feel free to leave some feedback or support questions below. 

Credits:
[spoiler]
MyBB 
Ubuntu 15.10 LAMP server tutorial with Apache 2.4, PHP 5 and MariaDB
PrivateDonut
[/spoiler]
Very nice tutorial here! Defiantly something people would be interested in for sure! :)
(08-05-2016, 09:30 AM)Mulberry Wrote: [ -> ]Very nice tutorial here! Defiantly something people would be interested in for sure! :)

Hopefully it'll help out a few people! I plan to make more in-debt tutorials in the near future.  Happy
Absolutely superb tutorial, very well organised too! 

Great work!
you just don't see well written tutorials that are updated like this anymore. I appreciate the fact that you have took time to put together this. I'm sure it will help out a lot of people especially myself as back before I started Forum Authority I would have definitely found this very useful!
(08-05-2016, 10:51 AM)Sir Twisted Wrote: [ -> ]you just don't see well written tutorials that are updated like this anymore. I appreciate the fact that you have took time to put together this. I'm sure it will help out a lot of people especially myself as back before I started Forum Authority I would have definitely found this very useful!

Thank you! It took me a few hours to write this tutorial out, I tried to make it as user friendly as I could get it.  Cool
If I can make a suggestion, as 12.04 and 14.04 are both still in support, and PHP 5.6 is not yet rolled out to the 12.04 repos; this has to go before your apt-get install apache2: 

Code:
$ add-apt-repository -y ppa:ondrej/apache2
$ add-apt-repository -y ppa:ondrej/php5
$ apt-key update
$ apt-get update && apt-get upgrade -y

Backwards compatability is important!
(08-07-2016, 05:34 AM)Ben Cousins Wrote: [ -> ]If I can make a suggestion, as 12.04 and 14.04 are both still in support, and PHP 5.6 is not yet rolled out to the 12.04 repos; this has to go before your apt-get install apache2: 

Code:
$ add-apt-repository -y ppa:ondrej/apache2
$ add-apt-repository -y ppa:ondrej/php5
$ apt-key update
$ apt-get update && apt-get upgrade -y

Backwards compatability is important!

Thank you for the feedback, I wasn't even thinking about that... I'll update the tutorial when I get back in town in a few days.  Clapping
Pages: 1 2