How to Install Lamp(Apache, MySql DB, PhpMyAdmin) in Ubuntu 14.04/14.10 Server or Desktop - Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee

Thursday, August 7, 2014

How to Install Lamp(Apache, MySql DB, PhpMyAdmin) in Ubuntu 14.04/14.10 Server or Desktop


Hello Everyone,

In this tutorial,

Let us Install LAMP(Apache, MySQL DB, PhpMyAdmin) on Ubuntu Server & Desktop 12.04/14.04/14.10 -- 64 Bit.

You Can also Install in Linux Mint 17 or Debian 7.

                            Installation Apache
I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as ROOT:                
Step1:- sudo su

Update ubuntu repositories by giving the below command

Step2:- sudo apt-get update & sudo apt-get upgrade -y

Step3:- sudo apt-get install apache2

Step4:- Testing Apache:-

                           Installation MySQL
Step5:- sudo apt-get install mysql-server mysql-client
                                              or
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

You can verify the MySQL server status using command:
Step6:- sudo service mysql status

Sample output:
mysql start/running, process 3470
                
                          Installation PHP
Step11:- sudo apt-get install php5 php5-mysql libapache2-mod-php5

Test PHP
Create a sample “testphp.php” file in Apache document root folder.

Step12:- sudo nano /var/www/html/testphp.php
Add the following lines.
&lt?php
phpinfo;
?&gt

Restart apache2 service:
Step13:- sudo service apache2 restart    or   /etc/init.d/apache2 restart

Testing testphp
e.g. localhost:testphp or http://192.168.0.100/testphp.php

If you want to install all php modules enter the command
Step14:- sudo apt-get install php* and restart the apache2 service.

To verify the modules, open web browser and navigate to
 You will able to see all installed php modules.

                         Installation phpMyAdmin
Step15:- sudo apt-get install phpmyadmin

Web server to reconfigure automatically: -- apache2
Configure database for phpmyadmin with dbconfig-common? -- yes
Enter MySQL application password phpmyadmin   --- 123456

Step16:- Afterwards, you can access phpMyAdmin under:- http://192.168.0.100/phpmyadmin/

                             Installation MariaDB --- Optional
First you have to remove existing MySQL packages if any.
To completely uninstall MySQL along with its configuration files,
enter the following command:
Step7:- sudo apt-get purge mysql*

Run the following command to remove unwanted packages.
Step8:- sudo apt-get autoremove

Now, add MariaDB repository. Run the following commands to add PPA. Hence, MariaDB 5.5 repository is not yet updated to 14.04, we can use the repository of Ubuntu 13.10 instead.
Step8:- sudo apt-get install software-properties-common
          
 sudo apt-key adv --recv-keys-keyserverhkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
       
sudo add-apt-repository 'deb http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/5.5/ubuntu saucy main'

Update the software sources list and install MariaDB using following commands:
Step9:- sudo apt-get update
           sudo apt-get install mariadb-server mariadb-client

Check if mariadb is running or not, using the following command:
Step10:-  sudo service mysql status

Sample output:
 * /usr/bin/mysqladmin  Ver 9.0 Distrib 5.5.37-MariaDB, for debian-linux-gnu on i686

To set or Reset MySql Root Password in Ubuntu 14.04 LTS
Once you have installed MySQL, we should activate it with this command:
Step2 :-  sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
The prompt will ask you for your current root password
root password. Go ahead and choose N and move on to the next steps
Remove anonymous users?  y 
Disallow root login remotely?  y
Remove test database and access to it?  y
Reload privilege tables now?  Y

NOTE :- For Any Clarification Please Below

Comment,
Like and
Share  us  and  help us to spread.

####--------------------------------------------------------------------------------------####
Website    :-   http://www.cloudnetwork.in
Twitter     :-   http://twitter.com/itcloudnet
Skype Id  :-   cloud.network1
E-Mail Id :-   itcloudnet@gmail.com
####----------------------------------------------------------------------------------------####                         
Thanking You
Hope U Like it........