如何更改xampp的端口
答案:1 悬赏:0
解决时间 2021-01-04 10:00
- 提问者网友:不要迷恋哥
- 2021-01-03 21:48
如何更改xampp的端口
最佳答案
- 二级知识专家网友:山有枢
- 2021-01-03 22:06
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
找到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
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯