Install LAMP in Ubuntu 15.10, LAMP stack is the combination of the maximum often used software program packages to construct dynamic websites.
LAMP is an abbreviation that makes use of the primary letter of every of the packages covered in it: Linux, Apache, MariaDB, PHP.
You can use LAMP to construct first rate websites with platforms which includes WordPress or Joomla as an instance.
If you’re PHP developer you could set up LAMP for your laptop and check your code regionally. This doesn’t mean that LAMP can not be used in manufacturing environments as well.
If you are searching out LEMP (Linux, Nginx, MariaDB and PHP) surroundings on your server or computer, you may go through underneath article.
In this tutorial I am going to expose you a way to installation and configure LAMP in Ubuntu 15.10.
The manual assumes which you have already hooked up Ubuntu 15.10. If you have not mounted already, you could talk to our publications right here:
Install LAMP in Ubuntu 15.10, Prerequisites:
- Ubuntu 15.10 Desktop Installation Guide
- Ubuntu 15.10 Server Installation Guide
- Configure Static IP Address and DNS in Ubuntu 15.10
Step 1: Installing Apache Web Server
01. Now that you have the “L” in LAMP it’s time to continue to the “A” – Apache. It may be without difficulty hooked up via walking:
$ sudo apt-get install apache2
When requested to confirm the installation, press “y” observed by way of enter.
02.Once the set up is entire, you may take a look at your installation via going to:
http://your-ip-address.com
To find your IP address, you can use command such as:
$ ifconfig -a
03. Now replica/paste the IP address in your browser. You ought to see the following web page:
04. The default place for website documents (additionally understand as file root) for Apache is:
/var/www/html/
The Apache configuration file is located at:
/etc/apache2/apache2.conf
Step 2: Install LAMP in Ubuntu 15.10, Installing MariaDB Database
MariaDB is a relational database control machine. It is a community fork of the likely higher recognised MySQL database server.
It is supposed to remain unfastened below the GNU/GPL.
This is why it’s far now the favored preference for relational database control system.
Installing it in Ubuntu 15.10 can be finished with:
$ sudo apt-get install mariadb-server mariadb-client
06. When the deploy is complete, you can start and the statu of MariaDB provider with:
$ sudo service mysql start
$ sudo service mysql status
07. If you want to comfy your MariaDB set up you will need to run:
$ sudo mysql_secure_installation
08. You may be requested to go into the modern MariaDB root password. The default password is empty so you can clearly press enter.
After that you can enter the brand new root password (two times):
09. After that you could disable nameless debts for the MySQL carrier. It is strongly propose that such accounts are disabled in manufacturing surroundings.
10. The next step in securing your MariaDB set up is to disable remote get right of entry to on your databases from root user.
This choice must be disabled except you have got a great reason for the use of root.
Instead, you could create privileged customers later:
11. When installing MariaDB it creates a default “test” database, you can correctly put off that when requested to:
Finally to make certain that the modifications are saved, you will ned to reload the privileges:
You are completed securing your your MariaDB configuration.
If you want to adjust the settings of your MariaDB server, you may want to edit the following record as root:
/etc/my.cnf
Step 3: Install LAMP in Ubuntu 15.10, Installing PHP Programming Language
12. The final step in our instructional is finishing the installation of PHP.
It is an programming language used to evolved dynamic web sites.
Larger part of the web sites inside the world huge internet are built the use of this language.
Many content material management systems which includes WordPress and Joomla are written on this language!
Installing PHP on Ubuntu 15.10 can be completed by using going for walks:
$ sudo apt-get install php5 libapache2-mod-php5
13. You will now need to restart Apache so it is able to see the adjustments you simply made and run PHP.
$ sudo service apache2 restart
14. Finally it’s time to test our settings. You can create a take a look at PHP file so as to show us the modern PHP configuration.
For that purpose create a report known as info.Php in:
/var/www/html/
For example you can use:
sudo vi /var/www/html/info.php
Insert the following code in the file:
<?php
phpinfo()
?>
15. Finally save the file by means of pressing Esc and “:wq“.
Install LAMP in Ubuntu 15.10, Now to affirm that your PHP code is nicely finished, open:
http://your-ip-address/info.php
You should see the following page:
If you want to exchange the PHP settings, you ought to edit the subsequent report:
/etc/apache2/php5/php.ini
Remember that whenever you exchange the PHP settings, you will want to restart Apache so the adjustments can take effect. Apache can be restarted with:
$ sudo service apache2 restart
Thats it! You now have all the tools required to construct a dynamic website, study programming or create your own web hosting server.