环境:centos 版本:6.5
/** 使用 mac 终端 **/
1.检测是否已经安装apache : rpm -qa httpd
2.yum安装:yum install httpd
3.安装完成后启动:/etc/init.d/httpd start
4.启动报错:
- Permission denied: make_sock: could not bind to address 0.0.0.0:80
- no listening sockets available, shutting down
- Unable to open logs
5.解决报错方式:
命令行方式:
vi /etc/httpd/conf/httpd.conf
i 进行编辑
找到 #ServerName www.example.com:80
修改为ServerName www.osyunwei.com:80 /**如果没有域名,可以设置为localhost**/
:wq /**保存退出**/
6.设为开机启动:chkconfig httpd on
7.重启apache: /etc/init.d/httpd restart
8.测试是否成功:
访问:localhost:80
根据网上技术文章完成搭建