一、各种环境
win10系统,WampServer3
二、具体步骤
首先到官网上下载WampServer并按照步骤安装,运行。
启动所有服务,更改相应配置:
首先右键任务栏中WampServer图标,在Setting中选择Meun item :Online/Offline,然后再左键WampServer图标切换到在线状态。
更改配置文件:
要更改的是Apache服务下的配置文件httpd.conf和httpd.vhosts.conf
httpd.conf中:
更改
<Directory />
AllowOverride none
Require all denied
</Directory>
为
<Directory />
AllowOverride none
#Require all denied
Require all granted
</Directory>
更改
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require all deny
</Directory>
为
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require all granted
</Directory>
httpd.vhosts.conf中:
更改
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all denied
</Directory>
</VirtualHost>
为
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
最后!!!
至关重要的一步
要把windows的所有防火墙的关闭掉才能够用局域网外的机器访问ip地址来访问网站。