1. Launch Terminal
First open up Applications->Accessories->Terminal.
2. Install Apache
Type the following line of command:
sudo apt-get install apache2
3.Install PHP5
Execute the following command by typing the following line in the Terminal and hit enter:
sudo apt-get install php5 libapache2-mod-php5
4. To Stop/Restart Apache
Execute the following command in the Terminal:
Stop/Restart Apache
5.Install MySQL Server
In this article, I will share my experience install and configure LAMP on Ubuntu Linux.
1. Launch Terminal
First open up Applications->Accessories->Terminal.
2. Install Apache
Type the following line of command:
sudo apt-get install apache2
3.Install PHP5
Execute the following command by typing the following line in the Terminal and hit enter:
sudo apt-get install php5 libapache2-mod-php5
4. To Stop/Restart Apache
Execute the following command in the Terminal:
Stop/Restart Apache
5.Install MySQL Server
sudo apt-get install mysql-server
6.Set mysql root password
You’ll need to set a password for local computer gets root access.
a. First type the follwing line and hit enter to avoid being prompted for password:
sudo su
b. now you must kill the running mysql server. The process id is grabbed from /var/run/mysqld/ and inserted into the kill statement. Note there are ticks (`) around the process id, not single quotes (’).
kill `cat /var/run/mysqld/mysqld.pid`
c. Now you need to run a command to cause the server not to use the privilege system at all, which gives anyone with access to the server unrestricted access to all databases.
mysqld –skip-grant-tables & mysql -u root
d. Set the password:
UPDATE mysql.user SET Password=PASSWORD (’newpassword’) WHERE User = ‘root’;
e. execute the following commands one by one to finish the password setup.
exit
kill `cat /var/run/mysqld/mysqld.pid`
mysqld &
mysql -u root -p
7.Install MySQL Administrator
sudo apt-get install mysql-admin
8. Refresh Gnome Panel
killall gnome-panel
9. Install MySQL for Apache HTTP Server
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
10. To get PHP to work with MySQL, open the php.ini file
gksudo gedit /etc/php5/apache2/php.ini
11. Add the following line somewhere in the opened up file:
extension=mysql.so
12. Restart Apache
sudo /etc/init.d/apache2 restart
Finish ! You Are Done !