0

I installed Apache recently and tried to set it up to use launchctl to start it. At first it was giving me an option error code and than all of a sudden it said that the file was missing can anyone help me create a new file for the launch daemon.
i am running 10.10.5 and apache version 2.4.16

2
  • 1
    Please add your operating system and the Apache installer you used.
    – klanomath
    Aug 17, 2015 at 21:18
  • i am running 10.10.5 and apache version 2.4.16
    – kain184
    Aug 17, 2015 at 21:51

1 Answer 1

1

The first measure is to reinstall Apache or at least unzip (untar, ungzip etc) or decompose the installer package to get hold of the file.

If you can't find it: here is a generic com.apache.httpd.plist file from GitHub:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.apache.httpd</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/httpd/bin/apachectl</string>
    <string>start</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

Depending on your system version and the flavor (server/client) several different Apple "generated" plists exist. Usually the name is org.apache.httpd.plist.

Example:

Mac OS X Server 10.7.5

<?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>OnDemand</key>
    <false/>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/sbin/httpd</string>
        <string>-D</string>
        <string>FOREGROUND</string>
        <string>-D</string>
        <string>MACOSXSERVER</string>
    </array>
    <key>SHAuthorizationRight</key>
    <string>system.preferences</string>
</dict>
</plist>

The original (unmodified) org.apache.httpd.plist of OS X 10.10.5 Client

<?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>EnvironmentVariables</key>
    <dict>
        <key>XPC_SERVICES_UNAVAILABLE</key>
        <string>1</string>
    </dict>
    <key>Label</key>
    <string>org.apache.httpd</string>
    <key>OnDemand</key>
    <false/>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/sbin/httpd-wrapper</string>
        <string>-D</string>
        <string>FOREGROUND</string>
    </array>
</dict>
</plist>

Please copy & paste it into text file a and safe it with admin rights to /System/Library/LaunchDaemons/ with the name org.apache.httpd.plist. Afterwards you may have to change the permissions/ownership to 644/root:wheel.

9
  • i have downloaded the version that i installed before how do i get this file out of the tar directory after i have un tared it. or should i just run the configure and install again
    – kain184
    Aug 17, 2015 at 21:55
  • @kain184 Did you download the tar.gz file from apache.org?
    – klanomath
    Aug 17, 2015 at 22:08
  • yes thats where i got it from
    – kain184
    Aug 17, 2015 at 22:09
  • @kain184 I couldn't find the plist file in the tar.gz either. Better to config......make....install it again, yepp. But I'm surprised because the 10.10.5 Client already contains apache 2.4.16. Why do you want to re-reinstall it again?
    – klanomath
    Aug 17, 2015 at 22:16
  • something went wrong with the launchctl to auto start it and i cant find the file anymore where it should be listed so i need the file to fix the auto start. if you can help me i have the config options from the version list if you can help me make the config command i can take care of the rest
    – kain184
    Aug 17, 2015 at 22:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .