8

We have recently gotten a backup server to mirror all our data onto in case the primary server goes down.

I've gotten all the sites data updated through rsync, and all the apache config and databases updated. Both machines are on Ubuntu 9 (9.04 on the primary, 9.10 on the backup).

So everything seems synced up for the most part at this point (still need to figure out user syncing), and I try to start Apache. I get

* Starting web server apache2                                       [fail]

Nothing else indicating what the problem could be.

I know I don't have enough info to expect a solution from you guys, so I'd just like to know where I can go from here to further investigate this issue. Would there be any error logs for this?

Thanks!

  • so far, I have found logs saying "No such file or directory: mod_fcgid" - this is a good start – Lowgain Jun 10 '10 at 21:25
11

In some specific cases, a log entry will not be written to disk -- this can occur if logs don't exist, for example, or Apache simply cannot write to the log files due to permissions issues, etc. In such cases, the best way to diagnose an error is to use `strace':

[root@server ~]# strace -Ff apachectl start

While the output will be quite verbose, if Apache fails to start for any reason, you'll see a write() at the tail end with the contents of what would be entered in the logs with the reason it's failing (if it's not logging why in the error log, don't be surprised if the error message contains "Cannot open log" with the path to the log ;).

Though looking at your comment regarding mod_fcgid, I'd suggest reviewing the Apache configuration and examining references to mod_fcgid -- it sounds like it's trying to open a literal "mod_fcgid" file as opposed to loading the module.

11

httpd -t will test the syntax of your configuration files and spit out any errors to the terminal.

  • 1
    This was super helpful. +1 – Tom Busby Sep 29 '16 at 14:24
  • If that doesn't work, try apachectl -t. – berry120 Jan 17 '18 at 11:49
3

Any errors should be printed to the error logs (often at /var/log/http/error_logs. Grep for ErrorLog in your httpd.conf to find out where.

I recommend using two windows. Do a 'tail -f error_log' in one window, and use another window to run the 'apachectl restart' command. After you find the error, update your answer here with the error message.

  • The number one troubleshooting step in anything should always be read the logs. Apache logs nearly every single event that passes through it, so you should be chock-full of data to peruse. – phuzion Jun 12 '10 at 18:41
1

I had similar problem with debug apache server on Mac OS, so decided to share my experience and save others some time I found the following very helpful:

  1. locate logs:

apachectl -S | grep log

  1. in the output you will find some logs files you can start look for the errors example:

tail -n 15 /var/log/apache2/ssl_engine.log

In case there are more than 1 log file continue tailing them until you find the error causing apache to not start

0

If your Apache isn't running, check your skype port, most of the time both skype and apache use port 80, and that means skype might be the reason why apache can't start. stop skype if it is installed.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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