yum安装的httpd,在配置文件中默认是将 ServerName www.example.com:80 这一行代码注释的,如若开启,则基于域名建立虚拟主机时显示的只有80端口的Index.html主页html
编译安装的httpd,在配置文件中默认也是将 ServerName www.example.com:80 这一行代码注释的,为了使 apachectl 的命令使用取消ServerName提示,能够将该行代码取消注释apache
能够查看 /etc/rc.local 中有木有添加 mount /dev/cdrom /mnt (若是没有自行添加至末尾)vim
增长执行权限 chmod +x /etc/rc.d/rc.local服务器
可重启后验证 yum clean all yum repolist rest
/etc/sysconfig/network-scrips/ 目录下增长的网卡配置文件ifcfg-【网卡名】;已更改的网卡,删除原来的配置文件,从新配置 ;不要出现多余的文件htm
检查 /etc/named.blog
执行 vim /etc/resolv.conf 看看你的 namesever 对应的地址是否是你的服务器解析地址;若是不是的话改为本机解析地址ip
问题缘由:同一台虚机,编译安装和yum安装的Apache同时存在,一旦80端口被一方占用,另外一方没法重启或关闭服务;两种Apache配置文件分别在不一样的路径,使用命令也有所不一样部署
功能 | 编译安装 | yum安装 | 备注 |
开启httpd | apachectl start | systemctl start httpd | |
关闭httpd | apachectl stop | systemctl stop | |
查看httpd状态 | apachectl status | systemctl status httpd | |
检查配置文件错误 | apachectl configtest | httpd -t | |
重启httpd | apachectl restart | systemctl restart httpd |