Author image
Senior Mind

Simple quick ubuntu 8.04 setup as LAMP (couple of drupal "specific" tweaks)

I'm always hunting around for these various bits every time I do an Ubuntu rebuild - so I thought I would collate them all into one place. This is what we use for our dev boxes, not certified for a production webserver. Note this is specifically for Ubuntu 8.04 - it may well apply to other versions of Ubuntu however.

sudo apt-get update<br />
sudo apt-get install mysql-server-5.0<br />
sudo apt-get install apache2<br />
sudo apt-get install php5 libapache2-mod-php5<br />
sudo apt-get install php5-mysql<br />
sudo apt-get install php5-gd<br />
\#enable the rewrite module for clean URLs [EDIT] thanks to Jadwigo for this<br />
a2enmod rewrite <br />
\# optionally install phpmyadmin, some clients like it :)<br />
sudo apt-get install phpmyadmin<br />
sudo ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin<br />
/etc/init.d/apache2 restart<br />
\# we use subversion<br />
sudo apt-get install subversion<br />

Then it's a case of tweaking the vhosts configuration, to make sure AllowOverride is set to All for your DocumentRoot directory, this will enable Drupal's .htaccess file to kick in, and that's it - your should be all set to start developing on your Ubuntu environment


There's a better way to enable modules for apache2 running in ubuntu environments.

The a2enmod / a2dismod commands will enable / disable a module for you.

So running a2enmod rewrite would enable the rewrite module.

I don't think you have to symlink phpmyadmin. Look at /etc/apache2/conf.d/phpmyadmin.conf

The simplest way to do a LAMP setup is to use the server edition and then during install select the LAMP option. Everything will be there, no need for manual install of apache, mysql or php.

Thanks for sharing.

See also which is a wiki page for keeping track of these kinds of things.

Agreed with Marius - the server edition is the easiest way to do this, but we use Ubuntu on our desktops and laptops as our local development environment, so this is really aimed at that :)

The problem I have with these "Server Edition" auto installers for linux is they try to cater for every server... even if you select LAMP the P could be PHP, Python, Perl...

At least with the method suggested above (which sounds like you start with a minimal install) you ONLY install and run the stuff you NEED to run. This is important when you're trying to make the most of your server.

Take a look at my write-up and references at the end.

Victor Kane

Good write up Victor - thanks for that - you could do with turning pathauto on for your awebfactory site though ;)

Your simple, quick and well laid out approach to installing LAMP is quite relevant and helpful. It saved me a lot of valuable time too. Keep it up.

For a quick dev environment check out Turnkey Linux

Everything you need in the ISO, install and start working in minutes (I like to run this as a VM)

the server edition is the easiest way to do this, but we use Ubuntu on our desktops and laptops as our local development environment.


Yup ive found that exexuting a2enmod rewrite does the job

Comments on this article are now closed, if you want to give us feeback you can use our contact form instead.