Opened 8 years ago

Last modified 3 years ago

#36101 new defect

apache2 @2.2.22_2 startup item

Reported by: grrr@… Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: mountainlion Cc: cooljeanius (Eric Gallager), ctreleaven (Craig Treleaven),…, jea@…, Schamschula (Marius Schamschula), pixilla (Bradley Giesbrecht)
Port: apache2


On OS X 10.8.1 after every reboot apache2 is not starting for me, and I have activated the LaunchDaemon.

$ sudo port load apache2
org.macports.apache2: Already loaded

Still no httpd.


$ sudo apachectl start

successfully starts Apache, until reboot.

I've tried uninstalling and reinstalling apache2, running the launchctl load/unload commands on org.macports.apache2.plist, and checked my Apache config with apachectl configtest. Other MacPorts startup items work (MySQL5, dnsmasq), just not Apache.

Change History (11)

comment:1 Changed 8 years ago by ryandesign (Ryan Schmidt)

Keywords: mountainlion added; apache2 removed
Owner: changed from macports-tickets@… to ryandesign@…

Interesting. Since upgrading to Mountain Lion apache2 was also not starting for me and I had not yet spent the time to investigate why. If anybody knows why please let me know. Does the console say anything about it?

comment:2 Changed 8 years ago by grrr@…

I don't see anything in the console, even after changing launchctl's log level (sudo launchctl log level debug).

comment:3 Changed 8 years ago by grrr@…

I apparently fixed this when changing my local dnsmasq config. In /etc/hosts I added my servername (gala) to the loopback entry:   localhost gala

and then I changed ServerName in /opt/local/apache2/conf/httpd.conf to match:

ServerName gala

Apache now starts at boot for me.

comment:4 Changed 8 years ago by j+macports@…

I've had this same problem on Lion with various versions of apache2 for many months. Nothing obvious in the Console related to either launchd/apache/httpd.

Ryan, if there's anything I can do or test or any logs I can try and get to help you let me know.

Last edited 8 years ago by j+macports@… (previous) (diff)

comment:5 Changed 8 years ago by j+macports@…

I'm starting to wonder if the reason apache2 fails to actual start despite the fact that launchctl shows that the port has loaded is that the DNS is not fully operational at the time apache2 tries to start and thus fails because of servername mis-match (my machine is it's own DNS server with an internal-only domain name). Does anyone know if there is a good way to somehow delay when the apache2 launchd item tries to execute?

comment:6 Changed 7 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:7 Changed 7 years ago by ctreleaven (Craig Treleaven)

Cc: ctreleaven@… added

Cc Me!

comment:8 Changed 7 years ago by ctreleaven (Craig Treleaven)

Another workaround is to 'sudo port unload apache2' and then 'sudo port load apache2'.

comment:9 Changed 6 years ago by…

Cc:… added

Cc Me!

comment:10 Changed 5 years ago by jea@…

Cc: jea@… added

Cc Me!

comment:11 Changed 3 years ago by jmroot (Joshua Root)

Cc: Schamschula pixilla added
Note: See TracTickets for help on using tickets.