首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >apache安装与配置端口占用

apache安装与配置端口占用

作者头像
西里网
发布于 2025-05-15 10:15:38
发布于 2025-05-15 10:15:38
5030
举报
文章被收录于专栏:西里网CSDN博客西里网CSDN博客
参考资料

  1. apache安装与配置windows
  2. apache的安装
  3. apache是干嘛用的
  4. apache安装与配置
  5. apache安装与配置 linux
  6. apache官网下载
  7. apache和tomcat区别
  8. apache安装与配置idea
  9. 安装Apache:
    • 在Ubuntu/Debian上:sudo apt-get install apache2
    • 在CentOS/RHEL上:sudo yum install httpd
  10. 启动Apache服务:
    • 在Ubuntu/Debian上:sudo systemctl start apache2
    • 在CentOS/RHEL上:sudo systemctl start httpd
  11. 设置Apache开机自启:
    • 在Ubuntu/Debian上:sudo systemctl enable apache2
    • 在CentOS/RHEL上:sudo systemctl enable httpd
  12. 配置端口:
    • 编辑配置文件:sudo nano /etc/apache2/ports.conf(Ubuntu/Debian)或sudo nano /etc/httpd/conf/httpd.conf(CentOS/RHEL)
    • 修改Listen指令后的端口号,例如:Listen 8080
  13. 检查端口占用:
    • 使用命令:sudo netstat -tuln | grep :80(检查80端口)
    • 如果端口被占用,可以更改Apache的监听端口或停止占用端口的服务。
  14. 重启Apache服务:
    • 在Ubuntu/Debian上:sudo systemctl restart apache2
    • 在CentOS/RHEL上:sudo systemctl restart httpd
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2025-05-14,如有侵权请联系 cloudcommunity@tencent.com 删除
目录
  • 参考资料
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档