Introduction
The LAMP stack (Linux, Apache, MySQL, PHP) is a group of open source software that is typically installed together to enable a server to host dynamic PHP websites and web apps.
This guide includes the steps to set up a LAMP stack on Ubuntu 14.04, if you want more information on LAMP click here.
Β
Installing Apache
Step 1: Update apt-get package lists
sudo apt-get update
Step 2. To install Apache write down run the following command.
sudo apt-get install apache2 apache2-utils
When prompted for yes or no β[Y/n]β, press y, and enter.
Step 3. Now run the command, to start Apache
sudo service apache 2 restart
Checking:
Open your favorite Web browser and go to the URL: http://localhost : if you read “It works!”, which is the content of the file /var/www/index.html , this proves Apache works.
Installing MySQL
Step 4. Now to install MySQL, write down the command below and hit enter.
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
Again when asked for β[Y/n]β, you know which one to press, yes, you have to press βyβ for yes.
Step 5. Setup a password for MySQL, and be sure to set something that you wonβt forget.
Retype the password.
Step 6. Now run the command
sudo mysql_install_db
Step 7. And then the command, to secure MySQL installation.
sudo mysql_secure_installation
Note: Now Ubuntu will ask you a bunch of questions, read them carefully and according to your choice press βyβ or βnβ.
Installing PHP5
Step 8. Now we arrive at the Lonely Mountain, PHP5, to install, run the command
sudo apt-get install php5 php5-mysql php-pear php5-gd php5-mcrypt php5-curl
Checking:
To check run the following two commands, consecutively.
- sudo touch /var/www/html/phpinfo.php
- sudo nano /var/www/html/phpinfo.php
Now the file Β phpinfo.php will open up on your terminal.
copy the php command:
<?php phpinfo();?>
and go back to your terminal.
Open up your web browser, and go to : http://localhost/phpinfo.php . or just click here.
1 Comment
HOW TO INSTALL WORDPRESS ON APACHE SERVER, UBUNTU 15.10 – Virtono Community · August 16, 2016 at 1:18 PM
[…] Set up a LAMP stack on Ubuntu 14.04 […]