我如何设置我的wamp服务器从Intranet访问虚拟主机?
问题描述:
我有一些虚拟主机,我可以在装有服务器的PC上访问它。但我有其他个人电脑,我想通过域名访问。我如何设置我的wamp服务器从Intranet访问虚拟主机?
我只能访问服务器配置页面,将语句“Require local”更改为“Require all granted”。这只允许我通过IP地址访问。
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp64/www
<Directory "D:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName laravel5.1.app
DocumentRoot "d:/wamp64/www/laravel5_1/public"
<Directory "d:/wamp64/www/laravel5_1/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
答
要使用您的域名访问站点,您必须告诉每个其他PC在哪里可以找到域名。
所以,你要么需要一个本地DNS服务器,或者您编辑HOSTS要加入这样的事情在其他电脑HOSTS
192.168.1.100 laravel5.1.app
假设你WAMPServer(从访问网站每台PC上的文件Apache)运行在IP地址192.168.1.100
感谢@RiggsFolly,如您所说,我必须安装Dns服务器而不是编辑所有主机文件。我安装了运行在Windows 10上的Simple DNS Plus。你有其他的选择,没有成本吗? – juanmiguel431