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 am trying to figure out the best way to host multiple domains on my Ubuntu server. I have tried multiple options, but I can't get everything to work the way I want it to.

I want to be able to add domains without having to restart Apache each time. I tried using mod_vhost_alias (see below), but that maps www.domain.com and domain.com to different folders.

I also need to be able to use mod_rewite to map requests for domain.com/app/* to domain.com/somescript.php

current httpd.conf: UseCanonicalName Off VirtualDocumentRoot /var/www/%0

Any thoughts?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Why can't you add all the domains that you require and then restart apache gracefully- almost all users would not notice this. It would be worth keeping separate vhost files for each domain to keep the configuration clean.

share|improve this answer
    
Yeah. I think this is probably the best way. I like things clean with granular control. Thanks. –  markle976 Apr 23 '10 at 19:53

I tried using mod_vhost_alias (see below), but that maps www.domain.com and domain.com to different folders.

One way around this is to symlink the second directory to the first one.

share|improve this answer

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.