• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to setup LAMP stack on Ubuntu 14.04 LTS Server

May 11, 2014 by Sharad Chhetri Leave a Comment

In this tutorial we will learn, how to setup LAMP Stack on Ubuntu 14.04 LTS Server. LAMP is the abbreviation of Linux, Apache, MySQL and PHP. To setup LAMP stack, we will install Apache HTTP Server, PHP and MySQL Database Server on Linux . In our case, for Linux we will use Ubuntu 14.04 LTS Server.

In internet world, LAMP stack is popularly used for Web Application. Many Open source CMS (Content Management System) like WordPress, Joomla, Drupal, MODX etc .

Install Apache, PHP and MySQL on Ubuntu 14.04 LTS

Follow the given below steps to setup the LAMP stack.

(1) Install Apache HTTP Server :

In Ubuntu 14.04 LTS, the apache 2.4 version has been introduced.Whereas in Ubuntu 12.04,it was shipped with Apache 2.2 version.In new Apache version 2.4 a few things are changed.
In our last post, we have already brief about installing Apache on Ubuntu 14.04

To install Apache Web Server,use given below command

sudo apt-get update apache2

(2) Install MySQL Database Server

MySQL is an Open Source RDBMS . In my last post we have already install mysql server on Ubuntu 14.04.

Here we will install MySQL Server version 5.6 . Which is currently a new stable release.

To install MySQL Server, run below given command

sudo apt-get install mysql-server-5.6

During installation, after a few seconds it will ask you to set mysql root password.
On your terminal, you will see the screen like below given screenshot

Set MySQLroot Password
mysql Ubuntu 14.04

Confirm the MySQL root password

MySQL Server 5.6 Ubuntu 14.04

(3) Install PHP :

In recent time, PHP is well known for server side scripting,widely use in Web Development.at the time of writing, currently PHP 5.x series is running

To get connection from PHP script to MySQL Server, we have to install the module called php5-mysql

Here we will install php and php5-mysql

sudo apt-get install php5 php5-mysql

Note: In apache 2.4 version in Ubuntu 14.04 , the default Document Directory is /var/www/html

Now create a file called test.php inside /var/www/html directory .

sudo vi /var/www/html/test.php

Now paste given below phpinfo code in test.php file . And save the file.


Open the web browser in your PC/Laptop and type IP address in URL address bar with test.php file name .
My Server ip is 192.168.56.101 hence I will write http://192.168.56.101/test.php .

Replace 192.168.56.101 with your Server IP Address.

phpinfo

Through phpinfo php script, you can get many useful information.
First, it confirms the PHP is installed in Server and can work with apache web server. Second, you can also know what are the PHP extension are enable or disable. And there are may other useful information you can get in phpinfo page.

Now Apache, PHP and MySQL server are installed. You can start working on LAMP stack.

To start/stop/restart the apache service

sudo service apache start
sudo service apache2 stop
sudo service apache2 restart

Apache status

sudo service apache2 status

To start/stop/restart the MySQL service

Start MySQL:

sudo service mysql start

Stop MySQL:

sudo service mysql stop

Restart MySQL

sudo service mysql restart

MySQL status

sudo service mysql status

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. How to install wordpress on LAMP stack ( Ubuntu 14.04 LTS Server )
  2. Setup self signed ssl certificate on Owncloud 6 in Ubuntu 14.04 LTS Server
  3. How to install Apache Web Server on Ubuntu 14.04 LTS (Trusty Tahr)
  4. How to install Owncloud 6 on Ubuntu 14.04 LTS Server
  5. How to install Jenkins on Ubuntu 18.04 LTS server
  6. Upgrade Ubuntu 14.04 LTS to Ubuntu 14.04.3 LTS
  7. System settings not opening on Ubuntu 16.04 LTS
  8. Install Openssh server on Ubuntu Desktop / Server
  9. Setup varnish cache server for wordpress site
  10. Install MongoDB server on Ubuntu 12.04 LTS

Filed Under: Linux, Ubuntu Tagged With: ubuntu

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

Agent admitted failure to sign using the key ssh

Show visitor ip address php code

How to reset forgot root password in CentOS 6.x and Redhat 6.x

How to protect from port scanning and smurf attack in Linux Server by iptables

find command to search keyword in files recursively in linux

Do not show line haveing particular keyword by grep command

linux release renew dhcp assigned ip address

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy