I'm considering moving from shared hosting to a self-managed dedicated server at some point in the near future. I have a ton of Linux experience (everything EXCEPT domain management though). Right now I own around 30 or so domains that I'd have to move. What do I need to read up on to know how to set up a server so that I can attach any number of domains such that: domain1.com document root = /home/www/domain1 domain2.com document root = /home/www/domain2 domain3.com document root = /home/somewhere_else/something Tell me what I need to learn. I have no idea whether this is part of the operating system, or something you do with DNS/bind or Apache settings, or something else entirely. Please point me in the right direction and I'll be happy to do the research...
If you don't have control panel like plesk or cpanel, you set it manually on apache config. Something like this: <VirtualHost xxx.xxx.xxx.xxx:80> ServerName yourdomain.com DocumentRoot "/home/pathyouwant" ServerAlias www.yourdomain.com <Directory "/home/pathyouwant"> Options ExecCGI FollowSymLinks Includes Allow from all Order allow,deny AllowOverride All IndexOptions +FancyIndexing NameWidth=* </Directory> </VirtualHost> Code (markup):
Tecnically you can do it editing httpd.conf as shade88 explained or you can do it the tricky way via .htaccess pointing each domain to their corresponding directory. RewriteEngine On RewriteCond %{HTTP_HOST} domain1.com$ [NC] RewriteCond %{REQUEST_URI} !^/home/www/domain1/.*$ RewriteRule ^(.*)$ /home/www/domain1/$1 RewriteCond %{HTTP_HOST} domain2.com$ [NC] RewriteCond %{REQUEST_URI} !^/home/www/domain2/.*$ RewriteRule ^(.*)$ /home/www/domain2/$1 Code (markup):