XAMPP中Apache端口冲突

一、Apache服务端口被占用

1、在XAMPP中启动Apache服务发现提示错误,如下图所示。

15:00:37  [Apache] 	Error: Apache shutdown unexpectedly.
15:00:37  [Apache] 	This may be due to a blocked port, missing dependencies, 
15:00:37  [Apache] 	improper privileges, a crash, or a shutdown by another method.
15:00:37  [Apache] 	Press the Logs button to view error logs and check
15:00:37  [Apache] 	the Windows Event Viewer for more clues
15:00:37  [Apache] 	If you need more help, copy and post this
15:00:37 [Apache] entire log window on the forums

15:00:37[apache]错误:apache意外关闭。

15:00:37[apache]这可能是由于端口被阻塞、缺少依赖项,

15:00:37[apache]权限不正确、崩溃或被其他方法关闭。

15:00:37[apache]按logs按钮查看错误日志并检查

15:00:37[apache]Windows事件查看器以获取更多线索

15:00:37[apache]如果需要更多帮助,请复制并发布此

15:00:37[apache]论坛上的整个日志窗口

端口被占用,我们换一个。

二、修改Apache端口

1、修改service and port settings

 

这里我修改为Main Port:801  SSL Port:4430

2、打开Apache的config的httpd.conf文件修Listen字段。

a、修改httpd.conf文件

 Listten 80 改为我们设置的801

b、修改httpd-ssl.conf文件

 

 

 Listen:443修改为我们设置的4430

都修改完成之后,重启Apache服务,点击Start启动成功。

 注意:修改了默认的80端口之后,访问主页需要加上端口。

访问127.0.0.1变成了127.0.0.1:801

如下图所示:127.0.0.1:801/dashboard/

原文地址:https://www.cnblogs.com/1328497946TS/p/11486481.html