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

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.
[term]sudo apt-get install lamp-server^[/term]
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:

[term]sudo nano /var/www/testing.php[/term]

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

[term]<?php phpinfo(); ?>[/term]

Next, restart Apache with the following terminal command:

[term]sudo /etc/init.d/apache2 restart[/term]

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.

[term]cat /etc/hosts | grep localhost[/term]

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

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

You should see a line that looks like this:

[term]

bind-address		= 127.0.0.1

[/term]

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:

[term]sudo apt-get install libapache2-mod-auth-mysql phpmyadmin[/term]

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.

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

  1. debasish dey

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

    Reply
  2. Marcos

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

    Reply
  3. Izak

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

    Reply
  4. maor

    Not working 🙁

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

    Why…?

    Reply
    1. Linerd Post author

      Make sure to include the ^ at the end of the command. The command should be
      [term]sudo apt-get install lamp-server^[/term]

      Reply
        1. Linerd Post author

          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:
          [term]sudo apt-get update[/term]
          Then try the LAMP install again.

          Reply
  5. Gerald

    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.

    Reply
  6. Freddy

    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.

    Reply
    1. Linerd Post author

      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.

      Reply
  7. corvazo

    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!

    Reply
  8. Fon

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

    Reply
  9. TheStank

    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.

    Reply
  10. Ges

    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.

    Reply
  11. Danny

    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

    Reply
  12. Laurence

    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

    Reply
    1. Linerd Post author

      If you’re familiar with the vi editor, you could try using that instead of nano.
      [term]sudo vi /var/www/testing.php[/term]
      or if you have the GNOME desktop you can use
      [term]gksudo gedit[/term] and then save the file as /var/www/testing.php

      Reply
  13. Avinash

    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

    Reply
  14. Avinash

    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

    Reply
  15. Gary Rubin

    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.

    Reply
  16. Zen420

    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

    Reply
  17. shailendra

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

    Reply
    1. Linerd Post author

      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?

      Reply
    2. pemborsky

      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.

      Reply
  18. maali

    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

    Reply
  19. Robert

    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.

    Reply
    1. Linerd Post author

      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.

      Reply
  20. Druidtton

    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.

    Reply
  21. robert

    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

    Reply
  22. robert

    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

    Reply
  23. mofojo

    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 ?

    Reply
  24. mofojo

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

    Is that normal?

    Reply
  25. mofojo

    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 ?

    Reply
  26. Pingback: Back to a Linux based LAMP server for now « pmcode

  27. Emmie

    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!

    Reply
  28. Shoeab

    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 ?

    Reply
  29. Tiyezx

    @Hector
    Create the “www” folder in “var”. You probably don’t have it thus the problem ur experiencing

    Reply
  30. Crystal

    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.

    Reply
      1. Drew

        What a super How To – Thanks so much.

        Would someone mind linking the referenced post about user privileges for the var/www folder? That’d be super helpful.

        Reply
        1. Drew

          Never-mind, I just changed the permissions on the folder via sudo nautilus, that seems to have had the desired effect. :- )

          Reply
  31. Habib

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

    Reply
  32. russell

    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

    Reply
  33. steve

    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.

    Reply
  34. jsquared

    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)

    Reply
    1. Linerd Post author

      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:
      [term]sudo tasksel install lamp-server[/term]
      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.

      Reply
    1. paradox

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

      Reply
  35. Carter J. Draper

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

    Your efforts are affecting lives in a positive way

    Keep it up!!!

    Reply
  36. Edward

    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

    Reply
  37. Edward

    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.

    Reply
  38. chris

    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!

    Reply
  39. henry

    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

    Reply
  40. mike maxton

    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.

    Reply
  41. Gary

    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”…

    Reply
  42. Mohammed Ghaji

    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.

    Reply
  43. Ted

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

    Reply
  44. Steve

    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 ?

    Reply
  45. Anuj

    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

    Reply
  46. JB

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

    Reply
  47. Philip John

    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.

    Reply
    1. Linerd Post author

      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.
      [term]sudo /etc/init.d/apache2 restart[/term]
      Then clear your browser cache again.

      Reply
  48. Ahmed

    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

    Reply
    1. Linerd Post author

      Try restarting your web browser. If that doesn’t work, you may need to reboot your computer.

      Reply
  49. Anon

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

    Reply
    1. Linerd Post author

      To save the file in nano, just hit [CTRL]+[X] to exit, then just follow the prompts to save it.

      Reply
  50. Petar

    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.

    Reply
      1. Petar

        Thank you this link helps in my case i just need to make
        sudo ln -s /usr/share/phpmyadmin /var/www
        in my case
        gpkg-reconfigure phpmyadmin
        responds with sudo: gpkg-reconfigure: command not found

        Reply
  51. Paul

    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.

    Reply
  52. Crathmel

    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!

    Reply
  53. Stefano

    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?

    Reply
      1. JH

        Ah yes OK thanks, for the next installation I can use that. Just running it nicely now on Windows7/VMWare. I have a hard time reaching the NAT server using Putty. But that’s a whole different story all together.

        Reply
  54. JH

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

    Reply
  55. sarmad

    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

    Reply
  56. Max

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

    Reply
  57. Konstantine

    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

    Reply
  58. Pingback: Finally!! phpmyadmin!! « Nikerdoodle's Blog

  59. dr_no

    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

    Reply
  60. McIyer

    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

    Reply
    1. Linerd Post author

      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?

      Reply
  61. WarriorPoetess

    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

    Reply
    1. Brando666

      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.

      Reply
  62. WarriorPoetess

    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

    Reply
  63. speedy4081

    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

    Reply
  64. mtei

    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?

    Reply
  65. dufftime

    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.

    Reply
    1. Linerd Post author

      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.

      Reply
  66. Robert

    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!

    Reply
  67. Stefan

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

    Reply
  68. hawre

    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

    Reply
    1. Linerd Post author

      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.

      Reply
    2. Brad

      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.

      Reply
  69. ammofreak

    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!

    Reply
  70. Aaron

    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 =-])

    Reply
    1. Linerd Post author

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

      Reply
  71. oem

    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.

    Reply
  72. chitownmgs

    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!

    Reply
  73. renou

    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 …

    Reply
  74. Richard Chan

    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

    Reply
  75. Stephen Owens

    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.

    Reply
  76. Mikhail

    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.

    Reply
  77. Chris O

    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

    Reply
  78. Jerry

    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.

    Reply
  79. cezabs

    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.

    Reply
  80. Steve

    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

    Reply
  81. Glenn

    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!

    Reply
  82. Gert-Jan

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

    Great job!

    Reply
  83. Nippon

    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???

    Reply
      1. Moshe

        Thanks, the guide, (and this little fix for those of us who were silly) is perfect!
        That spacebar (to change the selected area to install to a * is really important)

        Thanks to your effort, I was able to get this setup done in under 20 minutes, after previously spending an hour on a setup that the php didn’t work.

        Reply
  84. Kingsley

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

    All the same. Thanks.

    Reply
  85. Pingback: Gosod LAMP gydag 1 gorchymyn ar Ubuntu « Ubuntu Cymraeg

  86. Biginner

    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.

    Reply
  87. Mark

    Linerd –

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

    Reply
  88. alx

    thanksssssssssss!!!!

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

    [term]sudo ln -s /usr/share/phpmyadmin /var/www[/term]

    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 😛

    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

    [term]cd /var/www/
    sudo mkdir joomlafiles [/term]

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

    now to copy them from the desktop just write

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

    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 😛

    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

    [term]sudo rm -rf /var/www/joomlafiles/installation[/term]

    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 😛

    open the terminal and write

    [term]sudo nano /var/www/joomlafiles/configuration.php-dist[/term]

    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

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

    thanks

    Reply
  89. rey miguel

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

    Reply
  90. Sveinung

    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?

    Reply
  91. Petra

    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.

    Reply
  92. Richard

    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

    Reply
  93. Doug

    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

    Reply
  94. Brad

    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!

    Reply
  95. Vishnu

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

    Reply
  96. John

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

    Reply
  97. Pingback: Drupal 7 on Ubuntu 10.10 or 10.04 for SPARQL federation « Ultan O'Carroll

  98. Ron Mahon

    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

    Reply
  99. steve

    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?

    Reply
  100. Luis

    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?

    Reply
    1. Linerd Post author

      All I can think of is to change the server you are using for updates. Run
      [term]gksu –desktop /usr/share/applications/software-properties-gtk.desktop /usr/bin/software-properties-gtk[/term]
      and choose a different server in the Download from: field.

      Reply
  101. Ian

    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 😀

    Reply
  102. Guppydas

    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.

    Reply
  103. Heath

    I ended up with this error message

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

    Reply
  104. Ricardo

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

    Reply
  105. fernando beltran zamora

    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 !

    Reply
  106. market

    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!

    Reply
      1. Fabio Varesano

        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

        Reply
  107. milad

    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

    Reply
    1. Linerd Post author

      Take another look at the directions. The command is
      [term]sudo apt-get install lamp-server^[/term]
      You have to include the caret (^) in the command for it to work.

      Reply
    1. Linerd Post author

      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.

      Reply
      1. kamchatka

        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.

        Reply
          1. kamchatka

            You deserve a small halo. Thank you very much. I have a couple of friends who want to do this too, I’ll be passing on your article. Appreciated.

  108. mike

    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

    Reply
  109. Arthur Zennig

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

    Reply
  110. reeve24

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

    Reply
  111. Pingback: Make-over : Zoetekouw.com

  112. chunn

    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

    Reply
    1. Linerd Post author

      You can copy files to the /var/www directory as root using sudo.
      [term]sudo cp filename /var/www[/term]
      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:
      [term]sudo chown -R user1:user1 /var/www[term]

      Reply
  113. Matt

    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!

    Reply
  114. Matt

    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?

    Reply
    1. Linerd Post author

      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
      [term]find / -depth -name scripts[/term]

      Reply
  115. Jambal

    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

    Reply
  116. ShowMeGrrl

    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.

    Reply
  117. Mads

    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

    Reply
  118. SIMON

    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.

    Reply
  119. cniv

    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.

    Reply
  120. Scott

    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)

    Reply
  121. Joe

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

    Reply
    1. Linerd Post author

      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.

      Reply
  122. Max

    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?

    Reply
  123. Jas

    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

    Reply
    1. Linerd Post author

      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
      [term]sudo apt-get install curl libcurl3 php5-curl[/term]
      Then, restart Apache with
      [term]sudo /etc/init.d/apache2 restart[/term]

      Reply
  124. Pingback: Instalare LAMP pe Ubuntu 10.04 « Tutoriale Joomla ?i Ubuntu

  125. Jas

    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

    Reply
  126. avatar

    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.

    Reply
  127. Michael

    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!

    Reply
    1. Linerd Post author

      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.

      Reply
  128. George

    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.

    Reply
  129. Jas

    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.

    Reply
      1. Jas

        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.

        Reply
        1. jas

          Ya!!! I solved it. well I search and found the magic spell that worked.

          Edit /etc/phpmyadmin/config.inc.php to point $cfg[‘Servers’][$i][‘tracking’] to the right db by adding this line:

          $cfg[‘Servers’][$i][‘tracking’] = ‘pma_tracking’;

          I put it immediately after the list of settings that contains history, designer_coords, etc.

          Reply
          1. Linerd Post author

            WTF? I don’t think I would have ever figured that out. Good Job!
            Do you have a link to where you found the solution?

    1. Linerd Post author

      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!

      Reply
  130. tweaksource

    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.

    Reply
  131. jas

    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?

    Reply
    1. Linerd Post author

      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.
      [term]sudo dpkg-reconfigure phpmyadmin[/term]
      Keep apache2 selected and tell it to recreate the database when asked. Then reload Apache with
      [term]sudo /etc/init.d/apache2 reload[/term]
      Then clear your browser cache and try again.

      Good luck.

      Reply
  132. jas

    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.

    Reply
  133. jas

    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.

    Reply
  134. jas

    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.

    Reply
    1. Linerd Post author

      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.

      Reply
  135. jas

    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.

    Reply
  136. vj

    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

    Reply
  137. bob

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

    Reply
  138. khublaikhan

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

    Reply
  139. bobot

    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.

    Reply
  140. Pingback: LAMP and Ubuntu « My Name is Joboy

  141. Sean

    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?

    Reply
  142. Richard G

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

    Reply
  143. Kapil

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

    Reply
  144. philip

    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

    Reply
  145. ggerri

    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 🙂

    Reply
    1. Linerd Post author

      Sadly, the Services Manager is gone from Ubuntu Lucid. Searching through the forums, some suggest installing BootUp Manager.
      [term]sudo apt-get install bum[/term]
      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
      [term]sudo service apache2 stop[/term]

      Reply
    1. Linerd Post author

      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.

      Reply
  146. Abera

    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

    Reply
      1. Abera

        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

        Reply
  147. Kosgei

    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.

    Reply
    1. Linerd Post author

      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.
      [term]echo “ServerName localhost” | sudo tee /etc/apache2/conf.d/fqdn[/term]
      Then reload Apache again and the “fully qualified domain name” error should be gone.
      [term]sudo /etc/init.d/apache2 reload[/term]

      Reply
  148. Kosgei

    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”

    Reply
  149. Claes

    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.

    Reply
  150. Massimiliano Beccaria

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

    Reply
    1. Linerd Post author

      Glad you got it working. Another option, rather than removing and reinstalling phpmyadmin, is to reconfigure it with
      [term]sudo dpkg-reconfigure phpmyadmin[/term]
      You can then select apache2. Then just reload Apache with
      [term]sudo /etc/init.d/apache2 reload[/term]
      and you’re all set.

      Reply
      1. little_Phild

        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

        Reply
  151. Thomas Rendleman

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

    Reply
  152. Pingback: L.A.M.P. » Tony Law's Journal -

  153. Chris

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

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

    Thanks again.

    Reply
  154. Patrick

    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

    Reply
  155. Floydian

    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?

    Reply
      1. Floydian

        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 🙂

        Reply
  156. Pingback: Easy LAMP on Ubuntu 10.04

  157. Dr. Mike Hughes

    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

    Reply
  158. Allan

    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!

    Reply
      1. Allan

        the address i’m using is 127.0.0.1, bound to wordpress.localhost in the /etc/hosts file. i get this error when i type in http://wordpress.localhost/. I have already extracted the folders to /home/capsolutions/projects/wordpress and have put the virtual host config in the sites-available, with the sym link in the sites-enabled in the apache2 folder. I also already enabled the rewrite module of apache and restart + reload, still this comes up.

        here’s my vhost config:

        ServerName wordpress.localhost
        ServerAdmin [email protected]
        DocumentRoot /home/capsolutions/projects/wordpress/

        RewriteEngine On

        AllowOverride All
        Order allow,deny
        Allow from All

        Any help would be highly appreciated. thanks! I’ll be checking on the links you gave me. 🙂

        Reply
  159. Siddharth

    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

    Reply
  160. Pingback: Setting Up Ubuntu 10.04 For Local Web Development With LAMP

    1. Linerd Post author

      Denny – You probably forgot to select “apache2” during the phpmyadmin setup. You can re-run the setup with
      [term]sudo dpkg-reconfigure phpmyadmin[/term]
      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.
      [term]sudo /etc/init.d/apache2 reload[/term]

      Reply
  161. Pingback: fsdaily.com

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.