Installing LAMP on Ubuntu 10.04 and 10.10 (Lucid Lynx, Maverick Meerkat)
Page 1 Page 2
If you're developing websites, it's nice to be able to test your code in the privacy of your own computer rather that out in the public internet. In order to do that, you'll need to install a web server on your development computer. LAMP (Linux, Apache, MySQL, php) is one of the most common web hosting platforms, so it's a perfect environment for you to build and test your website code. If you carefully follow these step by step instructions, you'll have your own Ubuntu LAMP web server on installed, configured, and running in no time.
Install LAMP Web Server on Ubuntu
The Ubuntu developers have made it easy to install and configure the LAMP server packages with a single command. Simply open a terminal window and enter the following.
No, that's not a typo. Please make sure to include the caret (^). The command will not work without it.
The apt package manager will show all the packages that need to be installed. Hit <Enter> to confirm that you want to install them.
You will then be prompted to change the password for the root user on the MySQL database.
Enter the password you want. You'll be prompted to enter it a second time to confirm.
After you confirm your password, apt will continue to install the rest of the packages.
Congratulations, your LAMP installation is now complete! That was the easy part, now you need to get a few things configured to make your system easy to work with.
Test Apache
Open a web browser and enter the address http://localhost/. You should see a web page that says "It Works!"
Test php
Now that you know Apache works, you'll want to test the php installation. You'll need to create a file in /var/www called testing.php. Open a terminal and enter:
Enter the following line into the text editor, save the file and exit.
Next, restart Apache with the following terminal command:
Now go back to your web browser and enter the address http://localhost/testing.php/. You should see a page displaying version information for your php installation.
Configure MySQL
Since I'm installing LAMP for a web development environment, I want the MySQL database to be bound to the localhost IP address. This should be 127.0.0.1 for your system. You can verify it with this terminal command.
You'll now want to verify that the correct bind address is set up in MySQL's my.cnf file.
You should see a line that looks like this:
bind-address = 127.0.0.1
If the IP address doesn't match the one for your system, you'll need to edit the my.cnf file to correct it.
Page 1 Page 2








Hi,
While installing i am getting below error on ubuntu 10.04:
The following packages have unmet dependencies:
mysql-client-5.1: Conflicts: mysql-client-5.0 but 5.0.51a-3ubuntu5 is to be installed
mysql-client-core-5.1: Conflicts: mysql-client-5.0 but 5.0.51a-3ubuntu5 is to be installed
mysql-server-5.1: Conflicts: mysql-server-5.0 but 5.0.51a-3ubuntu5 is to be installed
mysql-server-core-5.1: Conflicts: mysql-server-5.0 but 5.0.51a-3ubuntu5 is to be installed
E: Broken packages
I got the same issue too ...
it works after i updated the Ubuntu
sudo apt-get update
The installation worked smoothly as exactly as shown. I installed on Ubuntu 11.10 Oneric
when i was installing LAMP server on Ubuntu 10.04 server i got following error
root@HM01AP01:~# apt-get install lamp-server^
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
please solve this issue...!
I've seen this error when there's another package manager running. Was Synaptic or the Update Manager running at the time of the error?
You must install as root, like so:
sudo apt-get install lamp-server^
...at which point you'll be prompted to enter your administrator password. Enter it, then press the return key. Should work fine.
Installation worked smoothly, thanks.
Installation worked very Smoothly Thanks...
Great tutorial.. works all through..
Very good guide. No problem during installation. Thanks a lot!
Hi, I was trying your installation method and ran into the following...
~# sudo apt-get install lamp-server^
sudo: unable to resolve host Zen420
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapr1 is already the newest version.
php5-common is already the newest version.
libapr1 is already the newest version.
php5-common is already the newest version.
The following extra packages will be installed:
apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
libapache2-mod-php5 libaprutil1-dbd-sqlite3 libaprutil1-ldap
libmysqlclient16 mysql-common php5-mysql
Suggested packages:
apache2-doc apache2-suexec apache2-suexec-custom php-pear
The following NEW packages will be installed:
apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
libapache2-mod-php5 libaprutil1-dbd-sqlite3 libaprutil1-ldap
libmysqlclient16 mysql-common php5-mysql
0 upgraded, 11 newly installed, 0 to remove and 5 not upgraded.
Need to get 0B/8,071kB of archives.
After this operation, 22.0MB of additional disk space will be used.
Do you want to continue [Y/n]?
I never had any prompts about setting up mySQL password... Didnt try past that because if this fails, I cannot move forward with the project that im working on. I am running Backtrack 5 which i believe is based off Ubuntu. Is this the reason why I am failing the install. I am updated as of 2 mins ago.. Any help would be greatly appreciated...
Thanks,
Zen420
*Solved.. I just re-installed MySQL...
I cannot get http://localhost/phpmyadmin/ to work it says not found. I am not sure what I am doing wrong I have tried this 3 times. everything else seems to work.
See my latest version of this procedure: http://tuxtweaks.com/2011/10/install-lamp-and-phpmyadmin-on-ubuntu-11-10/
Scroll down to the section on Fixing phpMyAdmin and that should fix you up.
Thanx a million Linerd its real a timeserver, it has worked for me more than once.
That works like a pro.
Thanks.
I keep this page for my personal reference on http://www.webnapps.co.uk/helpful-links
I hope this will be OK with you.
Cheers.
I have run into an issue during the installation of phpmyadmin.
An error occurred while installing the database:mysql said: ERROR 13 (HY000) at line 1: Can't get stat of './phpmyadmin'
(Errcode: 13)
I researched it and found some information that it has something to do with AppArmor, but the ill-advised (security reasons) fix didn't work for me.
how much time will it take to load?? because im aint getting the local host process the last line i see in ubuntu 10.04 is
""ldconfid deffered processing now taking place
avi@ubuntu:~$""
can u help me out plss bro its a project
now it says
"apache2:Could not reliably determine the server's fully qualified domain name"
Take a look at the bottom of this post: http://tuxtweaks.com/2009/07/how-to-configure-apache-linux/
in the last step of urs
what username should i use???
my ubuntu name was avinash and password was same for all i mean for mysql as well as
for the ubuntu start now it says "" #1045 cannot log into mysql server"" please help
Do you mean when you're logging into phpMyAdmin? The user name should be root for that.
Hi,
Thanks very much for the walk through. Worked like a dream except for one step:
When testing PHP, I can't save the file testing.php to the www folder. When I try and save I get the error message: "You do not have the permission necessary to save the file"
And when I enter sudo nano /var/www/testing.php into the terminal, I get the message: "command not found".
please help
If you're familiar with the vi editor, you could try using that instead of nano.
or if you have the GNOME desktop you can use
and then save the file as /var/www/testing.php
Hi,
Thanks for your help. Stumbled accross the solution here:
http://ubuntuforums.org/showthread.php?t=1464600
that what happen if you not save the file. press Ctrl-O to write (save) it.
and evidently I also need to get the hang of html tags...
i have installed LAMP server successfully and every single stage of the process
going well but when it comes to matter of testing , it keeps telling the following categorically message
The requested URL /phpmyadmin was not found on this server.
Apache/2.2.17 (Ubuntu) Server at localhost Port 80
Danny - Check out http://tuxtweaks.com/2011/10/install-lamp-and-phpmyadmin-on-ubuntu-11-10/ and scroll down to the section on Fixing phpMyAdmin
Hi. Thank you so much. It worked for me. all configured and tested with a single command line.