我有一台运行Apache 2的CentOS 7服务器,并试图托pipe2个站点。 我的两个域名被指向IP 70.61.231.8的服务器。
verizondecom.com windstreamdecom.com
在服务器上,我为每个站点设置了一个虚拟主机。
NameVirtualHost *:80 <VirtualHost *:80> ServerName windstreamdecom.com ServerAlias www.windstreamdecom.com ErrorLog /var/log/httpd/windstreamdecom.err CustomLog /var/log/httpd/windstreamdecom.log combined DocumentRoot /var/www/windstreamdecom/public SetEnv ENVIRONMENT "production" <Directory "/var/www/windstreamdecom/public"> AllowOverride ALL Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> <VirtualHost *:80> ServerName verizondecom.com ServerAlias www.verizondecom.com ErrorLog /var/log/httpd/verizondecom.err CustomLog /var/log/httpd/verizondecom.log combined DocumentRoot /var/www/www.verizondecom.com/public SetEnv ENVIRONMENT "production" <Directory "/var/www/www.verizondecom.com/public"> AllowOverride ALL Order allow,deny Allow from all Require all granted </Directory> </VirtualHost>
当我input域名时,我得到第一个Vhost(Windstream)。 浏览器中的URL也会更改为服务器的IP地址。
我在这里错过了什么? 我需要能够访问这两个网站,而URL应该是主机名,而不是IP。
你有你的apacheconfiguration下面的?
NameVirtualHost *:80
*:80部分需要匹配您在<VirtualHost *:80>部分中使用的部分。
也是删除的默认configuration? `