Need help adding multiple domains

Discussion in 'Site & Server Administration' started by Ruriko, Jun 28, 2009.

  1. #1
    I have a vps and I'm using webmin. I was able to setup the dns and domain but the problem is when I add a 2nd domain it gets redirected to my main domain. Anyone know what I'm doing wrong?
     
    Ruriko, Jun 28, 2009 IP
  2. vasyl

    vasyl Peon

    Messages:
    138
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Didn't your forgot to create apache virtual server for the new domain?
     
    vasyl, Jun 29, 2009 IP
  3. Ruriko

    Ruriko Well-Known Member

    Messages:
    4,023
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #3
    I already have made a virtual server for the new domain but it still gets redirected to the main domain
     
    Ruriko, Jun 29, 2009 IP
  4. RoseHosting

    RoseHosting Well-Known Member

    Messages:
    230
    Likes Received:
    11
    Best Answers:
    11
    Trophy Points:
    138
    #4
    Please follow the steps below to create a virtual host using Webmin:

    Open your Webmin control panel -> Servers -> Apache WebServer -> Create virtual host.

    Select 'Any Address' in the 'Handle connections to address' section.

    Enter 80 for Port (and select the last radio button).

    Enter the location where your website files will be in the 'Document Root' field (e.g. /home/your_user/your_domain.com/)

    Enter your domain name in the 'Server Name' field (and select the last radio button).

    Click 'Create Now'.

    Go back to 'Apache Webserver' and click 'Apply Changes' link located on the top right side of the screen for the changes to take effect.
     
    RoseHosting, Jun 30, 2009 IP
  5. Ruriko

    Ruriko Well-Known Member

    Messages:
    4,023
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #5
    That doesn't work it gets redirected to my main domain
     
    Ruriko, Jun 30, 2009 IP
  6. encep

    encep Peon

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    check your httpd.conf
    make sure this correct
    example:
    <VirtualHost 10.1.2.3> => your server IP
    ServerAdmin webmaster@blablabla => your serveradmin email address
    DocumentRoot /www/docs/host.foo.com => your domain document location!
    ServerName host.foo.com => your domain
    </VirtualHost>

    For more httpd.apache.org/docs/1.3/mod/core.html#virtualhost
     
    encep, Jul 3, 2009 IP
  7. thuankkk

    thuankkk Active Member

    Messages:
    503
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    95
    #7
    You can upload your httpd.conf here, and someone will see it.

    Btw, here's my way to add domain name to VPS:
    - Set nameserver to everydns.net
    - Use everydns.com to add A record yourdomain.com, www.yourdomain.com, *.yourdomain.com to your VPS server, e.g 11.22.33.44
    - Config your httpd.conf file, plz remember these values:
    
    Listen 11.22.33.44:80
    <VirtualHost 11.22.33.44:80>
      ServerName yourdomain.com
      ServerAlias *.yourdomain.com
      DocumentRoot /var/www/yourdomain
    </VirtualHost>
    
    Code (markup):
    Make sure there's no .htaccess file that affect directory /var/www/yourdomain

    To add one more domain name, simply add another VirtualHost block with 11.22.33.44:80


    Hope this help.
     
    thuankkk, Jul 3, 2009 IP