How to set up Virtual Hosts for IP-based site?
link
My vhost file: /etc/httpd/conf.d/vhost.conf
NameVirtualHost 173.230.154.x1:80
NameVirtualHost 173.230.156.x2:80
ServerName domain1.com
ServerAlias
DocumentRoot /srv/www/domain1.com/public_html/
ErrorLog /srv/www/domain1.com/logs/error.log
CustomLog /srv/www/domain1.com/logs/access.log combined
ServerName domain2.com
ServerAlias
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
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.
See
@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.:?