How to set up Virtual Hosts for IP-based site?

I followed the tutorial in this link and got one site up(domain1.com). Now, I have two ips. However, the second site has no response. What's wrong with my settings? Are there other things I need to check? Thank you.

My vhost file: /etc/httpd/conf.d/vhost.conf

NameVirtualHost 173.230.154.x1:80

NameVirtualHost 173.230.156.x2:80

ServerAdmin xxx@gmail.com

ServerName domain1.com

ServerAlias www.domain1.com

DocumentRoot /srv/www/domain1.com/public_html/

ErrorLog /srv/www/domain1.com/logs/error.log

CustomLog /srv/www/domain1.com/logs/access.log combined

ServerAdmin xxx@gmail.com

ServerName domain2.com

ServerAlias www.domain2.com

DocumentRoot /srv/www/domain2.com/public_html/

ErrorLog /srv/www/domain2.com/logs/error.log

CustomLog /srv/www/domain2.com/logs/access.log combined

5 Replies

Have you told apache to listen on that IP?

i.e.

Listen 173.230.156.x2:80

Can you ping the ip?

@obs:

Have you told apache to listen on that IP?

i.e.

Listen 173.230.156.x2:80

Can you ping the ip?
Oh, I didn't add new IP to httpd.conf and I couldn't ping it too. Guess this is the problem. Anyway, I will use name-based site first.

Thank you. :wink:

If you cant ping it then you either haven't added it to your network configuration properly or your firewall is blocking it.

See

http://library.linode.com/networking/co … nterfaces/">http://library.linode.com/networking/configuring-static-ip-interfaces/

@obs:

If you cant ping it then you either haven't added it to your network configuration properly or your firewall is blocking it.

See

http://library.linode.com/networking/co … nterfaces/">http://library.linode.com/networking/configuring-static-ip-interfaces/
oops, I didn't do this too. I thought the system automatically have this setup for me. :?

There's a warning on your linode's network page "DHCP will only assign the primary IP address. For multiple IP addresses, you should use a static configuration."

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct