Configuration 配置虚拟主机时出现问题
一些细节Configuration 配置虚拟主机时出现问题,configuration,xampp,virtualhost,Configuration,Xampp,Virtualhost,一些细节 XAMPP 1.7.1 在vista和xp上测试的操作系统 大家好。我在配置虚拟主机时遇到一些问题。 目前我有两个网站 这是我的vhost.conf文件: <VirtualHost *:80> ServerAdmin me@site.nl DocumentRoot c:/xampp/htdocs/site1/trunk/ ServerName site1.local </VirtualHost> <VirtualHost *:
- XAMPP 1.7.1
- 在vista和xp上测试的操作系统
<VirtualHost *:80>
ServerAdmin me@site.nl
DocumentRoot c:/xampp/htdocs/site1/trunk/
ServerName site1.local
</VirtualHost>
<VirtualHost *:80>
ServerAdmin me@site.nl
DocumentRoot c:/xampp/htdocs/site2/trunk/
ServerName site2.local
</VirtualHost>
我多次重启apache和浏览器
我的问题是:
工作。但是当我去的时候,我在site1.local着陆
有什么想法吗?试试看
<VirtualHost "site1.local">
ServerAdmin spam@a1230912##ad#.nl
DocumentRoot c:/xampp/htdocs/site1/trunk/
ServerName site1.local
</VirtualHost>
<VirtualHost "site2.local">
ServerAdmin spam@a1230912##ad#.nl
DocumentRoot c:/xampp/htdocs/site2/trunk/
ServerName site2.local
</VirtualHost>
到
在您的httpd.conf中
126 # Listen: Allows you to bind Apache to specific IP addresses and/or
127 # ports, in addition to the default. See also the <VirtualHost>
128 # directive.
129 #
130 # Change this to Listen on specific IP addresses as shown below to
131 # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
132 #
133 Listen 127.0.0.1:80
134 NameVirtualHost 127.0.0.1
我说(/etc/httpd/conf/httpd.conf)
126#Listen:允许您将Apache绑定到特定的IP地址和/或
127个端口,除了默认端口。另见
128#指令。
129 #
130#将此更改为侦听特定IP地址,如下所示
131#防止Apache欺骗所有绑定的IP地址(0.0.0.0)
132 #
听127.0.0.1:80
134名称虚拟主机127.0.0.1
我的vhost文件
<VirtualHost "www.whatever.com">
DocumentRoot /var/www/html/whatever/pub
ErrorLog logs/error_log
ServerName www.whatever.com
...
DocumentRoot/var/www/html/whatever/pub
错误日志/错误日志
服务器名www.whater.com
...
您使用的是什么apache版本?请删除本文中的电子邮件地址,因为它们不相关。感谢删除的电子邮件,完成了对NameVirtualHost的编辑。别担心,我想spambots没看见你:呸;-)Apache版本:2.2.11找不到#NameVirtualHost*:80。将其添加到底部。重新启动apache。重新启动浏览器。没有结果您是否删除了“#”字符?此vhost.conf和httpd.conf是否相同?
NameVirtualHost *
126 # Listen: Allows you to bind Apache to specific IP addresses and/or
127 # ports, in addition to the default. See also the <VirtualHost>
128 # directive.
129 #
130 # Change this to Listen on specific IP addresses as shown below to
131 # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
132 #
133 Listen 127.0.0.1:80
134 NameVirtualHost 127.0.0.1
<VirtualHost "www.whatever.com">
DocumentRoot /var/www/html/whatever/pub
ErrorLog logs/error_log
ServerName www.whatever.com
...