Saturday, January 27, 2018

Apachectl “service already loaded” when it's not

Leave a Comment

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 

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 is clearly not running though:

ps aux | grep httpd 

doesn't return any activity.

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.

Can anyone help?

Thanks,

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> 

2 Answers

Answers 1

Try

apachectl status 

This is probably the best way to check the status of Apache.

Answers 2

Can you try the below

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist sudo apachectl stop sudo apachectl start 
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment