vhost config with multiple ips?

Discussion in 'Apache' started by carolina-advertising, Feb 16, 2008.

  1. #1
    Hello guys,
    I'm pulling my hair out here.
    I've never had over 1 ip to use over the years. Now I have colo-ed and have 13 ip addresses. I'm not doing something right in apache. I'm getting the wrong site for a differentt ip etc.

    Here is my order of includes...


    Listen xxx.xxx.xxx.xxx:80
    Listen yyy.yyy.yyy.yyy:80

    NameVirtualHost xxx.xxx.xxx.xxx:80
    NameVirtualHost yyy.yyy.yyy.yyy:80


    <vhost1 xxx.xxx.xxx.xxx:80>
    servername name.com

    <vhost2 yyy.yyy.yyy.yyy:80>
    servername name.com

    <vhost3 yyy.yyy.yyy.yyy:80>
    servername name.com

    <vhost4 yyy.yyy.yyy.yyy:80>
    servername name.com


    My thinking is run as many one ip as shared
    and assign certain ips to other domains that needs SSL


    **EDIT
    I need to run around 20 on a shared ip and 2 others on dedicated...
    Can someone point me in the right direction for this setup?


    any suggestions on what i'm doing wrong?
    Thanks,
    ~RD
     
    carolina-advertising, Feb 16, 2008 IP
  2. marksailes

    marksailes Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    every ssl site will need its on ip,

    but you can have many servernames per ip

    so xxx.xxx.xxx.xxx

    can be

    mysite.com
    yoursite.com
    oursite.com

    etc

    each with a different or same location
     
    marksailes, Feb 17, 2008 IP
  3. Host.co.in

    Host.co.in Banned

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello,

    You can assigned 1 IP to many domains as in case of shared servers. You can have many IP's pointing to one website. You can assign dedicated IP to every domain you have with you.
    Thats correct the domain for which you need setup Private SSL, will definitely need an separate IP.

    Please contact me in case you have any more questions.

    Thank you.
     
    Host.co.in, Feb 17, 2008 IP
  4. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #4
    Does your card recognize the IPs as assigned? Do an ifconfig. You may need to alias the extra IPs via the /etc/rc.conf
     
    RectangleMan, Feb 21, 2008 IP
  5. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #5
    Try doing this:

    NameVirtualHost 1.1.1.1

    <VirtualHost site-on-1.1.1.1.com:80>
    <VirtualHost site2-on-1.1.1.1.com:80>

    NameVirtualHost 1.1.1.2

    <VirtualHost site-on-1.1.1.2.com:80>
    <VirtualHost site2-on-1.1.1.2.com:80>
     
    zacharooni, Feb 21, 2008 IP
  6. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Try checking your Apache error log just after a restart. It sometimes spits out errors there that it doesn't spit out in an apache configtest.

    Also, I am assuming that each of your
    servername name.com
    Code (markup):
    lines is actually different.

    i.e
    <VirtualHost xxx.xxx.xxx.xxx:80>
      ServerName name1.com
    </VirtualHost>
    <VirtualHost yyy.yyy.yyy.yyy:80>
      ServerName name2.com
    </VirtualHost>
    <VirtualHost yyy.yyy.yyy.yyy:80>
      ServerName name3.com
    </VirtualHost>
    <VirtualHost yyy.yyy.yyy.yyy:80>
      ServerName name4.com
    </VirtualHost>
    
    Code (markup):
    If all of this is correct, make sure that name2.com, name3.com and name4.com actually resolve to yyy.yyy.yyy.yyy and not xxx.xxx.xxx.xxx and that name1.com resolves to xxx.xxx.xxx.xxx and not yyy.yyy.yyy.yyy.
     
    Ladadadada, Feb 22, 2008 IP