LAMP install on ubuntu hardy

On 18 April 2008, in applications, config, by ayoli

Here is the apt-get command to install a basic lamp environment on ubuntu hardy 8.04 with some “quick start help” commands.

First,

sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server php5-gd phpmyadmin

This will install apache 2 php 5.2 and mysql server 5 and their dependencies. The deamons are launched at install and basically, only apache2 needs a bit of configuration.

To enable ~/public_html user folder (which you reach in a browser with this URL : http://localhost/~username) do :

sudo a2enmod userdir && sudo /etc/init.d/apache2 restart

The default document root is /var/www (you need superuser privileges to write in this directory), but you can add more sites. Edit a new configuration file for the new site :
gksudo gedit /etc/apache2/sites-available/<site_name>

Replace with whatever you want. Add virtual host properties and directives that you need, then save and exit gedit.
To enable this new site do :
sudo a2ensite <site_name> && sudo /etc/init.d/apache2 restart

To manage mysql users and database, simply use phpmyadmin by entering this url in your browser : http://localhost/phpmyadmin

The php config file is located at : /etc/php5/apache2/php.ini and requires a restart of apache if you make any change in it.

Tagged with:  

8 Responses to “LAMP install on ubuntu hardy”

  1. Matt says:

    Wow, this saved me. It’s been a long time since I’ve had to install an ubuntu server w/ desktop environment and could’t remember how I got LAMP on the desktop version. Thanks, much appreciated.

  2. ayoli says:

    Glad it helps ya :)

  3. Charlie says:

    Thanks for this. I was in the same boat as Matt after doing a fresh install of Kubuntu 8.04 for my home server. Much appreciated.

  4. ayoli says:

    You’re most welcome

  5. oddalot says:

    If the 127.0.0.1/phpmyadmin is giving you 404, try creating a link to /usr/share/phpmyadmin

    type this in console: sudo ln -s /usr/share/phpmyadmin phpmyadmin
    worked for me :D

  6. ayoli says:

    Requesting http://localhost/phpmyadmin should work for everyboby.
    Otherwise, I’d rather link /usr/share/phpmyadmin in /var/www

  7. joanindo says:

    tasksel is your friend if you wanna do all these stuffs, and not only that
    it will give you a lot of options from setting up a server service like: DNS, Mail, Samba, etc. to Ubuntu Studio …
    just make sure your connection is broadband.
    choose a mirror close to you before you do this.
    i assume you already installed ubuntu desktop in your box so you can
    change the package repositories easily from the administration menu.
    then you may type: sudo tasksel

    hope it helps

  8. [...] Continued here: ayozone " Blog Archive " LAMP install on ubuntu hardy [...]

Leave a Reply

Free WordPress Themes

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!