apache安装与配置端口占用
参考资料
安装Apache:
在Ubuntu/Debian上:
sudo apt-get install apache2在CentOS/RHEL上:
sudo yum install httpd启动Apache服务:
在Ubuntu/Debian上:
sudo systemctl start apache2在CentOS/RHEL上:
sudo systemctl start httpd设置Apache开机自启:
在Ubuntu/Debian上:
sudo systemctl enable apache2在CentOS/RHEL上:
sudo systemctl enable httpd配置端口:
编辑配置文件:
sudo nano /etc/apache2/ports.conf(Ubuntu/Debian)或sudo nano /etc/httpd/conf/httpd.conf(CentOS/RHEL)修改
Listen指令后的端口号,例如:Listen 8080检查端口占用:
使用命令:
sudo netstat -tuln | grep :80(检查80端口)如果端口被占用,可以更改Apache的监听端口或停止占用端口的服务。
重启Apache服务:
在Ubuntu/Debian上:
sudo systemctl restart apache2在CentOS/RHEL上:
sudo systemctl restart httpd
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。
本文来自《西里网 . 宝塔 | 西里网》 -- 发布时间:2025-03-29
本页链接:https://bt.ciilii.com/show/news-319.html
原创声明:本篇文章均为西里网原创,由《DeepSeek-R1 模型》自动生成。内容真实性仅供参考学习。
本作品采用 知识共享署名—非商业性使用—相同方式共享 4.0 国际许可协议 (CC BY-NC-SA 4.0) 进行许可。
