Unlimited Domains on Single Dedicated Server

Discussion in 'Site & Server Administration' started by Xangis, Mar 6, 2007.

  1. #1
    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...
     
    Xangis, Mar 6, 2007 IP
  2. shade88

    shade88 Peon

    Messages:
    138
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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):
     
    shade88, Mar 6, 2007 IP
  3. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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):
     
    Pat Gael, Mar 6, 2007 IP
  4. Xangis

    Xangis Active Member

    Messages:
    182
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    78
    #4
    Thank you, both of you. That's exactly what I was looking for.
     
    Xangis, Mar 6, 2007 IP