首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >httpd/apachectl服务无法在RHEL 7上启动

httpd/apachectl服务无法在RHEL 7上启动
EN

Stack Overflow用户
提问于 2018-04-07 05:47:35
回答 1查看 5K关注 0票数 0

我在从RHEL7(亚马逊ec2)启动我的Apache服务器时遇到了一些问题。我更大的目标是使用Anaconda环境从ec2实例中托管一个Flask应用程序,但现在我只关心如何正确启动httpd服务。

我在hereherehere等网站上发现了许多类似的问题,但似乎都没有解决我遇到的确切问题。

我一直跟踪this tutorial直到最后一个>字符,但是命令

sudo apachectl restart

sudo service httpd restart

这两种方法都会导致错误,并指示我检查systemctl status httpd.service以获取更多信息。该文件的输出如下:

httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2018-04-06 21:00:42 UTC; 4s ago
Docs: man:httpd(8)
      man:apachectl(8)
Process: 32166 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 32165 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS)
Main PID: 32165 (code=exited, status=0/SUCCESS)
[long ec2 ip address] systemd[1]: Starting The Apache HTTP Server...
[long ec2 ip address] httpd[32165]: httpd (pid 28220) already running
[long ec2 ip address] kill[32166]: kill: cannot find process ""
[long ec2 ip address] systemd[1]: httpd.service: control process exited, code=exited status=1
[long ec2 ip address] systemd[1]: Failed to start The Apache HTTP Server.
[long ec2 ip address] systemd[1]: Unit httpd.service entered failed state.
[long ec2 ip address] systemd[1]: httpd.service failed.

journalctl -xe的输出返回相同的结果。

关于我的系统的一些信息(不知道这些信息是否有用,但我认为最好将其包括在内):

Apache Version: Apache/2.4.6 (Red Hat Enterprise Linux) configured

$ /usr/bin/python -V
    Python 2.7.5
$ sudo yum install mod_wsgi
    Package mod_wsgi-3.4-12.el7_0.x86_64 already installed and latest version
$ service httpd configtest
    Syntax OK
$ sudo chkconfig --levels 235 httpd on
    Note: Forwarding request to 'systemctl enable httpd.service' 

命令sudo netstat -lnp | grep :80返回tcp 0 0 :::0 :::* LISTEN 28220/httpd

我现在注意到文件/etc/init.d/httpd不存在。

有谁能给点提示吗?如果以前有人问过这个问题,请直接告诉我。我已经找遍了,到目前为止还没找到。

干杯。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-08 23:51:38

试着杀了老pid。看起来有些东西仍然在httpd下运行。尝试执行ps -ef | grep httpd以查看正在运行的程序,并使用sudo kill -9 processid (例如sudo kill -9 13254)终止它。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49701404

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档