Professional Documents
Culture Documents
Lamp Ubuntu
Lamp Ubuntu
Search
Navigation
[+] Expand [-] Collapse
Howtos
Linux
Android
CentOS
Debian
Fedora
Kernel
Mandriva
PCLinuxOS
SuSE
Ubuntu
Web Server
Apache
Cherokee
Lighttpd
nginx
Backup
Control Panels
ISPConfig
DNS
BIND
MyDNS
PowerDNS
djbdns
Desktop
Email
Anti-Spam/Virus
Postfix
FTP
High-Availability
Monitoring
MySQL
Programming
C/C++
PHP
Samba
Security
Anti-Spam/Virus
Storage
1 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Virtualization 30day-trial
KVM
OpenVZ
VMware
VirtualBox
Xen
Other
FreeBSD
Commercial
Mini-Howtos
Forums
Contribute
Subscription
Login
Site Map/RSS Feeds
User login
Username:
Password:
Remember Me?
Log in
Find us on
Facebook
HowtoForge
Like
Who's online
There are currently 10
users and 2400 guests
online.
HowtoForge
Forums
How do you create
a boot up cd with
2 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Linux?
Email not function
on Centos5.6 x64
SquirrelMail
login error
Opensource NAS/San
deployment
Install Bind after
ISPConfig3
Centos, Fedora,
Debian or Mandriva
.htaccess +
mod_rewrite
automatic domain
expiry reminder to
clients
Mail Warn Log
ISPConfig 3 dns
doesn't work..
News
7 of the Best Free Linux
GPS Tools
Tweeting From The Linux
Desktop With Turpial
Tweeting From The Linux
Desktop With Turpial
This week at LWN: Mark
Shuttleworth on companies
and free software
Linux Mint 11 ships with
retro GNOME 2.32 UI
Attachmate CEO: We’re
Absolutely Committed to
SUSE Linux
64-bit OS written entirely in
assembly
As netbook sales fall, Intel
will slash Atom pricing
As netbook sales fall, Intel
will slash Atom pricing
KDE Commit Digest for 22
May 2011
more
Recent comments
Re: from where can i
download
13 hours 12 min ago
Good chance to get data
off partitions with errors
13 hours 21 min ago
3 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Newsletter
Subscribe to
HowtoForge
Newsletter
and stay informed about
our latest HOWTOs and
projects.
enter email address
Submit
You are here: Home » Howtos » Linux » Ubuntu » Installing LAMP On Ubuntu For Newbies
4 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Like 80
Installing LAMP On Ubuntu
For Newbies
In this guide I will show you how to install a LAMP system. LAMP stands for
Linux, Apache, MySQL, PHP. The guide is intended to help those who have
very little knowlegde of using Linux.
Install Apache
To start off we will install Apache.
2. Copy/Paste the following line of code into Terminal and then press enter:
3. The Terminal will then ask you for you're password, type it and then press enter.
Testing Apache
To make sure everything installed correctly we will now test Apache to ensure it is working properly.
1. Open up any web browser and then enter the following into the web address:
http://localhost/
You should see a folder entitled apache2-default/. Open it and you will see a message saying "It works!" , congrats to you!
Install PHP
In this part we will install PHP 5.
Step 1. Again open up the Terminal (Applications > Accessories > Terminal).
Step 2. Copy/Paste the following line into Terminal and press enter:
Step 3. In order for PHP to work and be compatible with Apache we must restart it. Type the following code in Terminal to do this:
Test PHP
To ensure there are no issues with PHP let's give it a quick test run.
5 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Step 4. Now open you're web browser and type the following into the web address:
http://localhost/testphp.php
Install MySQL
To finish this guide up we will install MySQL. (Note - Out of Apache and PHP, MySQL is the most difficult to set up. I will provide
some great resources for anyone having trouble at the end of this guide.)
Step 1. Once again open up the amazing Terminal and then copy/paste this line:
Step 2 (optional). In order for other computers on your network to view the server you have created, you must first edit the
"Bind Address". Begin by opening up Terminal to edit the my.cnf file.
bind-address = 127.0.0.1
6 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Step 3. This is where things may start to get tricky. Begin by typing the following into Terminal:
mysql -u root
Step 4. We are now going to install a program called phpMyAdmin which is an easy tool to edit your databases. Copy/paste the
following line into Terminal:
After that is installed our next task is to get PHP to work with MySQL. To do this we will need to open a file entitled php.ini
open it type the following:
Now we are going to have to uncomment the following line by taking out the semicolon (;).
;extension=mysql.so
extension=mysql.so
The End
Quick note to anyone who encountered problems with setting up the MySQL password, please refer to this page:
MysqlPasswordReset
I applaud everyone who has taken the time to read this guide. This guide is also my first ever so I would love to hear back from
the public on what you guys think! Just don't be too harsh. ;)
If you have questions about installing any part of LAMP just drop them in the comment box and I will do my best to help you out.
7 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Related Tutorials
The Perfect Setup - Ubuntu Feisty Fawn (Ubuntu 7.04)
How To Set Up An Ubuntu/Debian LAMP Server
Ubuntu LAMP Server With Torrentflux In VMware
LAMP Installation On Ubuntu 6.06 For Linux Noobs
Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
this guide
Submitted by jonathan young (not registered) on Thu, 2011-05-26 01:20.
just wanted to say this is one of the best, most concise and easy to follow guides for doing something incredibly complex, kudos to you folks!
thank you!!!
reply |
One word
Submitted by kuberprok (not registered) on Wed, 2011-05-18 20:02.
Brilliant!
reply |
Thanks
reply |
8 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
easy LAMP
Submitted by tiwigi (not registered) on Sat, 2011-05-07 17:18.
thank you, it was totally no pain ;) (in ubuntu 11.04 no need for last steps with mysql extension ... anyway works like a charm)
reply |
Great job!
Submitted by Goga (not registered) on Sat, 2011-04-30 21:43.
Great job! Very easy to follow, and straight to the point! Thanks!
reply |
wat a site
Submitted by dexter (not registered) on Sun, 2011-04-10 15:39.
superb!!!!
thnx a lot
reply |
Lamp installation
Submitted by Ges Scott (not registered) on Tue, 2011-04-05 19:12.
Excellent! Thank you so much. You're tutorial is straightforward and so easy to follow. After quite a number of years using WAMP on windows I
migrated to Linux using Ubuntu. I was very concerned about using/configuring my development environment. I had searched around for a
way to use LAMP. I found you! Everything was/is up and running within half hour just by pasting your commands.
Once again thank you very much. More tutorials like this from you please!
Ges Scott
reply |
Thanks a bunch
Submitted by Arun Prasad (not registered) on Thu, 2011-03-31 19:55.
It was very helpful. Thanks a lot for this wonderful information. You made my day. :)
reply |
Awesome Guide
Submitted by Shammancer (not registered) on Thu, 2011-03-31 05:18.
9 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
This guide is right at the point and tells you exactly what you need to do. Keep up the good work.
reply |
Excellent!
Submitted by Anonymous (not registered) on Fri, 2011-03-25 18:38.
This guide was invaluable, my mother in law sponsors a student where I live, and the student needs a machine as she can't afford one*. I
have resurrected a 7 year old laptop with XUbuntu into a reasonably decent dev environment, so your altruism has helped people helping
others, good karma :-).
Went as smoothly as ice, I'm a .net dev by day and I love Linux, but my job keeps me pretty tied to MS operating systems. I only use Linux
under VMs to keep my hand in. When my wife buys herself a new lappie, I have plans for the old one :evil grin:
reply |
Thanks
reply |
Thanks!
Submitted by bcow (not registered) on Mon, 2011-03-21 20:24.
Excellent guide! Thank you for taking the time to make it!
reply |
recently i switched over to linux mint 10 julia and am facing lot of problem with LAMP INSTALLATION.thati followed up the instructions given
in the link http://www.howtoforge.com/ubuntu_lamp_for_newbies
and followed each step as mentioned but i skipped the following section
-----------------------------------------Step 2 (optional). In order for other computers on your network to view the server you have created, you must
first edit the "Bind Address". Begin by opening up Terminal to edit the my.cnf file.
bind-address = 127.0.0.1
10 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
MOREOVER
DIALOGUE BOX ASKED ME IF I WANTED TO SET UP A DATABASE NAMED some conf.....(i don't remember clearly)
which i said no to;;as i d installed my sql earlier itself;;
COMMAND-mysql -u root
ERROR-ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
its showing
----Not Found
mysql -u root -p
after that you have to type your password, that is already exist if you add one before.
reply |
11 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
To set up under Apache all you need to do is include the following line in /etc/apache2/apache2.conf, first type the following command to
open up this file:
gksudo gedit /etc/apache2/apache2.conf
Add the following line of code inside apache2.conf:
Include /etc/phpmyadmin/apache.conf
reply |
Man, 10x for your post... I had the same problem but now the problem is solved and everything looks fine :)
Regards,
George
reply |
EXCELLENT!
Submitted by Jorge Biquez (not registered) on Sat, 2011-03-19 02:23.
Thanks!
Submitted by Anonymous (not registered) on Fri, 2011-03-18 16:35.
reply |
AWESOME WORK
Submitted by Willy (not registered) on Thu, 2011-03-10 05:42.
This is an awesome guide; good work, I would like know about security and maybe how to link my data base with freeradius, and to a login
portal page to authenticate wi-fi users.. would you happen to have a guide that you would like to share...
reply |
12 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
I am looking for a guide how to install a LAMP.. I spend how many hours just to look for the right site...that's why I'm very thankful that I've
found this one!.. thank you... may our GOD blesses you in all aspects of your light.... GBU..
reply |
thank you thank you thank you, what has taken me hours just took minutes you should be a tech writer way better than UBUNTU docs
atp
reply |
Thank you SO much... I'm a new user....and had some issues figuring this out...... gone through many forums and none helped.... until I got to
yours!
reply |
question
Submitted by Kristofer (not registered) on Mon, 2011-02-14 15:11.
Where I'm supposed to remove the semicolon.. Can't seem to find that special line ;extension=mysql.so ....
Thanks in advance!
reply |
I am Joe from China, Beijing.Thanks for your guide! its great!!! I am new to LAMP. I wish to know you. You can be my teacher.
reply |
13 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Wonderful instructions. Followed them with no difficulties whatsoever. One question: The date on this is 2007. Does it retrieve all the latest
versions, or do I have to worry about that now?
reply |
reply |
Very good
Submitted by Anonymous (not registered) on Sat, 2011-01-22 19:12.
superbly easy setup instructions. Worked exactly the way you say.
Thanks a bunch!
reply |
14 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Thanks a lot!
reply |
I did this, which got rid of the 404 for http://localhost/phpmyadmin but I now have a 403 Forbidden in it's place. Any ideas?
reply |
Good job.
Submitted by Shredder (not registered) on Tue, 2011-01-11 15:28.
Good job.
reply |
additional note
Submitted by Caz_blue (not registered) on Tue, 2011-01-11 13:40.
Thanks for the brilliant tutorial, I would not have gotten this installed without it.
just a small note, step 3 was not needed in the version of Ubuntu I'm using ( I think it's maverick meerkat?) there was a prompt to get
through step three that popped up at the end of step two.
--------------------------------------
After all steps where done (successfully) the landing page was throwing an error, this was needed to fix it.
15 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Include /etc/phpmyadmin/apache.conf
---------------------------
http://www.blog.highub.com/linux/install-and-configure-phpmyadmin-on-ubuntu-lamp/
thanks again, would not be looking at some cool databases without you!
reply |
Thanks a lot !!
I am new with LAMP server and It is the shortest and easiest way to install and configure LAMP.
Thanks
Gulshan
reply |
i tried to follow every step but seems to be prob somewhere.. while installing apache installation of 'start' command failed don know y n so
wen i m trying to configure it with sql and php i need to restart apache its not starting but giving ab error msg.. pls somebody help here is the
error msg * Restarting web server apache2 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets
available, shutting down Unable to open logs Action 'start' failed. The Apache error log may have more information.
reply |
The tutorial is just perfect for the needs and is too simple for understanding.
Thanks alot.
reply |
Installing Lamp
16 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
New to Ubuntu and after trying other ways to load php/apache just gave up. Your tutorial took 2 minutes and everything is up and running,
bless you, well done.
George
reply |
Hi,
Great how-to!
Sincerely,
Jason
reply |
not working
Submitted by Anonymous (not registered) on Wed, 2010-12-22 17:36.
http://localhost/testphp.php
when i type it in my browser i dont get the page which you said. Can you please help me.
reply |
excellent guide.
Thank you.
reply |
Good article
Submitted by Axel van Moorsel (not registered) on Sat, 2010-12-18 13:46.
After 3 years it still can be used. I miss only 2 little things which would make it complete for the real newbies.
17 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
You, in a single tutorial, have enabled me to finally make the transition overnight. Going to a real server platform has always been an
overwhelming nemesis that I have deferred due to my lack of know-how and intelligence. I am now migrating as we speak to Ubuntu.
I thank you
I thank you
I thank you!
-John
reply |
Great Tutorial
Submitted by rudy (not registered) on Wed, 2010-12-01 05:22.
2 :thumbsup:
reply |
Good Article
Submitted by Orijit (not registered) on Tue, 2010-11-30 13:09.
Hi:
I installed ubuntu one today as a plan to shift from windows to a linux system for my development purpose and was looking to setup AMP on
it.
I can safely tell you that the article is neat. Serves its purpose. Easy to understand. keep up the good work and keep me posted.
Orijit
reply |
Lamp Tutorial
Submitted by Alan (not registered) on Wed, 2010-11-24 22:38.
Fantastic guide, really well written, informative and useful. Bookmarked for future builds :D
reply |
Great Article
Submitted by rafatmb (registered user) on Wed, 2010-11-24 19:47.
Thanks a lot.
Rafael Marangoni
reply |
18 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Thanks a lot.
After been wasting a lot of my time on windows platforms I've migrated on Ubuntu, especially for production environments.
reply |
Great Tutorial!
Submitted by Alvaro (not registered) on Fri, 2010-11-19 03:03.
Awesome tutorial
Submitted by Sean (not registered) on Mon, 2010-11-15 01:03.
Seriously...awesome tutorial, thank you very much! I am a complete Linux newbie and I am now up and running with LAMP.
reply |
This is a really well written tutorial I would like to see it go just a little bit farther and explain how to get a page set up that says something
more than "it works".
reply |
The tutorial is excellent. I would like to install PHP5 with FTP and Socket. Pl tell me the command to do this. Thanks in advance.
reply |
This is an excellent working guide. I installed on an Ubuntu 10. This is what users look for. Congratulations and thank you.
reply |
19 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Thanks a lot! It works perfectly! I tried to make it work on Windows for forever but it never worked, now on Linux with your tutorial I tried it
for the first time and it instantly worked! Thank you!
reply |
congratulations! ;-)
Submitted by Anonymous (not registered) on Thu, 2010-10-28 14:50.
just btw: if u install the latest mysql you can set the password at installation
reply |
this is an excellent tutorial i found it very easy. Just remember to use mysql -u root -p if u have used a password for sql root. thanks
reply |
Lamp Server
Submitted by Web design for ... (not registered) on Sat, 2010-10-23 17:24.
This is an excellent tutorial. I totally messed up my Ubuntu 9.04 installation by getting it all wrong and I can see where I went wrong now. I
now have a fresh clean install of 10.04 and the correct way of installing LAMP. Fantastic...thank you.
Andy
reply |
This is an amazingly
Submitted by Anonymous (not registered) on Thu, 2010-10-21 18:50.
This is an amazingly accurate step by step tutorial. It was very clear and accurate!! I just follow the instructions here and everything worked
fine (apache and php). During the install, I was prompted with few additional y/n prompts and different prompts for passwords not
mentioned in the tutorial. But I am very familiar with WAMP (Windows rather than Linux) setup, so slight differences didn't throw me off
though.
I am a bit confused about the reference to "extension=msql.so" though. My php.ini file contains that, but one of the comments says it
should be "...mysql.so". ???
reply |
I tried a few other help me pages for LAMP. I ended up blowing up my system twice and trying again. Then I found your document and it
worked like a breeze.
20 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
The "extension=msql.so" really needing to be "extension=mysql.so" should be added but luckily a fellow poster had it covered.
reply |
Installations are perfect . Php runs with apache2 web server but Mysql is constantly giving access denied .How to get Mysqlworking as a
database and php is also unable to connect to database .
reply |
TY
Submitted by B-rad (not registered) on Sat, 2010-10-16 22:17.
Wow finally somebody that knows what they are doing but is clear and concise. I literally have visited like 10-20 other sites trying to get this
working and they all have gotten me confused or haven't been thorough and complete.
Thanks!
Keep it up.
reply |
Thanks for taking the time to write this tutorial. I just installed Ubuntu 10.04 -- my first new Linux since Slackware. I found a few of the
details were slightly different from your post, but it got the job done painlessly.
reply |
It works, thanks!
Submitted by Juraj (not registered) on Thu, 2010-09-30 16:56.
It works, thanks!
reply |
21 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Thanks. followed the guide to step 3 w/o any problems, but at step 3 I get the following message in the terminal: ERROR 1045 (28000):
Access denied for user 'root'@'localhost' (using password: NO)
reply |
I got the same, but realized it was because I already set up the root user and password on install. Just use
>mysql u- root -p
to get in and set up any other users for your new database.
:-)
reply |
Thanks for taking the time to write your article on installing lamp. I'm new to Ubuntu and know next to nothing about it. Your article helped
me walk through the process with ease.
reply |
Genial,
Submitted by tototo (not registered) on Wed, 2010-09-08 06:42.
22 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Genial, Genius............
Worksssssssssssssssssssssssssssssssssssssssssss Great!
Thanks
reply |
i am a newbie and your TUT help me to enjoy the Ubuntu 10.04. now i want to now that how can i start the apache sever automatically? i
have created a luncher in my desktop and set this command: sudo /etc/init.d/apache2 start i don't know how can i make it all automatically.
Best Regards, Mohammad
reply |
This is a very good tutorial but i failed to find ';extension=mysql.so' in the php.ini file instead i found ';extension=msql.so' and changed it to
extension=mysql.so by adding 'y'.
reply |
just take out the ; infront of extention=msql.so to make it look like this
extension=mysql.so
reply |
Hey,
1. if the command not works mysql -u root just use this one mysql -u root -p
2. similarlly for sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin use sudo apt-get install
libapache2-mod-auth-mysql php5-mysql
reply |
23 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
Thanks a ton.
Submitted by Arvind Kumar Chaubey (not registered) on Wed, 2010-08-25 13:18.
Hello
once again a lot of thanks for writing this article. and hoping the same for others . Please keep it up.
Arvind
reply |
Very good, thank you! Also great comments, people! Reading the latest 50 or so really helped.
reply |
Excellent guide for newbies! Followed instructions as mentioned and voila... its working! Thanks a lot
reply |
1 2 3 4
24 of 25 05/28/2011 05:36 PM
Installing LAMP On Ubuntu For Newbies | Howto... http://www.howtoforge.com/ubuntu_lamp_for_ne...
25 of 25 05/28/2011 05:36 PM