我需要一些帮助来设置这个东西。
我遵循了有关在WAMP中设置虚拟主机的教程,其中包括以下步骤:
在文件夹httpd.conf
中打开文件C:\wamp\bin\apache\apache2.2.6\conf
并取消注释以下语句的最后一个#:
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf"
看起来像这样:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
打开文件夹httpd-vhosts.conf
中的文件C:\wamp\bin\apache\apache2.2.6\conf\extra
,删除了其中的所有内容,并替换为以下代码:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.jagerseow.servegame.com (WHICH IS A DOMAIN A REGISTERED IN NO-IP)
ServerAlias jagerseow.servegame.com domain
DocumentRoot C:/wamp/www/MP4Public
ErrorLog "C:/wamp/www/MP4Public/logs/error.log"
CustomLog "C:/wamp/www/MP4Public/logs/access.log" common
</VirtualHost>"
<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
ErrorLog "C:/wamp/www/logs/error.log"
CustomLog "C:/wamp/www/logs/access.log" common
</VirtualHost>
使用记事本在服务器计算机上的文件夹hosts
中打开文件C:/Windows/System32/drivers/etc
;然后,使用以下代码删除并替换默认代码:
127.0.0.1 localhost
127.0.0.1 domain
重新启动WAMP并等到它变为绿色,它确实......
我正在运行Windows Vista 32位。任何人都可以告诉我我做错了什么?
答案 0 :(得分:0)
将虚拟主机定义更改为: -
NameVirtualHost *:80
## must be first so the the wamp menu page loads
## and stray hacks get sent here and ignored because access
## is only allowed from local ips (127.0.0.1 localhost ::1 )
<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "C:/wamp/www">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.jagerseow.servegame.com
ServerAlias jagerseow.servegame.com
DocumentRoot "C:/wamp/www/MP4Public"
# changed, dont want your logs available under your docroot directory (security)
ErrorLog "C:/wamp/www/logs/MP4Public_error.log"
CustomLog "C:/wamp/www/logs/MP4Public_access.log" common
<Directory "D:/wamp/www/MP4Public">
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>"
现在您需要将主机文件更改为: -
127.0.0.1 localhost
127.0.0.1 jagerseow.servegame.com
更改后,执行以下操作或重新启动。
运行命令窗口Run as Administrator
并执行
net stop "DNS Client"
net start "DNS Client"
这将强制刷新DNS缓存并在您的PC上提供新的域名。
主机文件由Windows加载到其DNS缓存中。它预加载网址,有点像一个非常低功能的DNS。所以这告诉dns缓存,因此告诉您的浏览器等jagerseow.servegame.com
在IP地址127.0.0.1
上找到this PC
如果您确实希望Universe能够看到此站点,我假设您使用Allow from all
,那么您必须将路由器上的端口80转发到PC的IP地址运行wamp。此外,PC将需要一个STATIC IP地址,以便在重新启动时不会更改。可以在此处找到帮助PortForward.com