Webmasters Stack Exchange is a question and answer site for pro webmasters. 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 would like to add to an existing site, which wasn't written in Drupal, a sub site, which is in Drupal. The existing site already has a domain, and this would be a sub domain. I'm using Apache2 and Ubuntu 12.04. How should I do this?

share|improve this question

There are several prerequisites for running Drupal. You can install these with apt-get:

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

Previously installed packages will be skipped.

Unzip Drupal in its own directory. Assuming your top-level site is in /var/www and Drupal is in /var/www/drupal, you would only need to set the $base_url in Drupal's settings.php to the subdirectory, e.g.:

$base_url = 'http://www.example.com/drupal';

If you need to place the Drupal installation outside of the domain's directory, you can add an Alias directive to the top-level domain definition in /etc/apache2/apache2.conf (likely a VirtualHost container). If Drupal is located in /usr/local/drupal, then:

Alias /drupal /usr/local/drupal

This will direct Apache to use the physical directory as a site subdirectory.

share|improve this answer

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.