Installing LAMP on Ubuntu 10.04 and 10.10 (Lucid Lynx, Maverick Meerkat)

April 29, 2010 by
Filed under: HowTo, linux, Ubuntu, web development 
Sponsors

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.

sudo apt-get install lamp-server^

No, that's not a typo. Please make sure to include the caret (^). The command will not work without it.

sudo apt-get install lamp-server^

The apt package manager will show all the packages that need to be installed. Hit <Enter> to confirm that you want to install them.

LAMP packages

You will then be prompted to change the password for the root user on the MySQL database.

Set MySQL root password

Set MySQL root password

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!"

Testing Apache

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:

sudo nano /var/www/testing.php

Enter the following line into the text editor, save the file and exit.

<?php phpinfo(); ?>

Next, restart Apache with the following terminal command:

sudo /etc/init.d/apache2 restart

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.

php Information

php Information

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.

cat /etc/hosts | grep localhost

You'll now want to verify that the correct bind address is set up in MySQL's my.cnf file.

cat /etc/mysql/my.cnf | grep bind-address

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.

Install phpMyAdmin

You don't need to install phpMyAdmin, but it's a much easier way to get in and adjust things in your MySQL database if you're not familiar with MySQL's commands. You can install phpMyAdmin from the command line with:

sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

The installation will prompt you to select a web server for automatic configuration.

phpMyAdmin Setup

phpMyAdmin Setup

This is important! Use the space bar on your keyboard to select apache2. Make sure there's a * next to apache2 like the picture below and then hit <Enter>.  (Click the picture to enlarge it and see what I'm talking about.)

phpMyAdmin Setup: select apache2

phpMyAdmin Setup: select apache2

The next screen will explain some information about database configuration. Hit the <Enter> key to move on.

phpMyAdmin database config

phpMyAdmin database config

Another screen will come up asking if you want to configure a new database called dbconfig-common.  Since this is a fresh installation, use the <Tab> key to select Yes and hit <Enter>.

phpMyAdmin dbconfig-common

phpMyAdmin dbconfig-common

You'll be prompted next to enter the MySQL root password. Enter the MySQL root password that you created earlier, hit <Tab> to select Ok and hit <Enter>.

MySQL root password

MySQL root password

You'll then be prompted to enter a MySQL application password for phpmyadmin. You can hit <Enter> and a random password will be generated. I chose to use the same password that I used for the root MySQL password.

MySQL application password

MySQL application password

If you enter your own password, a password confirmation screen will come up. Confirm your password.

MySQL application password confirmation

MySQL application password confirmation

Your phpMyAdmin installation and configuration is now complete.

Testing phpMyAdmin

Open your web browser and enter the address http://localhost/phpmyadmin/. You should see a page like this.

phpMyAdmin log in

phpMyAdmin log in

You can log in with the username root and the root password that you created earlier.

Logged into phpMyAdmin

Logged into phpMyAdmin

Congratulations, you're now ready to start building your local website. If you're only working on one site you can put all of your files into /var/www.  If you'll be working on multiple sites you may want to consider some additional Apache configuration to keep things neat and clean on you system.

Sponsors

Comments

501 Responses to “Installing LAMP on Ubuntu 10.04 and 10.10 (Lucid Lynx, Maverick Meerkat)”

  1. fsdaily.com says:

    Story added...

    This story has been submitted to fsdaily.com! If you think this story should be read by the free software community, come vote it up and discuss it here:

  2. John McC says:

    Great, worked on my new 10.04 install, multi site config too. Tks

  3. Denny Hugg says:

    Everything went well until the last step:

    http://localhost/phpmyadmin/ generated a 404 error. Is there a link somewhere to trouble-solving steps?

    • Linerd says:

      Denny - You probably forgot to select "apache2" during the phpmyadmin setup. You can re-run the setup with

      sudo dpkg-reconfigure phpmyadmin

      Make sure to use the space bar to select apache2 like it's shown in this picture.
      Configure phpMyAdmin

      Edit: Also, make sure to reload Apache after the change.

      sudo /etc/init.d/apache2 reload
  4. [...] to install locally to save some of your sanity. This is an easy install as well, so just follow this guide and you’ll be good (start with the Installed PHPMyAdmin [...]

  5. Dude on Internet says:

    Great article. Worked like a charm on Ubuntu 10.04 LTS.

  6. Siddharth says:

    Really helpful article :)
    Thanks friend

  7. Siddharth says:

    Just a tip ,
    You forgot to tell to restart apache after installing php my admin
    Php my admin wont work until you restart apache
    I faced the problem here

  8. The Geek says:

    It works! Your great.

  9. Allan says:

    this might be out of your topic but i would like to ask why i get an error on this:

    Forbidden

    You don't have permission to access / on this server.
    Apache/2.2.14 (Ubuntu) Server at wordpress.localhost Port 80

    I believe I have setup the virtual hosts and the sym links and all, but this is what I get. is this a problem on the server? thanks!

  10. I am trying to set up Ubuntu 10.04 LTS so I can host my website and a WebPress site as well as a mail man mailing list. Can you send me the steps I need to do for that? I have Apache, php and mysql installed. Have my domain names as well. I have the server on my home network behind a Linksys N Wireless router.

    Any help appreciated.

    Mike Hughes
    mailmikealrhughescom

  11. ubuntu user says:

    Thanks it works!

  12. Floydian says:

    I got the same result from following this that I got from using tasksel to install a lamp server. When I go to a php page, the browser asks me if I want to save or open the file.

    I.e., the php mime type is not being recognized.

    I'm using Ubuntu 10.04

    What am I missing that everyone else isn't?

    • Matt says:

      Be sure that the php file is flagged as executable by everyone...
      $ sudo chmod o+x filename.php

      Hope that helps.

      • Floydian says:

        Thanks for the suggestion Matt. Unfortunately that did not work for me. I even went so far as to chmod the file to 777. The file is definitely wide open, as the evidenced below:

        -rwxrwxrwx 1 user_foo user_foo 18 2010-05-08 20:46 foo.php

        The file should not have to be executable though. It needs to be readable since apache reads in the file and then passes that onto php internally. It's not being executed on it's own in other words.

        I am still wondering what's so different about how my installation of Ubuntu 10.04 that would cause me to have this problem, when others seem to have had no problem at all.

        Cheers and thanks again :)

      • Floydian says:

        I found an solution. The link below links to a forum post on ubuntuforum.com that describes the solution:

        http://ubuntuforums.org/showpost.php?p=9202156&postcount=3

        Cheers

  13. simukti says:

    great post...!! all (LAMP) in one magic line..

  14. Patrick says:

    Worked like a charm. Users should know adding and creating files and folders in the www dir will require root access. so for joomla, wordpress etc.. use sude nautilus in terminal

  15. Chris says:

    Wow, thanks!
    This was just the things I needed to read :D

    Every step worked flawless on Lubuntu 10.04, using OpenSSH from another computer. Woho!

    Thanks again.

  16. Ron says:

    Works perfectly. Many thanks!

  17. [...] of my time this week was spent on setting up my L.A.M.P server.  I couldn’t think of any better way to reuse the many old and abandoned desktops [...]

  18. TMRadMan says:

    That worked exactly like you laid it out.
    Thanks!

  19. Just wanted to say thank you for the help. The only issue I ran into was the php being set up so I went to this
    https://help.ubuntu.com/10.04/serverguide/C/php5.html
    I was able to set up php and then come right back to your instructions and they worked great. There are some newbies (me) who wondered for quite some time what the user name was for mySQL. I finally figured out "root". Anyway I appreciate the great tutorial and it was an A+ on my list.

    Bookmarked.....

  20. Massimiliano Beccaria says:

    Thanks it worked
    I failed in selecting apache2 with the space bar, and to recover I had to completely remove phpmyadmin from synaptic and then to reinstall it.

    P.S: installation from synaptic makes graphical selection more user-friendly....

    • Linerd says:

      Glad you got it working. Another option, rather than removing and reinstalling phpmyadmin, is to reconfigure it with

      sudo dpkg-reconfigure phpmyadmin

      You can then select apache2. Then just reload Apache with

      sudo /etc/init.d/apache2 reload

      and you're all set.

      • little_Phild says:

        Hey, thanks for your tutorial but whenever I try to set my admin password they bring this error

        ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

        But my appache 2 is up and whenever I try to run it they are showing me that it is running
        Now can I you help solve this problem I will appreciate your answer
        Thanks

    • parselmouth05 says:

      Great tutorial! Easy to follow, informative...

  21. may2010 says:

    Clean and clear guide. Thank you very much and it works gracefully!!

  22. Ritu Sharma says:

    thanks for the nice tutorial. I got a error, but finally installed LAMP

  23. jarek says:

    Thanks. Worked great.

  24. Claes says:

    Thanks! I wanted to play with a web server and this helped me get started in no time.

    This is what I did to allow me to write in the /var/www directory:
    sudo chown $USER:www-data /var/www/ -R
    sudo chmod u+w /var/www -R

    I don't know if this is the correct and secure way to do it, but it worked for my test server.

  25. Kosgei says:

    Testing php didn't work. I got the error
    "Not Found

    The requested URL /testing.php was not found on this server.

    Apache/2.2.14 (Ubuntu) Server at localhost Port 80"

  26. Kosgei says:

    Also restarting or reloading apache2 gives the error
    * Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    But my localhost address is set to 127.0.0.1--maybw this is the problem. How do I rectify this?Your help is appreciated.

    • Linerd says:

      The warning from Apache isn't really a problem. I included the solution in my post about installing WordPress on Ubuntu, but I should have included it here. This command will get rid of that warning.

      echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn

      Then reload Apache again and the "fully qualified domain name" error should be gone.

      sudo /etc/init.d/apache2 reload
  27. Abera says:

    Thanks for the setup, but I cannot write anything to the different sites. Permissions set to root not my ID. How do I change this?
    Thanks

    • Linerd says:

      Follow my post on Apache Configuration to setup the website files under your own ID in your home directory. That's the way I prefer to do things.

      • Abera says:

        This is strange. Well maybe... I just started trying the Linux way two weeks ago, so really don't know. It says I don't have permission to change, but I can. Your way of setting the server up is the only that has worked for me and I thank you.
        Thanks again

  28. Anu says:

    Thanks! It worked smoothly.

  29. Nude Monk says:

    Awesome tutorial. Just what I needed. Thank you so very much.

  30. sulekha says:

    Thanks a lot..Each point is Explained clearly..

  31. jone says:

    That is fantastic!! it works fine with out any problem. the explanation is understandably also. Thank you!!!!!!!!!

  32. Zach says:

    You for got to link the phpMyAdmin to Apache’s www folder
    sudo ln -s /usr/share/phpmyadmin /var/www/phpmyadmin

    • Linerd says:

      If Apache2 is selected during the phpMyAdmin configuration (the blue configuration screen), then the symbolic linking step is not required. I've gone through the procedure several times myself and I've never had to manually create that link.

  33. ggerri says:

    very nice tutorial. worked perfectly :-)

    Wondering how to manage stop/start/restart of services. Is there a frontend gui available like the one from wamp server?

    Thanks :-)

    • Linerd says:

      Sadly, the Services Manager is gone from Ubuntu Lucid. Searching through the forums, some suggest installing BootUp Manager.

      sudo apt-get install bum

      I also found another thread mentioning another potential tool. It's not in the repositories, but there is a link to the download for ServicesManager. Here's the thread on the Ubuntu Forums.

      The services all start automatically on boot. Personally, I find no need to stop the services. I haven't noticed any significant drain on system resources (my laptop battery life appears to be the same whether they are running or not). You can stop Apache on Lucid with the following terminal command

      sudo service apache2 stop
  34. jaspm2004 says:

    awesome guide!!!! thank you very much!!!!

  35. Arlindo Paulo says:

    Thanks for the instructions. I am trying and I believe it will work.

    Thank you very much!!!!

  36. philip says:

    Thank you for this tutorial, just what I was looking for.

    Apache is running now, and I solved the problem Kosgei had.
    Now I'm running the test-php-part, but I keep getting a blank screen, nothing happens when I direct the browser to http://localhost/testing.php/.

    Tanks in advance for your help.
    ph

  37. philip says:

    Got i running now. Thanks a lot

  38. philip says:

    sorry again,

    Works perfect in firefox as long as all the files are in the localhost directory?

    I would like to us a more complex webstructure. Something more or less like this:
    http://woork.blogspot.com/2007/10/typical-website-structure.html
    A php-command like does not seem te work in this case.

    Whereas it does work if in-home.php would be located in the root directory and

    Any ideas?
    thanx

  39. Kapil says:

    my phpmyadmin got into /etc/phpmyadmin
    and i cant change its location to /var/www/
    how to do this.. through terminal??

  40. Rudi says:

    Thank you this was a great tutorial and was exactly what I needed!

  41. Joenas Ejes says:

    Well done buddy! Thanks for this! I am new to Ubuntu so this is helpful to me. Have a nice day!

  42. Igor says:

    Great!!
    it works for me, Thanks a million!

  43. Richard G says:

    Great job! Your tutorial made all the difference in making it easy to set up my development environment. Many Thanks!

  44. Sean says:

    so I tried installing phpmyadmin before eading your page and I failed to hit the spacebar to select apache.. now it won't let me do it over. I've tried uninstalling it, but when I reinstall it doesn't ask me anymore... any help?

  45. [...] MySQL, PHP) so I can do my self-study path to PHP greatness! hehehe. Luckily, I found this great article from tuxtweaks.com, sweet! All tests were a success, I have now a running LAMP on my Ubuntu [...]

  46. gjigandi says:

    Thanks, it was very clear and useful to me.

  47. Fernanda says:

    Thanks!! Great tutorial, very clear and helpful. Together with your
    http://tuxtweaks.com/2010/04/2009/07/how-to-configure-apache-linux/
    I was able to configure my Ubuntu to learn MySQL and php. You made my day!

  48. bobot says:

    this and the tutorial on apache configuration are great! i followed these and it works all the time. simple yet very effective. muchas gracias linerd. hope there will be lots of people like you. simple yet brilliant and very kind. keep it up.

  49. eric says:

    Clear and concise. Thanks!

  50. khublaikhan says:

    I am a noob to Ubuntu and just wanted to thank you for the tutorial above. Excellent job and keep up the good work!

  51. joe says:

    A very easy to understand tutorial. Amazingly COOL!!!
    You ROCK!!!

    Thank you very much!

  52. Fantastic tutorial. Diolch yn fawr! (Thank you very much)

  53. Johann says:

    Thanks alot mate !
    Great and simple tutorial for newbies such as myself

  54. bob says:

    That was one wonderful step by step guidance for LAMP installation and configuration in Ubuntu. Thanks a lot Author.

  55. Jobin says:

    I went through this tutorial step by step and it was so easy. Thanks for the great work.

    Keep it up.

    -Jobin

  56. vj says:

    hey just before when i get your website i try to install lamp and i did a mistake ....
    1. when i try to install phpmyadmin i can't select both apache and the other one now
    i can't figureit out how can i slove this problem there is any way plzzzzzzzz help me out

  57. vj says:

    well thanx i figure out your another link
    thanks a lot

  58. jas says:

    Aloha, I followed the instruction verbatim and all works expect for phpmyadmin. I get the following:

    An error occurred while installing the database:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    I've tried reconfiguring several times. I uninstalled and reinstalled. and I have read though many posts and comments seeking the magic spell to cure this glitch.

    I would add that in var/www/ there is only two files after installation, index.html and testing.php

    mysql, php5 and phpmyadmin appear to all be present in var/lib/

    and testing.php worked.

    I am now at the end of my knowing on this. help please.

  59. jas says:

    follow up to my recent post regarding setting up phpmyadmin. and user error again gets the point. got to use that space bar. like it says in the instructions. da... no need to reply to taht last post folks. ah the life of an ubuntu newbee.

    • Linerd says:

      Glad you got it working. Don't feel bad. That step where you select apache2 during the phpMyAdmin configuration is, by far, the most often overlooked step in this procedure.

  60. jas says:

    well, almost a success.
    when I run localhost/testing.php
    I get a 'save as' window that pops up asking me to save the file.

    when I run localhost/phpmyadmin
    I get the php contol panel along with this message:

    'The additional features for working with linked tables have been deactivated. To find out why click here.'

    when I 'click here' I'm in over my head.

    Guidance and suggestions please.

  61. jas says:

    solved the 'localhost/testing.php'
    got that to work. I am still unknowing about the 2nd part.

    'The additional features for working with linked tables have been deactivated. To find out why click here.'

    what and why and what do I do to solve this? thanks.

  62. jas says:

    I spoke to soon about getting it all working. When I go into phpmyadmin there is the following note:

    The additional features for working with linked tables have been deactivated. To find out why click here.

    when I follow the click here I am out of my knowing. any ideas what this is all about and how to fix it?

    • Linerd says:

      Try clearing your browser cache. This thread might help - http://sourceforge.net/projects/phpmyadmin/forums/forum/72909/topic/3006995

      One user on there mentioned that the Firebug extension for Firefox caused the problem. If you have that, try disabling it. You might also try reconfiguring phpMyAdmin also.

      sudo dpkg-reconfigure phpmyadmin

      Keep apache2 selected and tell it to recreate the database when asked. Then reload Apache with

      sudo /etc/init.d/apache2 reload

      Then clear your browser cache and try again.

      Good luck.

  63. tweaksource says:

    Very nice article. Ubuntu continues to become more polished and accessible.

    The inclusion of this simple syntax for installing the LAMP stack is a nice touch. Does anyone know of other similar commands for other package groups?

    As an Ubuntu user since 6.04 I am very much enjoying the 10.04 release.

    Thanks for the great post.

  64. tweaksource says:

    Other than that

    sudo tasksel

    will present a list of options, including the LAMP stack.

    • Linerd says:

      Yes, you can use tasksel to install LAMP in the same way, just don't try to use it to remove LAMP. You'll blow away the whole desktop installation!

  65. Jas says:

    well I'm inclined to remove/uninstall the whole LAMP and start over. I have tried this twice however there seems to be residual data and when I reinstall specific choices and fill ins are already done. and thus i arrive at the same outcome, a lame LAMP.

    Please inform me as to how to effectively and efficiently remove the installation.

    thanks much.

    • Linerd says:

      Jas - sorry you're having trouble. I wrote a post about removing LAMP from Ubuntu 9.10, but it's really generic enough that it should work for any version of Ubuntu. http://tuxtweaks.com/2010/01/how-to-uninstall-lamp-in-ubuntu-9-10-karmic-koala/
      Good luck.

      • Jas says:

        Lucky me, I get the troubled install. So I uninstalled per the instructions. reinstalled and I got a little further this time. Here is the story. (short form)

        phpmyadmin:
        'The additional features for working with linked tables have been deactivated. To find out why click here.'

        all is good except this last one in the list:

        $cfg['Servers'][$i]['tracking'] ... not OK [ Documentation ]
        Tracking: Disabled

        from here I am not sure how to enable this. I read through the documentation but could not make clear sense on how to do this. guidance please. thanks. Seems to be very close to working.

  66. George says:

    Absolutely brilliant tutorial. Many congratulations! Ubuntu is definitely the way for us Windows users to cross over. That LAMP install was a piece of cake and well explained.

  67. Michael says:

    That certainly wallops the whole IIS, ASP, SQL install by about a magnitude.

    Everything in the article was spot on, no guessing required.

    Great job!

    • Linerd says:

      I've never gone through that install on Windows. Do you know of a good link to a tutorial? I'd be interested to take a look at it.

  68. avatar says:

    Hi, I have installed the LAMP successfully, however, the Apache server seems not to display error messages ?... I have tried modifying from the php.ini changing error messages to yes but still not working. Any fixes ?

    Thanks.

    A.

  69. Jas says:

    Aloha,

    now that the install is all good to go, I am not knowing how to get to actually serve up a local website. I've been using JSAS for my joomla development environment on windows. I'm doing my best to stay in Ubuntu these days.

    I tried to run the joomla install and nothing happened.

    I'm thinking there is still some config that needs to happen to set up localized domain type hosting or something?

    guidance please. thanks

  70. Amrit says:

    tanx for this help

  71. [...] Instalare LAMP pe Ubuntu 10.04 Cea mai simpl? ?i elegant? metod? pentru a instala LAMP pe Ubuntu este cea descris? aici. [...]

  72. Jas says:

    Moving right along with the " just one more thing" and then it will work quest. Now I need CURL to work and I haven't a clue where to begin for this. well I did some searches but it pretty cryptic thus far. any idea on how to get Curl to work in this LAMP? thanks

    • Linerd says:

      Jas - I'm not much of a web developer, so you're getting a bit beyond me with cURL, but it looks like you should be able to install it with

      sudo apt-get install curl libcurl3 php5-curl

      Then, restart Apache with

      sudo /etc/init.d/apache2 restart
  73. Max says:

    This is a great guide - I followed all the steps but when it comes to testing the phpmyadmin installation I get a page not found error. When I then go to test if apache is generally working, it is.

    I've restarted apache and tried again, no dice. Any ideas?

  74. Thanks. It was of great help

  75. Yosi says:

    Thanks for publishing this, very nice and easy to follow, keep 'em coming! :)

  76. Joe says:

    Thanks! You were most helpful! Do you have pay-pal - cause I'd like to send you $5 for your efforts! Peace.... {=P

    • Linerd says:

      Maybe some day I'll put up a donation link. I've always wondered if people actually use those, but I guess it's worth a try.

  77. Fastjack says:

    This is working well for me. Thank you!

  78. Badgerman says:

    SWEET! Finally, a plain-English tut for a very important set of tasks. Thank you.

  79. Scott says:

    I remember spending days and days and days getting this to work together before compiling this and making that remember make and make install?

    Now i'm up and running in less than 10 minutes on a fresh install.

    Ubuntu just freaking rocks (as well as whoever made this tutorial)

  80. cniv says:

    Very well written and explained.
    I still remember 2 years back when I did LAMP setup on Hardy, it took me about 30 minutes to install, configure and figure out what was going wrong.

    Now it is really easy to install LAMP on Ubuntu 10.04, very well job done for new flavour of Ubuntu.

  81. SIMON says:

    A Great Job,,,Thanks very much.

    It help me a lot, after trying for several days to make LAMP server work, found your Article. Now finally going to install again DRUPAL, will let you know my website when is up.

  82. fasil says:

    Hi there, I have followed all the steps and installed everything but http://localhost/phpmyadmin/ is not working.
    please tell me the solution for this.
    thank you

  83. Mads says:

    Yea... I couldn't get phpmyadmin to work too.
    Then I realized that it wasn't 'selected', it's just red because the 'cursor' is on it.
    To select it, press spacebar.

    I know, it's really simple and already specified in the instructions, but I'm used to modern GUIs and didn't spare it a thought!

    Good instructions.
    /Mads

  84. ShowMeGrrl says:

    This was great! The LAMP installation package set up by Ubuntu is just wonderful and your instructions were very clearly presented. This was SO easy and fast, it's unbelievable!

    I had one problem: After typing the line:
    sudo nano /var/www/testing.php

    and getting a nano text editing screen and typing in the phrase:

    I then tried to save the file using my mouse to click on the "Save Contents" command on the "File" menu. Up came the usual GUI dialogue box asking me to type in the file name and browse to the proper folder where I wanted to save the file to. When I did this, I got a message saying that the file could not be saved because permission was denied.

    I went online to nano text editor documentation to try to find a keyboard command for saving the file and found that the command to save a file without exiting is ^O (Ctrl-O). For some reason, I was allowed to save the file in this manner.

    Apparently, using the File menu command and browsing to the folder got me out of sudo mode to user mode and I was denied permission to save to the var/www folder. But using the keyboard command, I was still in sudo mode. That's the way it seemed to me, anyway.

    So the moral of the story is to use "Ctrl O" to save the testing.php file.

  85. Jambal says:

    This is a great post ! one stop shop. My setup was up in less than 5 minutes. In fact the process was faster than I put the passwords to work. Great Post , Guy rocks

  86. Matt says:

    At first I had the same problem as ShowMeGrrl and couldn't save using nano as I didn't know to save using "CTRL+O" in nano. So instead I simply used sudo gedit /var/www/testing.php and saved using "CTRL+S" which worked beautifully.

    Aside from that, everything went perfectly fine the first time around. Now if I could just figure out where the hell I can find this stuff installed on my system, that would be great. I was trying to enable the phpMyAdmin tracking but can't find the "./scripts/" directory or the "create_tables.sql" file in order to create the database for it.

    Being an extremely new Ubuntu user, I'm not familiar with how/where things get installed and how/where to find them later. With Windows, I usually specifically choose exactly where everything should be installed, so finding things later is very easy. Not so much in Ubuntu. I never know where things are going using the apt-get installation method.

    Don't get me wrong, I actually like the ease of installing stuff in Ubuntu, I just wish I knew where the hell I was installing stuff to.

    Anyway, can anyone point me in the right direction to find the "./scripts/" directory so I can test the tracking feature of phpMyAdmin?

    • Linerd says:

      You can try using the "Search for Files" program found under Applications→Accessories→Search for Files...
      or you can search from the command line with

      find / -depth -name scripts
  87. Anjali says:

    This is very easy and simplest way for installing LAMP SERVER.Thankq so much.

  88. Matt says:

    Thanks for that Linerd! That's exactly what I needed. I had tried to search through the file browser, but never could find the directory or script (even with the little search feature). Actually, I still haven't found it just yet, but using the command line seems much faster and a more convenient way of searching. Thanks again!

  89. ketan says:

    it was grate help, was up and running with my web server in less then 7 minutes
    thanks a lot and keep doing good work

    ketan

  90. chunn says:

    Great instruction! I am a new ubuntu user and just successfully installing LAMP and set up Joomla on my laptop.... but I cannot further install virtuemart component since I can't access the directory var/www/tmp ... I think it is about permission, but don't know much about it.

    I have read that if it is on a server, we have to change CHMOD...

    Please help me to install the component into var/www/tmp

    • Linerd says:

      You can copy files to the /var/www directory as root using sudo.

      sudo cp filename /var/www

      Or you can change the ownership of the www directory so you don't need to be root. Assuming your user ID is user1 and your main group membership is user1, the command would look like this:

      sudo chown -R user1:user1 /var/www

  91. eHope says:

    Thanks. Great! Super desciption

  92. [...] which I use UltraVNC), so I can operate the second PC from my main PC. After that I installed a LAMP server. This installs everything you’d need for your own webserver at home. I was actually suprised [...]

  93. Ravi Rokkam says:

    This was the easiest tutorial/documentation I have ever seen.
    Great job!
    Thank you so much.

  94. reeve24 says:

    Thanks for this great tutorial... i did follow all the instruction.. and i got all the sites working:
    http://localhost/ - It works! This is the default web page for this server.
    The web server software is running but no content has been added, yet.
    http://site1/ - Site1 works!
    http://site2/ - Site2 works!
    ---------------------------------
    here's my issue.. when i put all the joomla files on /var/www/
    i got the following error : 404 Not Found The requested URL /joomla was not found on this server. i also tried on site1 and site2 but no luck? what i did wrong or i missed something? Thanks for any advice..

  95. reeve24 says:

    ahaha LOL..... 8's now alright.. i just move all my extracted files in a folder.. (joomla)

    http://localhost/joomla/

    Thanks.... : )

  96. Arthur Zennig says:

    That was a PERFECT step-by-step solution.
    It really solved my problems with some ERP solutions.
    your blog is now in my favorites.

  97. mike says:

    To get phpMyAdmin working from within the web browser you must extend the apache configuration with this:

    Type:
    sudo nano /etc/apache2/apache2.conf

    Add at the bottom:
    Include /etc/phpmyadmin/apache.conf

    Restart apache:
    sudo /etc/init.d/apache2 restart

  98. yogesh says:

    Very well explained ... Great Job ....Thank you very much

  99. Cassiano says:

    Very good, simple. Congratulations!

  100. Floyd says:

    Work well thanks a lot.

  101. gREAT work man, did it in 5 mins

    Cheers

  102. Jan says:

    Thank you! That went like a charm!

  103. Nice one! Thanks, would have taken hours to work this out on me own! lol

  104. kamchatka says:

    I get a list of errors that look like this:

    Err http://gb.archive.ubuntu.com/ubuntu/ lucid-updates/main php5-common 5.3.2-1ubuntu4.2
    404 Not Found

    Is this something I've done wrong?

    • Linerd says:

      Something might be wrong with your apt sources. Try changing to Ubuntu's main server for updates. Go to System->Administration->Software Sources. Set the Download from: field to Main server and click the Close button. When it prompts you about out of date software information, click on Reload. Once that's done, give it another try.

      • kamchatka says:

        Yes. Thanks very much. That seemed to be the problem. Followed the rest of your prompts, apache installed and tested ok, php installed and tested ok, mysql installed and the bind was as expected, installed phpmyadmin but the test failed. Should I go to a forum for reasons. Looking in my etc folder, it is installed, just not accessible through localhost. The worst part of being a newbie is the time it takes to stop being a newbie.

  105. milad says:

    Hi.
    There is no lamp-server in ubuntu packages.
    $ sudo apt-get install lamp-server
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package lamp-server

    • Linerd says:

      Take another look at the directions. The command is

      sudo apt-get install lamp-server^

      You have to include the caret (^) in the command for it to work.

  106. John says:

    Awesome! Easiest install ever.

    For production deployments should the mySQL dbase still be bound to 127.0.0.1?

    • Linerd says:

      I don't think so. According to the Ubuntu docs, you should bind it to your local IP address.
      https://help.ubuntu.com/community/ApacheMySQLPHP#Set%20mysql%20bind%20address

      • You should bind it to 127.0.0.1 if you do not plan to access to it from over the net, local access only. That's more secure this way.
        You can bind it to your LAN ip address (not visible from the internet) if other servers in the LAN needs to access it from over the LAN.

        You could also bind it to a public IP address accessible from over the internet. IMHO this is not really a good idea for speed and security concerns. Make sure to use a good firewall and restrict access only to trusted other public IPs.

        Hope this helps,

        Fabio Varesano

  107. Nalin says:

    excellent documentation..

  108. Steven says:

    Thanks - very easy install

  109. wow, this is so simply. thank you bro....

  110. veracruz says:

    This was a snap. Simple step by step instructions. Thanks

  111. 3 thumbs up ... zero snags ... THAT is an all time first!

  112. market says:

    Hi, everything set up, were some errors but I decided, you can Tell how to properly install NGNIX once installed and set up LAMP in Ubuntu 10.10?
    Thank you!

  113. dan says:

    Thanks so much.

  114. fernando beltran zamora says:

    My friend, you are a genius !
    Your tips worked at the very first time !
    I've been trying to get since a month ago, 'till now !
    Please, keep on teching people how to use this amazing software !

    Thanks a lot !

  115. emmanuel wilson says:

    Great job man,,, evry thing works fine

  116. Ricardo says:

    thank you very much!! I'm brazilian and used this for install in my home. Very very simple and practice. Congratulations!!!

  117. Heath says:

    I ended up with this error message

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using ?
    ? password: YES)

  118. Guppydas says:

    Superb. I had tried a couple of other HowTo's that I found in search results but something or the other was going wrong. I am a person who likes to have things neatly done.

    Thank you so much for your great walk through. I also appreciate your instructions on configuring Apache2 for creating more sites.

    Just FYI, I want to work on four main CMS systems. Namely WordPress, Drupal, Joomla, Mambo to determine which one would be more suitable to my clients. I know there is plethora of information out there but nothing satisfies my curiosity. I did rather try all hands on myself. Then I know for sure what can be achieved on each of the platform.

    Your both write ups have been extremely helpful. I am technical but not ... how to say ... 'geek'.

    My best wishes to you and keep doing good work. Thank you.

  119. Ian says:

    Wow! Who knew it could be this easy? Thanks for the awesome step-by-step. I didn't know where to start, googled install lamp, and BAM, three minutes later I'm up and running. The single easiest linux experience I've ever had, for what should be the hardest..thanks :D

  120. sudeep says:

    thanks a lot

  121. Ashwani Gaur says:

    Amazing .. was a cakewalk .. thanks a ton !

  122. Luis says:

    I get this error message
    E: Unable to locate package phpmyadmin
    when trying to install phpmyadmin
    using the command line
    sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

    Any suggestions?

    • Linerd says:

      All I can think of is to change the server you are using for updates. Run

      gksu --desktop /usr/share/applications/software-properties-gtk.desktop /usr/bin/software-properties-gtk

      and choose a different server in the Download from: field.

    • atiieh hoseinpour says:

      I have the same error and solve it by updating /etc/apt/sources.list
      use this command : apt-get update

  123. steve says:

    wow.. thank you! we know it's alot of work, but for newbies like us information and step by step stuff like this is really nice. thanks. now onto finding directions on setting up and adding a web site. Any tips?

  124. Matt says:

    Thanks mate this is awesome

  125. Ron Mahon says:

    Hay Grate site..really appreciate it.
    I was flying until i got to phpmyadmin test. the install script ran fine. There is nothing in /vaar/www/ except testing.php which works fine.

    It seams like I had this problem a few years back and there was a link missing from the program directory?

    Any ides on how to proceed?
    Thanks again for this pretension
    Ron

  126. John says:

    Great walk through, was surprised everything worked first time, I need to understand the Unix commands, very well done, thank you.

  127. octavio says:

    wow great tutorial i needed to install lamp and found many tutorials but no one worked for me :)

  128. Vishnu says:

    Thanks a lot.. Linerd
    I appreciate your instructions and guidelines. It really helps for a user new to linux/lamp. :)

  129. Brad says:

    Great instructions! It worked... except... When you said, "This is important! Use the space bar on your keyboard to select apache2. Make sure there's a * next to apache2 like the picture below..." I just hit enter because the selection comes up with a red box in the brackets. But, it DID NOT HAVE THE '*'. You have to actually hit the space bar (just like you said)! Doh!
    Fortunately, your recovery (link http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/comment-page-1/#comment-2952)
    for dorks like me worked perfectly and all is well in the end!
    Thanks a million!

  130. Doug says:

    Man I wish there was more people out here that could give such easy to fallow and comprehensive instructions as you did, I'd been messing around with a project basically for my own self satisfaction trying to build a some what "Not so Super Linux Server" with 3 servers all sporting Ubuntu Server and this just blasted me to nearing a finish I had most of what you instructed done but the phpMyAdmin was the Icing on the Cake!!
    Thx & Keep up the Good Work

  131. Richard says:

    Hi
    Great tutorial.
    I tried the steps & all fine until at http://localhost/phpmyadmin I get
    >The requested URL /phpmyadmin was not found on this server.<

    I am new to Ubuntu/Linux & it has taken me hours to get nowhere setting up a localhost server (Ubuntu 10.04 LTS). On my Vista box I use Xampp & mistakenly I installed Xampp to start with on UBuntu LTS. That conflicted with Apache2/MySQL and even though I deleted Xampp I cannot get LAMPP to work yet!
    Why doesn't it serve up phpmyadmin?
    Apparently I have all the required packages I think but cannot get through to phpmyadmin.
    I have screwed it up somewhere but how can I fix it & get it working!
    Any idea & help greatly appreciated-thanks

  132. Petra says:

    Thank you so much for this clearly written tutorial! It was easy to follow. I also followed your tutorial on setting up apache for several websites; also a winner. Like many of the other commentators I also dream of a world where howtos are easy and logical to follow and in simple language. If you run for world leader in that world you have my vote.

  133. elruinnou says:

    thank you so much more than ever

  134. Justin says:

    Is there a one liner install to do this with suPHP as well?

  135. Sveinung says:

    I have a php problem that I just don't understand at all, it seems quite ridiculous.

    I have made some web pages in php and when I test them on this new installation with lamp server on 10.10, some of the pages work and some don't. For the pages that don't work I get the standard Firefox downloading window where I am asked if I want to save it or open it in another program.

    If I delete a file that doesn't work and then copy a file that works and renames it to the old file name that didn't work it still doesn't work. If I rename the file to something complete different it works.

    Does anybody know a solution to this?

  136. rey miguel says:

    hi there!

    i followed all the instructions and no errors has interrupted the installation, mysql works fine. but after the installation of phpmyadmin, when I test to browse it on my browser it says :
    "Not Found"
    "The requested URL /phpmyadmin/ was not found on this server."
    "Apache/2.2.16 (Ubuntu) Server at localhost Port 80"

    What should I do..??

    Thanks in advance.. :D

  137. alx says:

    thanksssssssssss!!!!

    this tutorial is awesome, a flawless installation i got some issues with the php my admin, but this solved all ->

    sudo ln -s /usr/share/phpmyadmin /var/www

    i really appreciate the efforts you guys make to teach us, you just saved my day thank you, im discoverying Ubuntu, and im getting hooked with it, and stuff like this helps (at least i see it that way) to make free software easier for noobs like me :P

    And well, since im a nooby using linux i had some troubles and ill write a little about how i solved them,

    this is for those reading this who doesn't know how to deal with superuser permissions

    joomla cms

    to copy ur files to /var/www/

    Extract or gather your joomla or quickstart files to a directory in de desktop. We're going to call it joomlafiles in both: with in the desktop and in the /www folder, you may use any name you want. So create the folder in your desktop and put in there all the joomla files

    now, the /var/www/ directory is a restricted directory so you cant just put things in it

    so, open the terminal and write

    cd /var/www/
    sudo mkdir joomlafiles

    we just made a new directory in /var/www/ to put our files in

    now to copy them from the desktop just write

    sudo cp -R /home/YOUR USER/Desktop/joomlafiles/* /var/www/joomlafiles/

    where YOUR USER its the name of the user wich you're logged with

    generally its behind the @ubuntu in the terminal if you're using ubuntu, usually it's in low caps :P

    then you may browse to http://localhost/joomlafiles/ in your web browser

    in my particular scenario i installed joomla at this poin. we know we have to delete the "installation" folder at the end of the installation. and it has to be done by terminal too

    you may want to be very carfeul at this point because we're going to delete a folder and all its contents, if you write the command wrong you may erase your whole filesystem

    you have to write

    sudo rm -rf /var/www/joomlafiles/installation

    this will erase the folder installation and all it's contents, so if you write it wrong you can get into troubles

    after this you can open your browser at http://localhost/joomlafiles

    By th way

    If you got an "No configuration file found, Exiting" error when opening it probablye means that no config file was created, however we can create it :P

    open the terminal and write

    sudo nano /var/www/joomlafiles/configuration.php-dist

    search for the MySQL info and fill it properly between the -> ' ' i.e. user, password, db name and so on.

    for example
    var $user= ' '; ----> var $user= 'write here the user';
    (dont copy/paste it from here)

    Ctrl + O will save it, be sure to save it as configuration.php

    open u r browser again, it should be working now

    :P joomlafiles was just an example folder name, replace it with yours

    thanks

  138. yan says:

    Great tutorial. Made me do in 20 minutes what I have not been able to achieve in weeks.....

    Congratulations!

  139. Rasmus says:

    Thank you for a fantastic guide that was easy to follow

  140. Mark says:

    Linerd -

    Like the comments above - your tutorial was just outstanding. Literally 20 minutes, and I was being ultra slow & careful. THANK YOU!!

  141. archie says:

    Great tutorial, as simple as possible and quit efficient....thanks a lot

  142. Binaya says:

    Thanks a lot!!! Flawless installation with your tutorial

  143. Kartik says:

    Thanks, great tutorial!!

  144. Tigrapho says:

    Thank you !! I'd like to contribute just as you are doing to make applications on Linux easier to use...

  145. android says:

    Thanks a lot, works fine for me.

  146. random says:

    I cant open localhots/phpmyadmin

  147. Biginner says:

    Really really really helpful. Within 2 days, without prepration, Ubuntu 10.10 and LAMP installed. For LAMP, just vooom, in one go, done!

    Thanks a lot.

  148. trinity says:

    oooh!!!!! you're amazing! thank you!!!

  149. frenchie says:

    Hey how about installing mail server (postfix) on Ubuntu 10.x guide .?

  150. Walker says:

    Great HOWTO.
    Simple, clear and acurate.
    Thanks

  151. [...] a gludo’r llinell isod cyn pwyso enter: sudo apt-get install lamp-server^ Wedyn dilyn y cyfarwyddiadau sydd ar tuxtweaks.com i osod LAMP. 11.12.10 | Tagiau: Apache, LAMP, MySql, Perl, Php, Python, Ubuntu Cymraeg, Xampp | [...]

  152. garyr says:

    This is without a doubt the BEST & EASIEST tutorial I have used to install a lamp on Ubuntu.
    Thank you for your knowledge and your time.

  153. logdog says:

    Awesome tutorial, thanks!

  154. Kingsley says:

    Simply Wonderful!, but I got an error in phpmyadmin that says
    $cfg['Servers'][$i]['tracking'] ... not OK [ Documentation ]
    Tracking: Disabled

    All the same. Thanks.

  155. Cheikh-Monte says:

    thanx. it was awesome and very clear to follw

  156. Nippon says:

    Hey ... everybody...
    1st of all ill like to congratulate everybody for making such a awesome Tutorial ..
    it was like soo easy for a noob like me ...

    by the way i got one error ... while installing phpmyadmin ..

    my apache is working fine as im getting phpinfo(); function working
    but somehow even after following your tutorial .. i cant get phpmyadmin to work ..

    any suggestions???

  157. Faisal Basra says:

    This is excellent article. I just configured the LAMP suite by first attempt within 15 minutes by following this guide.

    Great job....

  158. southwave says:

    great HowTo, thanks.

  159. Gert-Jan says:

    Excellent HowTo. After unsuccessfully trying to install apache, mysql and php manually, this guide gives no problems. Done in 15 minutes!

    Great job!

  160. Glenn says:

    Great tutorial guys.
    I'm definitely not a linux guy and I just created a VM using VirtualBox. I installed Ubuntu 10.10 desktop and then used your tutorial to install LAMP. Couldn't have been any easier.

    Thanks!

  161. Jim says:

    Thanks so much! this tutorial was a dream.

  162. Steve says:

    Just tried it on Ubuntu 10.04 and had the following errors:

    steve@ubuntu:~$ sudo apt-get install lamp-server^
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    mysql-client-5.1: Depends: libdbi-perl but it is not installable
    Depends: libdbd-mysql-perl (>= 1.2202) but it is not installable
    mysql-server-5.1: Depends: libdbi-perl but it is not installable
    Recommends: libhtml-template-perl but it is not installable
    E: Broken packages

  163. cezabs says:

    Fantastic, Great !
    As I am newbie on Linux, I spent hours to try to install a local server to test Drupal 7.
    Finally I found your article and tuto and it works perfect, no error, only 15' and result exactly as described and expected.
    Thanks a Lot.
    Now I will try the Apache configuration as proposed at the end of your article. Hope that it will works same way.

  164. chris says:

    thanks
    it works as advertised !

  165. Jerry says:

    This is the smoooothest installation process that I have ever experienced in my entire life. Whoevermade this up deserves lots and LOTS of credit.
    WAY TO GO.

  166. Chris O says:

    Great job on the tut. I had this up and running in no time. Let me know if you have a tut to set up a LAMP system for production with separate db and apache servers! Even charge for it if you like.
    thanks!
    chris

  167. Dan says:

    Holy cow, that what easy!

  168. Hayden says:

    Thanks for the guide, top notch information. Everything worked exceptionally well.

  169. Mikhail says:

    Tutorial is great, took maybe ten minutes to set up LAMP except for one mistake I made. I didn't create a password when prompted earlier, here...

    You will then be prompted to change the password for the root user on the MySQL database.

    ...but since I could not advance beyond this later step...

    You'll be prompted next to enter the MySQL root password. Enter the MySQL root password that you created earlier, hit  to select Ok and hit .

    ...I simply entered my already existing root password (not a new one created during this setup).

    Now I can't log in to phpMyAdmin. How do I fix this? By the way, I'm almost completely new to Linux, and I'm absolutely new at the AMP parts of LAMP. Thanks bunches for your help.

  170. Ted says:

    Went without a hitch. Wish I could get Samba to work as well!

  171. Great tutorial on setting up Apache, MySQL, and PHP on Ubuntu. Worked great with Ubuntu 10.10. Was able to drag all the files from the old WAMP dev server over and back up and running as quick as could be.

  172. Richard Chan says:

    Great tutorial!

    I heard a lot about Ubuntu and was trying it in my old laptop. Since I have no experience in linux environment, simply installation of applications became a great challenge to me. Following your tutorial made installing LAMP an easy task for me.

    Thanks a lot.

    Richard

  173. renou says:

    Thanks for your tutorial...

    there is only one thing which went wrong about phpmyadmin (perhaps something i have missed) :
    when i go on localhost/phpmyadmin i got 404 error code.

    To resolve this issue, i added an alias for phpmyadmin in my apache configuration :
    cd /etc/phpmyadmin
    sudo cp apache.conf /etc/apache2/sites-available/phpmyadmin.conf
    cd etc/apache2/sites-available/
    a2ensite phpmyadmin.conf
    /etc/init.d/apache2 restart

    And it phpmyadmin worked ...

  174. chitownmgs says:

    Not a single problem installing. Followed this tutorial exactly as written. This looks just like what I needed after taking a PHP class in my university. My sincerest appreciation for creating this tutorial. What a wonderful job. Thank you!

  175. Kamran says:

    Wonderful Guide Thanks

  176. oem says:

    Awesome!

    Can you possibly make a printable version of this document? Been trying to print it but for some reason I have to either print the entire web page or it just prints the first page when I select print selection in print options.

  177. pai says:

    Awesome thanks a bunch :)

  178. Aaron says:

    Thanks for the easy instructions, I'm taking Linux Server in school and hope to get better acquainted with it by having it at home also. I have a lot to piece together (PHP, SQL, Apach2, ...) and could not get far without the help from sites like this.. Thank you again =-])

    • Linerd says:

      If you don't mind me asking. Where do you go to school? It's nice to hear that some schools at teaching Linux. A few near me seem to be firmly in the grasp of M$.

  179. JC says:

    This is great! Thanks a lot...

  180. Turdboat says:

    thanks for the absolutely flawless tutorial!!!!!

  181. AW says:

    works great, thanks.

  182. Daniel says:

    Gr8 tutorial! I got it running in just under a few minutes! ! :P

  183. ammofreak says:

    Have been experimenting with Linux & found many sites offering what I call "half solutions". I must say it is truly refreshing that for once someone thought the process through and gave "the complete solution". Thank you very much!

  184. vmachine says:

    Thanks a million. excellent tutorial.

  185. frank18 says:

    Best instructions and easiest installation of a Linux mod ever - thanks a zillion!

  186. hawre says:

    hello, when i installed it, i did not set any password non for the mysql and also non for phpmyadmin, but now it askes for password, i entered username and pass of the linux login but it faild , and also failed with no username and password, what i suppose to do? please help..
    thank you

    • Linerd says:

      I'm not sure how to do a password reset on MySQL or phpMyAdmin. Your best bet might be to uninstall LAMP and go through the installation again. Of course, make sure to set passwords the next time around.

    • Brad says:

      A good site for how to change your MySQL password is https://help.ubuntu.com/community/MysqlPasswordReset.
      Very straight forward.
      I also noticed on both the LAMP Server and PHPMyAdmin installations that I had no request to enter a password.
      So, after MySQL was installed, I did a password reset then ran the PHPMyAdmin install which appeared to automatically pick up the same password.
      This tut was very helpful and everything went smooth.

  187. Stefan says:

    I can only echo what others said already: I would be happy, if all tutorials were flawless and easy like that one. It brought back my nearly lost believe that Linux is not only for geeks. The only thing to top this tutorial would be to include a section on how to install a web panel to configure Apache (and other running servers like Bind, FTP, SMTP, ...) like webmin.
    THANKS!!!

  188. Mario says:

    This is the best and easiest howto for a LAMP server installation, great for vps setups!

  189. Robert says:

    Thanks a million. I've really struggled in the past getting LAMP to run on Ubuntu; your tutorial was exactly what I needed. Keep up the good work!

  190. dufftime says:

    Thanks for the great tutorial. Minor optimization to your steps however. Instead of doing this:

    cat /my/file | grep somestring

    You can just do this:

    grep something /my/file

    There are some good youtube vids for installing webmin for those interested.

    • Linerd says:

      Thanks for the tip. I've always been in the habit of piping things into grep because I use it with ls a lot. I forget that I can just use grep directly with files.

  191. MRR says:

    Hi. That was very useful for me. Thanks a lot.

  192. mtei says:

    Its there procedure to remove server? it is same as on 9.10?
    tnx

  193. delboy says:

    Excellent, clear tutorial, thanks very much

  194. mtei says:

    One more question, is ther any sequrity things to do to prevent hacks, now when server works on comp and anybody can acess the site on computer?

  195. Camilo says:

    Thanks a lot, it was absolutely easy...

  196. vicktech says:

    Useless. Can't choose version of php to install.

  197. speedy4081 says:

    Hi, I'm a Linux newbee using Ubuntu 10.04 LTS on a HP Proliant Server. I have downloaded a .gz (zip) file of LAMP.
    When I try to run the command on a terminal It attempts to download from the internet. Please how do I install the Zipped package as it unzips into files & folders

  198. WarriorPoetess says:

    Excuse me please.

    Presuming that you are running Ubuntu 10.10, and you want to run your system to have a local server, there seems to be a typo there on the address to test the phpMyAdmin with.

    Try using this internal address:

    http://127.0.0.1/phpMyAdmin

    You may find that this actually works!

    The Last Warrior/Poetess

  199. WarriorPoetess says:

    Okay, so all of that is really great, but.......

    You seem to have forgotten the fact 10.10 comes with permissions set so that a user can not change permissions for system safety. A user has to go to the root folder var/www/ and change the permissions to allow the root user to modify the permissions so that the testing.php file can be placed in that folder. So this is what I did to correct that situation:......

    Presuming that you [the user] are running Ubuntu 10.10 Maverick Meerkat the following steps to what I percieve to the missing steps to give the [user] permissions to be able to place the testing.php file in var/www/.

    1.) Press Alt-F2 on your keyboard and a dialog box should come up.

    2.) Type this command in the blank line at the top and click ‘Run’:...... gconf-editor

    3.) When the gconf-editor opens, scroll down to apps –> nautilus –> preferences and check the box ‘show_advanced_permissions’

    4.) Close out this dialog box and go to Places –> Home Folder.

    5.) Right click a file or folder and select the ‘Properties’ tag.

    6.) Select the ‘Permissions’ tab and you should see a permissions dialog box.

    7.) Select your system user name from the upper-most "Owner" drop down menu. You might also want to set other permissions regarding the other permission options menus while you are there.

    8.) Close out the permissions dialog box.

    9.) You should now be able to open the /var/www/ folder to insert your testing.php file.

    10.) Go to the place where you left off which is the title of: Testing phpMyAdmin.

    The steps above do actually work!

    I know I should have placed my previous posting after this one, but it's one of those days where even the bass swim backwards.

    The Last Warrior/Poetess

    • Linerd says:

      Hmm. I didn't have any problem placing the file there on my 10.10 system. Anyway, thanks for the tip.

    • Brando666 says:

      Instructions above worked great with me on Ubuntu 10.10.

      Remember to use 'sudo' to create and edit the /var/www/testing.php file. That way you will not have to alter the permissions.

  200. Amin says:

    Thanks lot !

  201. McIyer says:

    Hi
    I am a Linux newbie and just installed Ubuntu 10.10 Meercat version. Once i typed the first command above to install lamp-server, after it went through numerous lines of processing, it ended with a statement "ldconfig deferred processing now taking place" and took me to command prompt - did not prompt for creating the mysql pwd or anything else. any suggestions on what is going on?

    thanks

    • Linerd says:

      Not sure what's going on for you. I'll have to try it on a fresh 10.10 install and see what I get. Are you set up to use the main Ubuntu servers as your package sources?

  202. dr_no says:

    Hi
    I am a Linux newbie and just installed kubuntu desktop 10.10 Meerkat. im just install like u write, apache it's work, mysql ok

    http://localhost/phpmyadmin

    Not Found
    The requested URL /phpmyadmin was not found on this server.
    Apache/2.2.16 (Ubuntu) Server at 127.0.0.1 Port 80

    please help me

  203. [...] forum, http://ubuntuforums.org/showthread.php?t=779145&page=2 , and the link Jamie provided, http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/comment-page-1/, to finish the process of completing my LAMP installation.  I was also able to make sure I had [...]

  204. Aparna says:

    what if there is no * there at apache2 while installing phpmyadmin?

  205. Konstantine says:

    Hi there,
    i just wanted to say thanks for this great tutorial.
    I'm an ex-windows user and i'm trying to get everything to work on my Ubuntu,
    this is a great addition which allows me to boot into Windows less often.
    Thank you,
    - Konstantine

  206. pat666 says:

    Brilliant. Thanks. Worked right out of the box.

  207. Max says:

    HI I AM NEW TO LINUX. I JUST WANT TO ASK IF THERE IS A WAY TO CONFIGURE APACHE BECAUSE THE DEFAULT DOCUMENT WHEN I TYPE HTTP://LOCALHOST IS INDEX.HTML. IS THERE A WAY TO CHANGE THE DEFAULT DOCUMENT AND REPLACE IT WITH THE INDEX.PHP THAT I HAD CREATED INSTEAD OF WRITTING HTTP://LOCALHOST/INDEX.PHP???
    PLEASE REPLY ME AT xxxxxxxxxx OR AT THIS FORUM!!!
    THANKS!!!

  208. Hi Mate,

    Thanks a lot for this tutorial.

    You've saved my day :D

    Cheers

  209. sarmad says:

    Thanks a lot for this extremely useful post. I also would like to ask how can we let our computer to act as an internet host so that it allows other people from the globe to connect with my website. I would very appreciate an explanation or a reference

  210. Raj says:

    I got a download option when run testing.php.what to do ?

  211. Tausif says:

    Everything works fine but i am unable to access myphpadmin using http://localhost/phpmyadin/

    404 page not found on this server and also var/www/ does not contain any directory for phpmyadmin

  212. JH says:

    Thanks, a true dummy guide. That's the way I like it! Unfortunately no connection with phpadmin yet, but I'll figure that out.

  213. JH says:

    Had I read Tausif's comment just 1 second earlier. Executing that command did the trick.

  214. Fabio Reche says:

    Thank you! everything is fine!

  215. Stefano says:

    Grazie mille, veramente semplice e veloce. Tradurro' in italiano il tuo articolo e lo pubblichero' sul mio sito. Posso usare le tue immagini?

    Thank you very much, it's really simple and fast. I will translate your post and i will publish your post on my site. Can y use your images?

  216. Thank You very much for such a clean and straight tutorial. From first line to the end without interruption or step-backs. Muito obrigado. Do começo ao fim sem interrupções. Excelente tutorial. Direto ao ponto.

  217. sjekoken says:

    Great job on this ... straightforward, to the point, and works exceptionally well!

  218. Crathmel says:

    Wonderful! Your instructions were perfectly clear, and everything worked exactly as you had it written. I'm new to Linux, and so would never have been able to do this on my own. Thank you for taking the time to write this post!

  219. Paul says:

    Thank you so much, that was awesome. I had just got rid of Windows 7 on my netbook but still wanted to be able to do some theme testing with wordpress on it. Thanks.

  220. Arvindhen says:

    Wonderful post.. I just had to follow it.. Thanks for such a nice one.

  221. pow says:

    great article :) although succeeded without looking at screenshots :) )

  222. Lars says:

    Thanks for a great tutorial. I use this one with my students.

  223. Akash Agarwal says:

    Man hats off... awesome instruction ... works like magic

  224. Jimenez says:

    I instaled phpmyadmin (LAMP),but when I test it (http://localhost/phpmyadmin) I get:
    NOT FOUND "the requested URL/phpmyadmin was not found on this server".
    Apache/2.2.16 (Ubuntu) server at localhost Port 80.

  225. james says:

    This is the quickest and best install I've used to get a computer up and running LAMP. Thanks, James

  226. pushpendra says:

    greate it works
    Thanks man
    dclicker.com

  227. Dazza says:

    Couldn't have been easier - thanks! Clear instructions. Just enough screen shots. Chur.

  228. Alfan says:

    Thanks for your help about why installation MySQL in UBUNTU 10.04

  229. Petar says:

    Thank you for this clear tutorial I follow your instruction step by step all worked except phpmyadmin
    I also restart apache2 after installing phpmyadmin but when navigating to http://localhost/phpmyadmin/ it displays only page with error 404 page not found I test my php works http://localhost/testing.php reports - PHP Version 5.3.3-1ubuntu9.3 I am using UBUNTU 10.10 If you can point me where to look for correcting this it will be great.

  230. Anon says:

    I am having trouble when I have to type in into the text editor and and save the file. Could you please help me?

  231. Ahmed says:

    thanks so much

    plz i dont know wht to do

    everything work fine till i enter localhost/phpmyadmin

    it get me a download form to download a file .phtml.part

    i dont know where is the problem

  232. Philip John says:

    Thanks for all the great tutorials!

    When I try going to anything on localhost in a browser the Save dialog appears with filename of 'download' instead of the page loading.

    I have tried with new files just to test but it happens whatever URI I use.

    • Linerd says:

      Try clearing your browser cache. From some Googling I did, that sounds like it's the solution. If you still have a problem, restart apache.

      sudo /etc/init.d/apache2 restart

      Then clear your browser cache again.

  233. JB says:

    Excellent - thanks! Works fine on Ubuntu 10.04 netbook edition with some LAMP components already installed.

  234. thanks.. great tutorial...
    it works fine on Ubuntu 10.10 Maverick netbook edition

    maturnuwun, thank you from Indonesia

  235. Frank says:

    Great tutorial, thanks. How can I add tomcat to this setup?

  236. Luis Valero says:

    Your tutorial is excellent! Thank you very much.

  237. Alex says:

    Thanks a lot!! the best tutorial i ever found in web))

  238. Anuj says:

    Thanks it was a nice tutorial , i recently installed unbuntu 10.04 and was a windows user earlier. I desperately needed lamp as i was using wamp earlier . This section helped me a lot

  239. Tim says:

    I'm with Frank - how do you add Tomcat to this? Thanks.

  240. Sandeep Bhat says:

    Thanks for the great post. It was really helpful and all steps worked like charm. :-)

  241. Steve says:

    Hi, great article.

    I want to use drupal7.

    How do I know if this will install the drupal7 pre-req's like apache 2, php 5.3, mysql 8.3 ?

  242. Aneesh Mohan says:

    Thanks for the tutorial

  243. Ted says:

    Great Tutorial
    everything worked really well. Somethings were a little different but totally manageable.

  244. Ed says:

    Great tutorial, very clear and to the point.

    Thanks!

  245. sanjay says:

    Really helpful tutorial , thanks a lot :-)

  246. Mohammed Ghaji says:

    Thanks your tutorial is nice but i can't access phpmyadmin on my local server its indicating Not Found

    The requested URL /phpmyadmin was not found on this server. how can i resolve the issue.

  247. Gary says:

    Thanks for a "to the point" tutorial... After workwith LAMP on Redhat and Centos many times over the years, as a "Ubunutu (debian) newbie" it was a pleasure to find such a useful tutorial that worked "out of the box"...

  248. mike maxton says:

    Thanks for the very detailed and accurate step-by-step. All worked as laid out. I appreciate you taking the time to put this together. It was a great help for my first Ubuntu - LAMP install.

  249. sreeni keloth says:

    it is super....thanks for posting...nice work.!

  250. bong says:

    thanks.

  251. Karan says:

    Thanks this super tutorial really helps me....

  252. lars says:

    excellent post. works well in ubuntu server 11.04 64bits too. thanks!

  253. lindsey says:

    has worked perfectly on every recent ubuntu version i've used so far :)

  254. abidar says:

    j ai installe phpmyadmin sous ubuntu 10.10 mai se dernier a un passwd par defaut j'atend votre help....

  255. henry says:

    thanks for your guide, its really helpful to me for installing phpmyadmin but i have a problem, when i finished the intsallation i tried to login with my root user name and password, which is thesame i used for phpmyadmin.
    I don't know if the password are suppose to be thesame. pls i need your help on what to do

  256. chris says:

    The installation went well, nice and easy except one thing: I installed phpmyadmin as directed above and the command line reported success, success, success. But when i go to phpmyadmin in my browser, it's not there.
    http://mydomain.com/phpmyadmin doesn't exist.

  257. chris says:

    Linerd, thanks for a prompt answer and solution to my problem. The problem was solved by creating the symbolic link as suggested. Just to point out something i read above about testing.php asking if you want to download or save, that's usually because you've forgotten to re-start apache after installing php!
    As a final note i'd like to say there are many instructions on the internet on how to set up a linux server, this is the most trouble free one, and believe me i must have been through them all in the last week! Thanks for that. If anyone knows an easy install for a hosting panel oh and i need to sort out a mail server now!

  258. Manjith Gambhir says:

    Thanks a lot! It worked like a hot knife thro' butter

  259. Bharath says:

    Thanks alot man.. you are too good..
    thanks alot..
    Bharath Kondi

  260. Edward says:

    I was able to get everything working on with 10.04.1 on my first server.
    I have some directories under /var/www that I can ftp files into with individual user names and passwords.

    but with my second and third servers with 10.04.2 I get error 550 (permission denied) from my gftp client. All permissions on directories and files are the same as previous server.

    With gftp I can log in, but I can not transfer any files I can only see the file I placed there with terminal commands.

    logging in as root gives same error.

  261. Edward says:

    Ok I was stupid. I found the solution.

    By default, users are allowed to download files from FTP server. They are not allowed to upload files to FTP server. To change this setting, you should uncomment the following line:

    #write_enable=YES

    Edward

  262. Jalal says:

    Hello, thanks a lot for the cool tutorial, it is very helpful and effective.

    great work!

  263. Carter J. Draper says:

    Hi,
    I appreciate your tutorial, It is very helpful and direct.

    Your efforts are affecting lives in a positive way

    Keep it up!!!

  264. ventura says:

    sudo apt-get install libapache2-mod-auth-mysql phpmyadmin ... doesnt work anymore ?

    • paradox says:

      I had this same problem. In the synaptic package manager (under system/administration), in repositories under setting activate the universe repository and try again

  265. Rahul says:

    Nice Tutorial

  266. Mav says:

    What does the caret do?

    • Linerd says:

      I think it tells apt-get to select packages by task. The task being "lamp-server". An alternate command that does the same thing is:

      sudo tasksel install lamp-server

      Which in that case the caret isn't needed. This assumes that tasksel has been installed on your system. You can also go into Synaptic and change the setting to "Select packages by task" and then click the box for lamp-server and install it. This option also requires tasksel to be installed. It might already be there by default, but I'm not sure.

  267. chandru says:

    hey i got a problem on after configuring phpmyadmin in terminal ,open the web browser and entered http://localhost/phpmyadmin/ it shows that 404 not found.watz the problem ..reply soon

  268. Sathish says:

    Great Article! It simply worked!

    Thank You :)

  269. jsquared says:

    Thanks for the great tut. Now ... How to set up FTP so that I can maintain website(s) accessible through LAMP. I would like to upload files using FTP from a development PC.
    (I looked through the 362 comments for any mention/link to an FTP setup tut. 1 request for a tut including FTP and 2 other mentions of FTP re: file upload)

  270. steve says:

    Thanks for the great tutorial. I am using this LAMP installation to troubleshoot my Drupal installation to see why I keep getting mysql memory errors. This was much easier than the LAMP installation under Windows.

  271. enrico says:

    thanks you very much for your guide :)

  272. russell says:

    wow, the lamp-server^ script is amazing! :)
    where on earth did you find that out?
    and the rest of the instructions make this so much easier!
    thanks

  273. Habib says:

    Hello,

    Excellent tutorial and quiet easy to execute, however in Ubuntu 11.04 I have a kind of trouble for the Phpmyadmin configuration, but doesn't matter my server is running under 10.04 and worked perfectly fine, I put it there.

    Keep growing Linux community
    Let's work all together!!!!!!

  274. Derick says:

    Nice tutorial. Thanks

  275. Luther Jeke says:

    Thanks a million!!!

    It was really helpful..... keep up the good work...

  276. Crystal says:

    Howdy,

    I do website development, and I prefer my Linux machines, don't get me started on Bill. However, I followed this through but it puts the files in /var/www/ file which can only be access by the root user. Is there some way to have the www file located where it is read/write capable from regular user not the root? If I just don't understand, I will accept that.

  277. John says:

    Really good article! Thank you very much!

  278. Chethan HR says:

    Really a very useful information and it really helpful to create local web page.........

  279. Dhivya says:

    Its was very useful to know how to install and to work through the server...thanks a lot...

  280. Ivan says:

    Just to say thanks, it was soo easy :D

  281. Diwakar says:

    Excellent tutorial....:) Thank you so much....

  282. Hector Henry says:

    I have contact problem i don't have access or permittion to write on the WWW folder, did any body had that problem? and how to solve it please?

  283. Joaquin says:

    Excellent tutorial, it really helped mi :)

  284. Tiyezx says:

    @Hector
    Create the "www" folder in "var". You probably don't have it thus the problem ur experiencing

  285. Shoeab says:

    Im unableto install phpAdmin when im entering this address "http://localhost/phpmyadmin/." im getting this message
    //
    Not Found

    The requested URL /phpmyadmin/ was not found on this server.
    Apache/2.2.16 (Ubuntu) Server at localhost Port 80
    //
    What should i do?
    And if i have to reinstall it how should i ?

  286. alex says:

    thank you very much. It's a really good explanation!

  287. Emmie says:

    Thanks so much for including the part about using space to select an item. I've been trying to do this using a couple of other articles, and as a newbie I simply didn't know this. Rally great article, thanks!

  288. [...] a nice guide for installing and checking a basic LAMP setup on Ubuntu Share this:TwitterFacebookLike this:LikeBe the first to like this [...]

  289. Savio says:

    That was very helpful.Thanks

  290. mofojo says:

    During install I got:
    "Creating config file /etc/php5/apache2/php.ini with new version
    * Reloading web server config apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName"

    Does this mean //localhost is on 127.0.1.1 rather than 127.0.0.1 ?

  291. mofojo says:

    In phpAdmin I also get this error:
    $cfg['Servers'][$i]['tracking'] ... not OK [ Documentation ]
    Tracking: Disabled

    Is that normal?

  292. mofojo says:

    I need a bit of clarification on the /var/www folder.
    Normally this is a folder with root perms that mirrors "/htdocs" (for MAMP and WAMP) or "/public_html/" on linux servers.
    Norrmally one does not put the web page files in /www but in /htdocs or /public_html ... leaving /www to serve the mirrored content.
    Is this not the case with LAMP ?

  293. Leon says:

    Thanks a bunch, great how to =)

  294. Faz says:

    Great and thanks for sharing

  295. Benny LW says:

    Excellent, easy and accurate - good job m8!

  296. Dimitri says:

    Wow, fastest LAMP installation in history. Thanks.

  297. Charlie C says:

    Excellent. This is it! Thank you.

  298. Esi says:

    Excellent Tank You And Kissssss

  299. robert says:

    great tut but i got a problem. i did as it is here, now it says that i got latest version of phpmyadmin, but when i navigate to localhost/phpmyadmin in my browser, i see as follows
    Not Found

    The requested URL /phpmyadmin/ was not found on this server.
    Apache/2.2.16 (Ubuntu) Server at localhost Port 80
    Can you please tell me why is that? help me please

  300. robert says:

    Thank you Linerd for your reply. I selected apache2 during the installation, but i did the instructions sudo dpkg-reconfigure phpmyadmin and reloaded apache with sudo /etc/init.d/apache2 reload and still the same. Everything is installed, but does not work. I am kinda new to ubuntu, maybe it is a wrong directory or something? Thanks again

  301. Patrick says:

    Thanks a lot. Great job. Works perfectly.

  302. Druidtton says:

    A nice trough tutorial.

    Very well explained, and fitting to most flavours of linux.

    I learnt, while at the same time was able to quickly finish the installation process.
    I'm bookmarking this site.

  303. Angelo Russo says:

    Thank you, it worked flawlessy even on LUBUNTU

  304. xirian says:

    Thank you very much
    Can confirm that works even with Lubuntu 11.04

  305. Short and to the point. The simplest LAMP installation i've found so far. It works great for a development box. Thank!

  306. Guillermo says:

    Good! I followed all steps, however i had issues with testing.php file. When i navigate to http://localhost/testing.php the file just downloads. So, PhP is not really interpreting the file?

  307. Guillermo says:

    After cleaning the browser's cache it worked ;)

  308. Al says:

    Worked perfectly for me. Thanks very much.

  309. Zack says:

    Worked great, thanks for the help

  310. mickey says:

    I can feel the true spirit of open source in you. good job!

  311. suman kumar says:

    Worked great, Thanks a lot

  312. karim says:

    Is there any way to install it to usb drive

  313. Robert says:

    I followed this cookbook but the "test php" step failed. Namely, when I browsed to localhost/testing.php I got a blank screen. I found that the permissions on testing.php were 600. When I changed them to 644 it worked. Now I'm not sure if they are supposed to be 644 or if it's supposed to work with 600 permissions and something is wrong with my installation.

    • Linerd says:

      On my system, the test.php file already was set to 644 permissions. When I changed the permissions to 600, I also got a blank screen. I believe that permissions of 644 are correct.

  314. Shimba says:

    Thanks a million worked great

  315. maali says:

    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

  316. ccbogel says:

    The installation worked smoothly as exactly as shown. I installed on Ubuntu 11.10 Oneric

  317. shailendra says:

    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...!

    • Linerd says:

      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?

    • pemborsky says:

      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.

  318. jephath says:

    Installation worked smoothly, thanks.

  319. Prasanth says:

    Installation worked very Smoothly Thanks...

  320. Great tutorial.. works all through..

  321. Takis says:

    Very good guide. No problem during installation. Thanks a lot!

  322. Zen420 says:

    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

  323. Zen420 says:

    *Solved.. I just re-installed MySQL...

  324. Jim81 says:

    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.

  325. shimba says:

    Thanx a million Linerd its real a timeserver, it has worked for me more than once.

  326. 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.

  327. Gary Rubin says:

    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.

  328. Avinash says:

    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

  329. Avinash says:

    now it says
    "apache2:Could not reliably determine the server's fully qualified domain name"

  330. Avinash says:

    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

  331. Laurence says:

    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

  332. Laurence says:

    and evidently I also need to get the hang of html tags...

  333. Danny says:

    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

  334. Hellen says:

    Hi. Thank you so much. It worked for me. all configured and tested with a single command line.

  335. NeptuneUK says:

    Installed on Ubuntu 11.04 - the Natty Narwhal.......... worked perfectly! Thx! :-)

  336. zl3349 says:

    thank YOU!!

  337. Alfonso Calvo says:

    Very useful article, thank you very much.

  338. blueber says:

    loveit!!!! thanks work like a charm

  339. Jeoffrey Stiernon says:

    It just does it ! Cool !

    Next step --> the apache conf. ;-)

  340. nikhil says:

    THANKS......SIMPLE AND VERY USEFULL.

  341. NIKHIL says:

    THANKS,.........

  342. sassou says:

    thanks, perfect tuto!

  343. Ges says:

    You have saved me a lot of time and effort. I used to install everything manually and was not aware of the auto command. Your instructions are extremely clear.
    Thank you very much.

  344. TheStank says:

    This was brilliant, thanks a lot :) .

    My VPS doesn't have a GUI so I installed Lynx to perform the tests. Lynx is a command line, text based browser.

  345. Kat says:

    Worked a charm. Thank you so much!

  346. bob says:

    Works great on 11.10 as well. Thanks!

  347. pit says:

    Thank U! Very good explanation! Thumbs Up!

  348. Lah says:

    Thank a lot, Very good explanation. It woks perfectly.

  349. Fon says:

    thank you, the tutorial is perfect, ubuntu 10.04!
    now how can I update the phpmyadmin version?
    can I configure a dyndns.org to my address?

    thank you again! :)

  350. erdal says:

    perfect and clear explaining :D D

  351. xisco says:

    thanks a lot!

  352. urbanCMS says:

    Works perfectly.
    Thanks

  353. corvazo says:

    Don't leave field blank when it asks password for mysql: it's necessary! without pass for 2 times I got error during phpmyadmin login. At the 3rd time I put same password for both and now finally it's work!

  354. ToniRivera says:

    Thanks a lot for your work

  355. MaxPayne says:

    thanks a lot!

  356. Pavan Naidu says:

    Thanks a lot its awsome

  357. hicham says:

    merci monsieur !

  358. chima says:

    this site was really a helpful guide to me. thanks

  359. Coleen says:

    Thank you.

  360. Johnny says:

    Thanks, it works perfect.

  361. Andrew says:

    Thanks a bunch!! You made it a cinch for this Ubuntu newb!

  362. ken says:

    thank you

  363. abraham says:

    Thanks a Lot

  364. dever says:

    Thank you for putting this together. Works perfectly!

  365. homina says:

    Thanks a lot.....

  366. zoe says:

    Just what I was looking for. Thanks.

  367. Rajgopal H.G. says:

    Excellent documentation.
    Even a kid can install LAMP server by reading this document.
    Thanks for your efforts.

  368. Stormy says:

    Wow am I glad I came upon this doc. it was excellent and painless, a job well done in putting this together.

  369. yasin says:

    thanks alot for guiding me to install lamp.....
    and to configure it

  370. Freddy says:

    I cannot seem to install the phpmyadmin.
    The error message I get is
    $ sudo apt-get install libapache2-mod-auth-mysql phpmyadmin
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package phpmyadmin

    I get this even if I do sudo apt-get update

    Any help as to how I can install phpmyadmin would be great.

    • Linerd says:

      The package database may be in the midst of an update. You could wait and try again later, or you could try changing your software sources to a different mirror. For example, if your system is set to load packages from the Ubuntu Main server, try changing to the Server for The United States. Then of course do another update before you try the install.

  371. Gi says:

    THANKS !!!

  372. Gerald says:

    Saved a lot of time. I've always installed the stack manually! A simple claret (^) makes all the difference - and I don't mean the drink!
    Thank you very much for your expertise.
    Gerald.

  373. paopaomj says:

    Thanks a lot!!! :-D

  374. maor says:

    Not working :(

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package lamp-server

    Why...?

    • Linerd says:

      Make sure to include the ^ at the end of the command. The command should be

      sudo apt-get install lamp-server^
      • maor says:

        yep, I did that... How to add/change resources/servers for download?

        • Linerd says:

          You can change your servers from Synaptic. Open the Synaptic Package Manager and go to Settings->Repositories. In that menu there is a drop-down list labelled Download from:. The choices there are: Main server, Server for United States, Other. The "Other" list will give you a choice of all available mirrors for the repositories. When you use the "Other" option, there is also a button to Select Best Server. That will figure out the fastest server for your location.

          After selecting a new server you'll need to update your package lists. Either hit "Reload" from the main Synaptic window or from the command line:

          sudo apt-get update

          Then try the LAMP install again.

  375. Izak says:

    The best step by step configuration document I have ever come across, thanks for the work it was simply brilliant and easy to follow.

  376. Varun says:

    I'm new to linux and i think this was the easiest installation procedure i came accross. thanks!

  377. Marcos says:

    Nao esta funcionando comigo segue o erro:
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

  378. debasish dey says:

    thank you for suggestion about installation command regarding lamp server. it is marvelous.

  379. Saulo Stopa says:

    Great post, I did make the configuration on Amazon EC2. And all steps executed perfectly.
    Thank you!

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>