Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following setup in my apache-config:

 <VirtualHost 1.2.3.4:80>

    ServerName   example.com:80
    ServerAlias  www.example.com

    DocumentRoot /var/www/page

    <Location "/blog">

      DocumentRoot /var/www/blog

    </Location>

    RailsBaseURI /
    RailsEnv development

 </VirtualHost>

However,

Apache tells me, I am not allowed to have a second DocumentRoot. How can I make "www.example.com/blog" point to "/var/www/blog"?

I'm sure this is basic, but I just can't find the proper documentation online.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Use

Alias /blog /var/www/blog

instead of the whole <Location> directive.

share|improve this answer
    
Hm yeah that seems to be the right approach. I also added a <Directory> section for that directory, however, the /blog request is still passed on to DocumentRoot directory. Am I missing something? –  scrrr May 16 '10 at 15:19
    
Ah got it. Since the other URL was running Passenger I needed to add a "PassengerEnabled off" and "AllowOverride All" to the <Directory> referenced by Alias. Now it works. Thanks hop! –  scrrr May 16 '10 at 15:21

Your Answer

 
discard

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.