If you are having some difficulty in installing Apache, MariaDB or PHP on Ubuntu 15.04 server, then you have come to the right place. I will give you a full guide on how to install these on your Ubuntu 15.04 system.
Apache, MariaDB and PHP are installed to create a LAMP server, which is then used to host your websites. LAMP stands for Linux, Apache, MySql Server, PHP. But we will be using MariaDB instead of MySql because it is much more faster. So now that you have a general idea of what they are used for, we will indulge right into installing them on your Ubuntu system. I will give you very easy guides and in very easy language, so that you can completely understand what I want to tell you to do.
Following stuff will be required for Ubuntu server setup :
Apache is a web server which is freely available. It is distributed under the license of “Open Source” software. You need the version 2.0 of the Apache web server because it runs on most of the operating systems which are UNIX-based such as Linux, AIX, UNIX, and Solaris, on other UNIX/POSIX-derived systems such as BeOS, Rhapsody, and OSD/BS2000, on Windows 2000 and on AmigaOS. Now the instructions for install Apache on Ubuntu are as follows:
STEP 1: the first thing is that you have to get a fresh Ubuntu 15.04 server. Now the next thing is that you have to login as root into your server. I have used a droplet from DO, so if you are also using a droplet from DO, then you will be asked to change the default password of root.
Step 2: Next thing is that you have to make sure that that all the packages of Ubuntu are updated. This operation can be performed by using the following command:
apt-get update –y apt-get upgrade –y
Now you will see the screens like these following screens:
Step 3: Now the main command to install Apache 2 webserver on Ubuntu 15.04 is as follows:
apt-get install apache2 –y
now you will see a screen similar to this:
And after this step, Apache has been installed on your Ubuntu system.
PHP is basically a computer programming language. PHP stands for Hypertext Preprocessor. PHP was designed to produce the dynamic webpages. The guidelines for installing PHP5 on your Ubuntu system are as follows:
Step 1: in the first step, we have to install PHP5 and MySQL PHP modules. We can install them by entering these commands:
apt-get install php5 php5-mysql –y
Now you will have the following screen in front of you:
Step 2: You also have to install other modules of PHP5 that your script or the app may need. However, there are many modules available out there, but your script or app may need only the specific ones. And you can also install the most common modules that many apps usually need. To install them, you can use the following command below:
apt-get install php5-cgi php5-cli php5-common php5-curl php5-dev php5-gd php5-tidy php5-xmlrpc php5-xsl php5-mcrypt php5-imap php5-imagick php5-json php5-intl php5-mcrypt libapache2-mod-php5 –y
After this, you should be able to see a screen similar to this:
Step 3: And this is it, you have now successfully installed PHP on your Ubuntu system. Now if you want to check the version of the PHP which is installed on your Ubuntu system, you can use the following command, it works like a magic:
I am going to give you my example now:
MariaDB Server is MySQL Server’s community developed fork. MariaDB server was started by the core members of the original MySQL Server team. MariaDB Server is a relational database management system. MariaDB server has been intended to stay free under the GNU General Public License. The compatibility of MariaDB server is cross platform, which means that it can support all operating systems like windows, linux, unix, OS X, solaris or BSD. So now that you have a general idea about MariaDB server, you can follow the guide below to installing it on your Ubuntu system.
Step 1: You can install MariaDB server by using a simple command. That command is as follows:
apt-get install mariadb-server –y
Now you should see a screen similar to this below:
Step 2: Now as soon as the process of installation is finished, then the first thing that you have to do is to setup your MariaDB server with a new root password. The default password is blank. Now you have to issue the following command:
After entering this command, you simply have to press enter on your keyboard if you are asked with current password, and then you will have to give answers to the next questions so. Then create a new password, you must not forget that, and after creating it, you have to remember it because it will be the password for your database for the user root.
Now you should see the screens in front of you like these shown below:
Step 3: Now the next thing that you should consider doing is that now you should login to the MariaDB server so that you can test your newly created root password. To do this, you have to enter the following command below:
mysql -u root –p
Now you will have to enter your MySQL root password. Now you should have the screen similar to the one shown below:
Now as you can clearly see in the picture above, I am running MariaDB version 10.0.17, and it is equal to MySQL 5.6 and 5.7.
And lastly, the thing that you have to remember is that you have to restart the Apache 2 web server, you should not forget that. You can do this operation by using the following command:
service apache2 restart
Apache 2, PHP5 and MariaDB webserver has now been installed onto your Ubuntu system successfully. And now you can start hosting your websites and blogs on it.