Server Fault is a question and answer site for system and network administrators. 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 have Rails installed for, however, I want to use WordPress for my blog as well. So I want to be WordPress. The problem is, I want to have WordPress in a separate directory from the Rails, such as /srv/www/example-wp and have Rails in /srv/www/example-ruby. How can I separate this? I think it has something to do with virtual hosts, but I am unsure how this is supposed to work.


<VirtualHost ip:80>
     DocumentRoot /srv/www/example-ruby/public/

Alias /blog /srv/www/example-wp/public/

<Directory /srv/www/example-wp/public/>
        AllowOverride all
        Order allow,deny
        Allow from all

     <Directory /srv/www/example-ruby/public/>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
share|improve this question
up vote 1 down vote accepted

You are looking for the "Alias" function in Apache.

The Alias function allows you to "map" users to a sub-directory outside of the document root.

You would use it like so:

Alias /blog /srv/www/example-wp

share|improve this answer
I tried adding that to my virtual hosts, but when visiting the URL, Rails just says The page you are looking for doesn't exist. – Doug Aug 16 '12 at 1:31
@Doug Make sure that mod_alias is enabled... "a2enmod alias" – Soviero Aug 16 '12 at 5:15
It says already enabled, and I even did apache2 -M to make sure it's enabled. Is there something I could have missed? – Doug Aug 16 '12 at 8:11
I see that my phpmyadmin Alias is working, but not the one I setup. Is there any reason why it might not work with ServerName or in the sites-available directory? – Doug Aug 16 '12 at 8:37
I figured it out. You HAVE to use PassengerEnabled off in the directory when using Alias in Apache. Otherwise it will not work. – Doug Aug 16 '12 at 8:42

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.