Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Apache is already set up as a service, since:

$ sudo update-rc.d apache2 defaults
 System start/stop links for /etc/init.d/apache2 already exist.

But Apache isn't starting. How can I start debugging what is going wrong?

I'm running Linux Mint, so a Debian flavour.

share|improve this question

3 Answers 3

Start by looking at the error log tail -15 /var/log/apache2/error.log

If that doesn't give a hint such as ports being unavailable or so, run apache2ctl -t to test your config.

If your config is good, check to see if any process is already bound to port 80 or 443 (which is probably the ports you want apache on). The last column of the output will be $PID/$process_name.

   sudo netstat -tlpne | egrep ':(80|443)'

Alternatively, see if Apache is running but listening on other ports...

  sudo netstat -tlpne | grep apache

If you still haven't sorted it out by now, it wouldn't hurt to check that Apache is configured to the domains you expect, so run apache2ctl -S and you should see a list of configured domains. If your domain/port combination isn't listed there, you'll want to sort out your config.

There're more still, but these will reveal many common configuration problems.

share|improve this answer
    
Thanks, but no fix. The only complaint Apache had was being unable to resolve ServerName, so I set it to localhost in httpd.conf. Now that warning is not showing, but no joy. No, there isn't something running on 80/443. Yes, the syntax is correct. Yes, it's configured for my virtual domain. sudo service apache2 start after logging in still works fine to get it running. –  eoinoc Apr 4 '12 at 18:24

You should be able to tell by tailing your system and apache logs. Usually located at /var/log/messages/ and /var/log/httpd|apache2/ respectively. Then troubleshoot using the provided messages.

share|improve this answer
    
/var/log/apache/ exists alright, but no logs were changed since my last boot. –  eoinoc Apr 4 '12 at 18:18
    
So in your response to @maxp it sounds like the service will start. Your issue is starting at boot. Correct? –  Josh Apr 5 '12 at 14:27
    
Correct - it's not starting at boot. Although I would expect it to, given the message at the beginning of my original post above... –  eoinoc Apr 9 '12 at 20:39

Just try:

sudo update-rc.d apache2 enable
share|improve this answer
    
It turns out that I had an Apache configuration error as seen on another question: unix.stackexchange.com/a/45402/14091 . Do you still believe your answer would have fixed my error? Or why would "enable" work when "defaults" option didn't? –  eoinoc Mar 12 '13 at 12:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.