一、打开httpd-vhost.conf设置虚拟目录
打开xampp\apache\conf\extra
目录下的httpd-vhost.conf
新增一个虚拟域名
<VirtualHost *:8888>
DocumentRoot "E:/xampp/htdocs/tp6/public"
ServerName tp6.com
</VirtualHost>
二、修改hosts
打开 C:\Windows\System32\drivers\etc
中的host
s文件,添加127.0.0.1
绑定虚拟域名到本地
127.0.0.1 tp6.com
三、监听对应端口
打开Apache的httpd.conf设置监听上面对应的8888
端口, 新增如下
Listen 8888
四、 权限设置
打开Apache config httpd.conf
文件,查找 将原本权限放开;
要支持url rewirte的
目录启用 Options FollowSymLinks
和AllowOverride All
<Directory />
#AllowOverride none
#Require all denied
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>