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.

My httpd.conf got trashed on FreeBSD

uname -a

FreeBSD ares 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1 14:37:25 UTC 2009 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386

I am running apache-2.0.63_2. What I did was to modify /home/user/public_html/.htaccess and add a Deny from rule and then restart apache with.

Any ideas? Any known bug for this? Did I do something wrong?

share|improve this question
    
If you can't remember how, you should seriously investigate this, though. Worst case you've got a compromised system. –  juwi Mar 9 '12 at 20:10
add comment

2 Answers 2

Apache reads its configuration file only once on startup. Whenever you make a change to httpd.conf, you need to tell Apache that you have changed its configuration file, and that it should reload the file. One way to do this is by restarting Apache.

A consequence of the above is that Apache does not react to any changes in its configuration file until you tell it to (such as by restarting). It's more likely that your httpd.conf was changed ("trashed" as you put it) by something else some time in the past after the last time you restarted Apache. In this situation, you would not have seen the effect of a changed httpd.conf until the next time Apache was restarted.

share|improve this answer
    
Could this be the line that changed the file: "GET /?C=N;O=D HTTP/1.0" 200 439 "192.168.0.150/"; "Lynx/2.8.6rel.4 libwww-FM/2.14"? Either ways, thanks for the answer, Greg. –  hyperboreean Jul 11 '09 at 12:07
2  
Apache never writes to its own httpd.conf file, so whatever changed it was in all probability something other than Apache itself. I would perhaps suspect misuse of a FreeBSD package manager, but without knowing more about what you might have done it's impossible for me to guess. –  Greg Hewgill Jul 11 '09 at 12:11
add comment

If by httpd.conf got trashed you mean site not opening and giving 500 error then it could be problem with .htaccess syntax. If you make mistakes in .htaccess file then for all pages within that directory or its subdirectories you will 500 Internal Server Error.

But by httpd.conf got trashed you mean apache not starting at all then it is something else. You can try to copy a fresh httpd.conf from other similar installation and try starting apache. If this works add few lines at a time from old file to new file to find exactly which line is causing problem.

share|improve this answer
    
By got trashed I mean that it got filled with gibberish like "R^@text/html^@text/x-server-parsed-html^@<title>^@" –  hyperboreean Jul 11 '09 at 14:14
    
Ah! Then I guess copying fresh httpd.conf is best. Then try to configure it as you want it. Correcting this file may be a nightmare. –  Saurabh Barjatiya Jul 11 '09 at 15:13
add comment

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.