我更改了wamp的vhosts
文件,以允许网络上的其他人访问在wamp的www目录中构建和设置的angular应用程序。这是脚本:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require ip 192.168.10
Require ip 192.168.0
</Directory>
</VirtualHost>
#dev.local
<VirtualHost *:80>
ServerAdmin ali@ali.com
DocumentRoot "${INSTALL_DIR}/www/dev/"
ServerName dev.local
ServerAlias www.dev.local
<Directory "/">
Allow from 127.0.0.1
Allow from 192.168.10
#Require local
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName angular
DocumentRoot "c:/wamp64/www/angular"
<Directory "c:/wamp64/www/angular/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require all granted
</Directory>
</VirtualHost>
在其他计算机上,人们无法通过键入以下内容来访问该文件夹:
角度/
或
dev.local
或
192.168.10.1
请注意,dev.local
是使用angular
作为服务器名称的angular项目的服务器脚本。