Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am pretty terrified right now. I'm scared I'm going to get a call in a couple minutes from a hundred people saying the website doesn't work.

I was at the terminal changing some configuration files when I went to restart the server to update the .conf files with this command:

/etc/init.d/apache2 graceful

After I ran that, none of the websites work and I have no idea what to do.

There are about 100 errors I am getting according to the log files. They all begin with "PHP Notice" and most relate to "use of undefined constant" Also, I just spoke with a coworker, describing what I did, and he noticed that there are two installations of apache on the server and that I restarted the one that we don't use.

This is what the error log says (assuming it's the correct error log):

[Wed Jan 05 11:52:06 2011] [notice] Graceful restart requested, doing restart
Warning: DocumentRoot [/u/apps/staging/antetr/current/public/] does not exist
[Wed Jan 05 11:52:08 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
(2)No such file or directory: apache2: could not open error log file /u/apps/production/madfilmdash/current/log/apache-error.log.
Unable to open logs
(2)No such file or directory: apache2: could not open error log file /u/apps/production/madfilmdash/current/log/apache-error.log.
Unable to open logs
(2)No such file or directory: apache2: could not open error log file /u/apps/production/madfilmdash/current/log/apache-error.log.
Unable to open logs
(2)No such file or directory: apache2: could not open error log file /u/apps/production/madfilmdash/current/log/apache-error.log.
Unable to open logs
(2)No such file or directory: apache2: could not open error log file /u/apps/production/madfilmdash/current/log/apache-error.log.
Unable to open logs
(2)No such file or directory: apache2: could not open error log file /u/apps/production/madfilmdash/current/log/apache-error.log.
Unable to open logs
(2)No such file or directory: apache2: could not open error log file /u/apps/production/madfilmdash/current/log/apache-error.log.
Unable to open logs
(2)No such file or directory: apache2: could not open error log file /u/apps/production/madfilmdash/current/log/apache-error.log.
Unable to open logs

FINAL UPDATE:

Ok, I fixed it. The problem was (as you experts facepalming probably know) that it couldn't access an error log in the directory I was working in. I created an empty error log file and tried the restart command again and now all the sites are back up... Though my original problem is still there..

Thanks to all those who offered advice, it really helped and let me breathe for a moment.

share|improve this question

migrated from stackoverflow.com Jan 6 '11 at 0:31

This question came from our site for professional and enthusiast programmers.

2  
log files, log files, log files. what do they say is wrong? –  Michael Lowman Jan 5 '11 at 19:19
    
Do you have a backup of the .conf files? They obviously worked before the changes. Focus on the changes to the .conf files, Apache is not starting because of those changes. It may be a simple typo, a missing bracket, or some little thing. The logs are invaluable. –  JYelton Jan 5 '11 at 19:25
    
There are about 100 errors I am getting according to the log files. They all begin with "PHP Notice" and most relate to "use of undefined constant" Also, I just spoke with a coworker, describing what I did, and he noticed that there are two installations of apache on the server and that I restarted the one that we don't use. –  James Jan 5 '11 at 19:32
add comment

3 Answers 3

your apache log files location varies by system. from cyberciti.biz:

  • RHEL / Red Hat / CentOS / Fedora Linux Apache error file location - /var/log/httpd/error_log
  • Debian / Ubuntu Linux Apache error log file location - /var/log/apache2/error.log
  • FreeBSD Apache error log file location - /var/log/httpd-error.log

In the future, either make a backup of your .conf file before editing it, named with the datestamp of the change so that worst come to this, you can recover to a previous version OR, only comment out changed lines and add comments to new lines so you can keep track of what changed when and why. editing without a way to go back is one guaranteed way to attract bad mojo.

share|improve this answer
    
According to my coworker, there are two installations of apache on this particular server and I sent the restart command to the installation that we don't use. This is sounds like it might be a major problem, what do you think? –  James Jan 5 '11 at 19:35
add comment

Go into the apache install folder and look for 'logs' then look for error_log or error.log. It should give you some idea of what is breaking.

If it is not on you can turn them on in httpd.config

In *nix it is usually under [apacheroot]/logs/httpd/error_log

In windows it defaults to [apacheroot]/logs/error.log

share|improve this answer
    
Would that be in the /etc/apache2 folder? –  James Jan 5 '11 at 19:20
    
It will be wherever ErrorLog config item points in httpd.config see httpd.apache.org/docs/1.3/mod/core.html#errorlog or httpd.apache.org/docs/current/mod/core.html#errorlog for 2.2 –  Ryan Christensen Jan 5 '11 at 19:24
add comment

Try looking at the error log. On most Linux systems, the error log is in /var/log/httpd/error_log.

You DID save a backup of the configuration files before you edited them, right? If you need a quick fix, you could restore the configuration files to the way they were before you changed them, and then start the server again.

share|improve this answer
add comment

Your Answer

 
discard

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