httpd服务启动失败怎么回事

httpd服务启动失败怎么回事,第1张

主要是由于配置文件错误导致。

[root@csit httpd]# cd

/etc/httpd/conf.d/ #进入配置文件目录

[root@csit conf.d]$ grep NSSEngine * #查找配置选项,并且知道在 nss.conf 这个文件中

nss.conf:NSSEngine on

[root@csit conf.d]$ vi nss.conf

#注释NSSEngine

# SSL Engine Switch:

# Enable/Disable SSL for thisvirtual host.

#NSSEngine on

[root@csit httpd]# service httpd restart

重启服务后正常启动。

报错:

解决方案:

查看80端口是否被占用

[root@web01 ~]# lsof -i:80

COMMAND  PID USER  FD  TYPE DEVICE SIZE/OFF NODE NAME

nginx  6751 root    6u  IPv4  35889      0t0  TCP *:http (LISTEN)

nginx  6752  www    6u  IPv4  35889      0t0  TCP *:http (LISTEN)

可见被nginx占用,打开httpd配置文件修改端口

[root@web01 ~]# vim /etc/httpd/conf/httpd.conf

搜索Listen 改为8080

[root@web01 ~]# systemctl restart httpd

[root@web01 ~]# systemctl status httpd

● httpd.service - The Apache HTTP Server

  Loaded: loaded (/usr/lib/systemd/system/httpd.servicedisabledvendor preset: disabled)

  Active: active (running) since Wed 2020-10-21 00:14:38 CST6s ago

    Docs: man:httpd(8)

          man:apachectl(8)

  Process: 8873 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)

Main PID: 8953 (httpd)

  Status: "Processing requests..."

  CGroup: /system.slice/httpd.service

          ├─8953 /usr/sbin/httpd -DFOREGROUND

          ├─8954 /usr/sbin/httpd -DFOREGROUND

          ├─8955 /usr/sbin/httpd -DFOREGROUND

          ├─8956 /usr/sbin/httpd -DFOREGROUND

          ├─8957 /usr/sbin/httpd -DFOREGROUND

          └─8958 /usr/sbin/httpd -DFOREGROUND

Oct 21 00:14:07 web01 systemd[1]: Starting The Apache HTTP Server...

Oct 21 00:14:17 web01 httpd[8953]: AH00558: httpd: Could not reliably determine the server's fully qualified dom...essage

Oct 21 00:14:38 web01 systemd[1]: Started The Apache HTTP Server.

Hint: Some lines were ellipsized, use -l to show in full.

搞定!!!

注意:

再次访问一定要吧端口加进去,比如访问10.0.0.5:8080  中间的冒号一定是英文格式,不然访问不出


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/11175332.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-14
下一篇 2023-05-14

发表评论

登录后才能评论

评论列表(0条)

保存