估计你修改的有问题,你再仔细看看
1
找到C:\Windows\System32\drivers\etc 下的
hosts文件
增加以下代码:
127.0.0.1 localhost
127.0.0.1 localhost:8080
2
找到c:\xampp\apache\conf 下的
httpd.conf
将Include conf/extra/httpd-v前面的#去掉变成
Include conf/extra/httpd-vhosts.conf
增加两行代码
Listen 8080
NameVirtualHost localhost:8080
3
找到c:\xampp\apache\conf\extra下的
httpd-vhosts.conf增加代码
DocumentRoot "c:/xampp/htdocs"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
Options Indexes FollowSymLinks
DirectoryIndex index.html index.php
AllowOverride all
Order allow,deny
Allow from all
DocumentRoot "c:/xampp/htdocs/tpshop"
ServerName localhost:8080
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
Options Indexes FollowSymLinks
DirectoryIndex index.html index.php
AllowOverride all
Order allow,deny
Allow from all
4
重启Apache
5
地址栏输入
localhost可以访问xampp
地址栏输入
localhost:8080
可以访问tpshop