Why doesn't Apache start up automatically?

1

I have Apache2 running on Cygwin on my Windows 7 computer. It doesn't do much, it just hosts some HTML documentation for my local (firewalled) LAN.

Oddly, it doesn't seem to start automatically even though its Startup type is automatic. However, when I start it manually, it works perfectly. Any idea why this might be?

  • Apache version (httpd2.exe -v): Apache/2.2.23 (Unix)
  • Cygwin version (uname -a):
    CYGWIN_NT-6.1-WOW64 (hostname removed) 1.7.27(0.271/5/3) 2013-12-09 11:57 i686 Cygwin

Services

In the middle of a bunch of events of my other Cygwin services entering the running state, there's an event of Apache entering the stopped state. For example:

Event Viewer

The only thing I can find in the Application log looks like this:

The description for Event ID 0 from source httpd2 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

httpd2: PID 3384: `httpd2' service stopped, exit status: 1

/var/log/apache2/error_log has stuff like this at successful manual startups only:

[Fri Jul 17 08:30:28 2015] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Jul 17 08:30:29 2015] [notice] Digest: generating secret for digest authentication ...
[Fri Jul 17 08:30:29 2015] [notice] Digest: done
[Fri Jul 17 08:30:29 2015] [warn] pid file /var/run/apache2/httpd2.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Jul 17 08:30:29 2015] [notice] Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.1e DAV/2 configured -- resuming normal operations

/var/log/httpd2.log has stuff like this:

(125)Cannot assign requested address: make_sock: could not bind to address <my_172._ip>:80
no listening sockets available, shutting down
Unable to open logs

durron597

Posted 2015-07-17T13:36:30.120

Reputation: 479

1Is anything logged in Event Viewer? – Kinnectus – 2015-07-17T13:46:38.073

Is there anything in the Application event log. Apache service errors go in there not system. At least that's where my wamp server put apache errors - eg "The Apache service named reported the following error:

httpd.exe: Syntax error on line 513 of C:/wamp/bin/apache/apache2.4.9/conf/httpd.conf: Could not open configuration file C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf: The system cannot find the file specified."

– DavidPostill – 2015-07-17T14:37:16.967

Anything in apache_error.log? – DavidPostill – 2015-07-17T14:43:41.400

Answers

0

I've stumbled upon similar issue. Make sure that executables do not have a warning in their properties "This file came from another computer...".

If this is the case, refer to "This file came from another computer..." - how can I unblock all the files in a folder without having to unblock them individually?

Alexandr Zarubkin

Posted 2015-07-17T13:36:30.120

Reputation: 212

0

httpd2.exe -t

Above command will tell you the exact error that you might have in your configuration file with line number.

Also try

httpd2.exe -k uninstall

and then

httpd2.exe -k install

This fixed the issue in my case

deenaik

Posted 2015-07-17T13:36:30.120

Reputation: 1

httpd2.exe -t results in Syntax OK. Recall that it works when I do manual startup. – durron597 – 2015-07-17T14:54:26.000