精华内容
下载资源
问答
  • Failed to start httpd.service: Unit httpd.service is masked. 解决方法: systemctl unmask httpd.service然后在启动httpd服务并且查看端口80已启动: [root@A8 ~]#systemctl start httpd [root@A8 ~]#ss -ntl ...

    当我们启动httpd服务的时候,系统报错为 Failed to start httpd.service: Unit httpd.service is masked.

    在这里插入图片描述 解决方法:

    systemctl unmask httpd.service

    然后在启动httpd服务并且查看端口80已启动:

    [root@A8 ~]#systemctl start httpd
    [root@A8 ~]#ss -ntl

    在这里插入图片描述

    更多文章和资料|点击下方文字直达 ↓↓↓ 阿里云K8s实战手册 [阿里云CDN排坑指南]CDN ECS运维指南 DevOps实践手册 Hadoop大数据实战手册 Knative云原生应用开发指南 OSS 运维实战手册

    展开全文
  • 报错原因,Apache安装是编译安装,安装路径不是...1、找到Apache安装路径 find / -name httpd,这是我已经将Apache服务添加到Linux系统服务中,所以出现第一个路径/etc/rc.d/init.d/httpd 2、将/home/apache2.4/...

    报错原因,Apache安装是编译安装,安装路径不是默认路径,Apache服务没有添加到Linux服务中

    解决办法,将Apache服务添加到Linux系统服务中

    1、找到Apache安装路径 find / -name httpd,这是我已经将Apache服务添加到Linux系统服务中,所以出现第一个路径/etc/rc.d/init.d/httpd

    2、将/home/apache2.4/bin/apachectl拷贝至/etc/rc.d/init.d目录下,并且命名为httpd

    3、在相应的启动级别如3,5中加入链接

    4、修改配置文件httpd,在#!/bin/sh下面添加两行

    5、保存后执行chkconfig --add httpd

    6、查询系统服务chkconfig --list 就可以看到httpd服务了

    7、家目录下执行命令systemctl status httpd.service

    展开全文
  • 项目场景: 学习Linux的httpd模块报错: ...Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for

    项目场景:

    学习Linux的httpd模块报错:


    问题描述:

    修改httpd 服务程序的主配置文件后,重启httpd服务报了以下错:

    [root@localhost ~]# systemctl restart httpd
    Job for httpd.service failed because the control process exited with error code. 
    See "systemctl status httpd.service" and "journalctl -xe" for details.
    

    原因分析:

    其实最开是就应该想到是配置文件写错了,因为是修改文件后报错的。。。但还是记录一下一步一步的解决问题思路吧。


    解决步骤:

    搜索Job for httpd.service failed because the control process exited with error code.的报错信息
    1. 先是修改80端口号,改为85、95、8088等都无效
    2. (这个没有操作,因为看不懂)查看Apache中的 httpd-vhosts.conf 文件,发现Listen 80 两次,httpd-vhosts.conf一次,httpd.conf一次,虚拟机里的加个#Listen 80
    3. 输入systemctl status httpd.service 或 journalctl -xe,发现错误信息为
    [root@localhost ~]# systemctl status httpd.service
    ● httpd.service - The Apache HTTP Server
       Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Wed 2020-11-04 23:46:48 CST; 10s ago
         Docs: man:httpd(8)
               man:apachectl(8)
      Process: 3319 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
      Process: 3609 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
     Main PID: 3609 (code=exited, status=1/FAILURE)
    
    Nov 04 23:46:48 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
    Nov 04 23:46:48 localhost.localdomain httpd[3609]: AH00526: Syntax error on line 119 of /etc/httpd/conf/httpd.conf:
    Nov 04 23:46:48 localhost.localdomain httpd[3609]: DocumentRoot '/home/wwwroot' is not a directory, or is not readable
    Nov 04 23:46:48 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
    Nov 04 23:46:48 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
    Nov 04 23:46:48 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
    Nov 04 23:46:48 localhost.localdomain systemd[1]: httpd.service failed.
    
    1. 查询以下错误信息
    DocumentRoot '/home/wwwroot' is not a directory, or is not readable
    

    以为是SELinux的原因,关闭SELinux后发现还未成功

    1. 最后发现是第一步修改httpd的配置文件中Directory目录写错(写多了一个o),conf错误内容如下
    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot "/home/wwworoot"
    
    #
    # Relax access to content within /var/www.
    #
    <Directory "/home/wwwrooot">
        AllowOverride None
        # Allow open access:
        Require all granted
    </Directory>
    
    # Further relax access to the default document root:
    <Directory "/home/wwwrooot">
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
    

    修改Directory目录后正确生效

    参考:
    https://blog.csdn.net/weixin_30709635/article/details/99143232
    https://blog.csdn.net/wangxiaoming099/article/details/23165575
    https://blog.csdn.net/zhuoyr/article/details/8393854
    https://tpyyes.com/a/linux/616.html(这篇文章最后一句告诉我对症下药,然后我看了我的报错信息)
    
    展开全文
  • Job for httpd.service failed because

    千次阅读 2018-06-30 00:10:00
    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.service   ...

    ThinkPHP在Apache上配置启用伪静态,重启Apache restart 竟然失败了,报错:

        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.service 

    [root@cloud1 bin]# 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 五 2016-08-26 11:13:09 CST; 6min ago
         Docs: man:httpd(8)
               man:apachectl(8)
      Process: 9915 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
      Process: 9913 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
     Main PID: 9913 (code=exited, status=1/FAILURE)
     
    8月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
    8月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
    8月 26 11:13:09 cloud1.localdomain httpd[9913]: no listening sockets available, shutting down
    8月 26 11:13:09 cloud1.localdomain httpd[9913]: AH00015: Unable to open logs
    8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
    8月 26 11:13:09 cloud1.localdomain kill[9915]: kill: cannot find process ""
    8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
    8月 26 11:13:09 cloud1.localdomain systemd[1]: Failed to start The Apache HTTP Server.
    8月 26 11:13:09 cloud1.localdomain systemd[1]: Unit httpd.service entered failed state.
    8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service failed.


    执行journalctl -xe 可以看到,80端口被占用了

    [root@cloud1 bin]# journalctl -xe
    --
    -- Unit session-9830.scope has finished starting up.
    --
    -- The start-up result is done.
    8月 26 11:01:01 cloud1.localdomain systemd[1]: Starting Session 9830 of user root.
    -- Subject: Unit session-9830.scope has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-9830.scope has begun starting up.
    8月 26 11:01:01 cloud1.localdomain CROND[9744]: (root) CMD (run-parts /etc/cron.hourly)
    8月 26 11:01:01 cloud1.localdomain run-parts(/etc/cron.hourly)[9747]: starting 0anacron
    8月 26 11:01:01 cloud1.localdomain run-parts(/etc/cron.hourly)[9753]: finished 0anacron
    8月 26 11:01:01 cloud1.localdomain run-parts(/etc/cron.hourly)[9755]: starting 0yum-hourly.cron
    8月 26 11:01:01 cloud1.localdomain run-parts(/etc/cron.hourly)[9759]: finished 0yum-hourly.cron
    8月 26 11:10:01 cloud1.localdomain systemd[1]: Started Session 9831 of user root.
    -- Subject: Unit session-9831.scope has finished start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-9831.scope has finished starting up.
    --
    -- The start-up result is done.
    8月 26 11:10:01 cloud1.localdomain systemd[1]: Starting Session 9831 of user root.
    -- Subject: Unit session-9831.scope has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit session-9831.scope has begun starting up.
    8月 26 11:10:01 cloud1.localdomain CROND[9870]: (root) CMD (/usr/lib64/sa/sa1 1 1)
    8月 26 11:13:09 cloud1.localdomain polkitd[1171]: Registered Authentication Agent for unix-process:9908:450142261 (system bus name :1.19686 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object p
    8月 26 11:13:09 cloud1.localdomain systemd[1]: Starting The Apache HTTP Server...
    -- Subject: Unit httpd.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit httpd.service has begun starting up.
    8月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
    8月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
    8月 26 11:13:09 cloud1.localdomain httpd[9913]: no listening sockets available, shutting down
    8月 26 11:13:09 cloud1.localdomain httpd[9913]: AH00015: Unable to open logs
    8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
    8月 26 11:13:09 cloud1.localdomain kill[9915]: kill: cannot find process ""
    8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
    8月 26 11:13:09 cloud1.localdomain systemd[1]: Failed to start The Apache HTTP Server.
    -- Subject: Unit httpd.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit httpd.service has failed.
    --
    -- The result is failed.
    8月 26 11:13:09 cloud1.localdomain systemd[1]: Unit httpd.service entered failed state.
    8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service failed.
    8月 26 11:13:09 cloud1.localdomain polkitd[1171]: Unregistered Authentication Agent for unix-process:9908:450142261 (system bus name :1.19686, object path /org/freedesktop/PolicyKit1/Authenticatio
    

    上面是查看日志

    查看Apache中的 httpd-vhosts.conf 文件,发现Listen 80 两次,httpd-vhosts.conf一次,httpd.conf一次

    虚拟机里的加个#Listen 80  OK解决了

     

    备注:apache\Apache\conf下,extraoriginal文件夹的含义

        extra的意思是额外扩展

        original的意思是源目录文件 

        original文件夹是配置文件的源文件备份,而真正要配置的是conf目录下的httpd.conf文件以及extra目录的额外扩展配置。

     

    亲,如果您感觉本文有用,请点个赞再走吧✌(>‿◠)!!

    转载于:https://my.oschina.net/ZhenyuanLiu/blog/1838004

    展开全文
  • 今天更新完程序,重启apache的时候,第一遍... 执行service httpd restart之后:  报错:  Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.  此时查...
  • httpd.service重启记录

    2018-10-02 11:25:00
    今天无法打开站点,猜测httpd.service服务肯定又停止了,可能是受到外部攻击(也可能是来自自己的攻击) 首先查看httpd.service状态 ,结果如下,果然在一周以前的时候就停止了,换算成北京时间应该是9月20日下午,...
  • Failed to reload httpd.service: Job type reload is not applicable for unit httpd.service. See system logs and ‘systemctl status httpd.service’ for details. 答案 systemctl stop httpd systemctl start ...
  • Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. 解决 查看端口被谁占用 [root@centos1905 Code]#...
  • Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. 在开启httpd服务时,出现了如题目所示的错误 # ...
  • See "systemctl status httpd.service" and "journalctl -xe" for details.【问题】1、http启动(重启)报错【解决方案】1、用systemctl status httpd.service查看,发现80端口被占用2、用netstat -antlp | gre
  • Job for httpd.service failed because the control process exited with error code.see “systemctl status httpd.service” and “journalctl -xe” for details. 这个提醒 会让你去查看当前状态日志,查看状态...
  • 最近用centos7搭建lamp的时候,安装完之后apache还能正常启动,但是重启之后就启动不了,总是提示:Job for httpd.service failed.。 经大神调试之后果然成功了,但是出错原因还是不解,日后有空再回来研究下。 ...
  • 问题:Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.问题的状态:(1)重启[root@iZ25dmhrwpjZ ~]#systemctl restart httpd.serviceJob for httpd.service ...
  • 注册Apache到Linux服务在Linux下用源代码方式编译安装完Apache后,启动关闭Apache可以通过如下命令实现:  /usr/local/apache/bin/...如果想将httpd列入系统自动启动的服务,可以直接将上述的apachectl文件拷贝到 ...
  • Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. 解决方式: 1、使用journalctl -xe查看日志提示。
  • service httpd start    systemctl start httpd.service 如果出现如下报错 Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.servic...
  • centos7修改httpd.service后运行systemctl restart httpd.service提示 Failed to issue method call: Unit httpd.service failed to load: No such file or directory. 执行 systemctl daemon-reload 在次运行...
  • Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. 错误原因可能是/etc/httpd/conf/中的内容报错...
  • /etc/rc.d/init.d/httpd start 这个命令也失效了 错误原因:service httpd start 是centos6的命令 , centos7使用 systemctl start httpd
  • 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 ...
  • 我 restart apache报了 ***Redirecting to/bin/systemctl start httpd.service /...Job for httpd.service failed.See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.* 这个错,然后我用sy
  • ln -s '/usr/lib/systemd/system/sshd.service' '/etc/systemd/system/multi-user.target.wants/sshd.service' 能用,但是指令被转发到 systemctl enable sshd.service ,以后控制服务就用这个指令了。试试: ...
  • 重启zabbix: systemctl restart zabbix-server zabbix-agent httpd 按照提示执行: systemctl status httpd.service 查看占用端口的进程kill掉: lsof -i:80
  • 先查看进程:ps -ef | grep java 读出进程号,杀死进程,如果不清楚可全部杀死,重新连接就可启动apache: kill -9 [PID] PID是进程号
  • 启动服务的时候总是出现这个提示Redirecting to /bin/systemctl start httpd.service httpdfedorasystemselinux 我的系统是fedora20,启动服务(service httpd start)的时候总是会显示以下的错误Redirecting to ...
  • CentOS7 1611 运行Docker 使用systemctl start httpd.service报错如下图报错信息:Failed to get D-BUS connection: Operation no permitted 在运行时加上 --privileged选项仍然无济于事。 有网友说dbus-daemon没能...
  • 提示:Forwarding request to ‘systemctl enable httpd.service’。 难道一定要 用systemclt命令么?于是就查找各种资料,在网上论坛间逛啊,找到了一篇很不错的文章来讲这两者的区别 以下就是说明(转载): 任务 ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 103,548
精华内容 41,419
关键字:

httpd.service