详细步骤参考:小左先森的博客
centos7.0在命令上与之前大不一样,现在码写常用的操作httpd的命令 第一、启动、终止、重启
systemctl start httpd.service #启动 systemctl stop httpd.service #停止 systemctl restart httpd.service #重启
第二、设置开机启动/关闭
systemctl enable httpd.service #开机启动 systemctl disable httpd.service #开机不启动
第三、检查httpd状态
systemctl status httpd.service
1、 在启动apache 时出现
Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details …
解决:首先 systemctl status httpd查看下状态,然后根据状态显示,解决问题,一般要么是配置文件有语法错误,要么就是端口问题没解决等等。
检查配置文件出错的方法: 首先找到 检查程序的位置 :
find / -name apachectl
结果如下,一般默认的都是这个位置:
/usr/sbin/apachectl
然后运行:
/usr/sbin/apachectl -t
我在配置虚拟主机时,配置文件出现如下错误:
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.17.15.244 Set the ‘ServerName’ directive globally to suppress this message
解决:在httpd.conf文件里面将下面这句的注释去掉
#ServerName www.example.com:80
1、设置简单密码时发生的错误
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
解决:修改两个全局参数: 先执行
set global validate_password.policy=0;
再执行
set global validate_password.length=1;
更详细的解释参见:~~ 搞定!
后面继续更新。。。。。