Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I plan to develop multiple websites using Joomla. I'm using Ubuntu Desktop, and only need to access the sites and configuration files locally, while logged in to my user account.

Previously I tried this using tasksel and set up a LAMP server with files in /var/www, but then encountered problems with developing more than one site, and also permissions issues when editing code like CSS files.

How do I set up multiple Joomla sites, each in its own directory and database, for developing on a local desktop machine? Do I even need directories outside of /home?

Related questions here (simplest way to add & edit files in /var/www) and here (avoid sudo when working in /var/www). This might even be a duplicate of one of those, unless there is a simpler solution for web developers.

share|improve this question
up vote 5 down vote accepted

I would use Name-based Virtual Hosts support in Apache.

First, you need to modify your /etc/hosts file to add some names which resolve to your local loopback interface:       localhost.localdomain   localhost       test1       test2

Then, in your home directory, you create a directory for your sites, say, sites and a sub-directory for each one:

  - test1\
  -- apache_config
  -- www\
  - test2\
  -- apache_config
  -- www\

Each apache_config file would define configuration for each of your virtual hosts:

<VirtualHost *:80>
 ServerName test1
 DocumentRoot /home/username/sites/test1/www

Then you symlink all the configs into /etc/apache2/sites-enabled

ln -s /home/username/sites/test1/www /etc/apache2/sites-enabled/001-test1
ln -s /home/username/sites/test2/www /etc/apache2/sites-enabled/002-test2

Restart Apache.

And that technically should be it - all your sites and their configs are in your home directory, editable by you.

I haven't tested the steps, so it's just a general outline, but that's where I would start. I would avoid placing my work files into /var/www (or using Apache's default virtual host in general), and also I would avoid modifying Apache's main config file (/etc/apache2/apache2.conf) or the default virtual host file (the one in /etc/apache2/sites-enabled/000-default).

share|improve this answer
Thanks Sergey, this is clever. – Tom Brossman Oct 24 '12 at 17:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.