Apachectl“服务已加载"当不是 [英] Apachectl "service already loaded" when it's not

查看:73
本文介绍了Apachectl“服务已加载"当不是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图学习一些有关终端和服务器的知识.我正在学习一门课程,在此课程中它指出您可以使用以下命令启动和停止服务器apache(在mac上):

I am trying to learn a bit about the terminal and servers. I am following a course and in this course it states that you can start and stop the server apache (on mac) by using the command:

sudo apachectl start

但是,当我这样做时,它会返回一条消息,说Apache已经在起作用.完整消息:

But, when I do this, it comes back with a message saying that apache is already functioning. The full message:

/System/Library/LaunchDaemons/org.apache.httpd.plist: service already loaded

Apache显然没有运行:

Apache is clearly not running though:

ps aux | grep httpd

不返回任何活动.

我希望这与以下事实有关:我所遵循的课程是针对优胜美地的,而我正在经营El Capitan.我对该问题了解不多,我正在尝试学习,但是如果我什至无法启动服务器,我什至无法按照该课程进行学习.

I expect this is something to do with the fact that the course I am following is for Yosemite and I am running El Capitan. I don't know much about the issue and I am trying to learn, but I can't even follow the course if I can't even start the server.

任何人都可以帮忙吗?

谢谢

P

编辑---------------------------------------------- -----------------------

edit ---------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Disabled</key>
        <true/>
        <key>Label</key>
        <string>org.apache.httpd</string>
        <key>EnvironmentVariables</key>
        <dict>
                <key>XPC_SERVICES_UNAVAILABLE</key>
                <string>1</string>
        </dict>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/sbin/httpd-wrapper</string>
                <string>-D</string>
                <string>FOREGROUND</string>
        </array>
        <key>OnDemand</key>
        <false/>
</dict>
</plist>

推荐答案

很可能是配置错误.运行以下命令并修复所有错误

It's likely to be a config error. Run the following and fix any errors

sudo apachectl configtest

这篇关于Apachectl“服务已加载"当不是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆