开启虚拟主机:
配置本地路由表:C:\Windows\System32\drivers\etc\hosts
apache开启虚拟主机:\wamp\bin\apache\apache2.4.9\conf 514行去掉#号
修改虚拟主机配置:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "D:\wamp\www\composer_tp5\public"
ServerName www.tptest.com
<Directory "D:\wamp\www\composer_tp5\public">
Options Indexes FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
配置本地路由表:C:\Windows\System32\drivers\etc\hosts
apache开启虚拟主机:\wamp\bin\apache\apache2.4.9\conf 514行去掉#号
修改虚拟主机配置:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "D:\wamp\www\composer_tp5\public"
ServerName www.tptest.com
<Directory "D:\wamp\www\composer_tp5\public">
Options Indexes FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
本文介绍如何在本地通过修改hosts文件及Apache配置文件来实现虚拟主机的设置。具体步骤包括:编辑本地路由表、启用Apache虚拟主机功能、配置虚拟主机参数等。
413

被折叠的 条评论
为什么被折叠?



