Koozali.org: home of the SME Server

Location of log file when httpd.conf has errors ?

Offline warren

  • *
  • 293
  • +0/-0
Location of log file when httpd.conf has errors ?
« on: February 27, 2009, 08:12:11 AM »
Hi,

SMe 7.4 - Server-gateway-fully updated;

Scenario:
I had a client that modified a custom-template for an ibay that he allows access
to via restricted ip's. However, he had inadvertently put a CR in line of space separated ip's; so that the line looked like :

allow from xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy
192.168.101.1

Instead of :
allow from xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy 192.168.101.1

The template fragments were expanded, and service restarted ; afterwards
I got a call saying no web pages / webmail / Server-manager was available. I determined that they had made a change to a custom template, so started looking there (logged in remotely via ssh ) and found the "CR" , fixed the offending line, expanded the template and restarted the service with all working.

The question ; Where are these errors logged to : I looked in messages, boot.log, httpd/access_log ; httpd/error_log ( could see http 304 );

Thanks
Warren

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Location of log file when httpd.conf has errors ?
« Reply #1 on: February 27, 2009, 08:48:04 AM »
Template expansion errors are logged in /var/log/messages at least when activated through the server-manager and the event system. When expanded manually they are echoed to the command line (not sure if they will be written in the log file then).

The errors and access log of the webserver are located in /var/log/httpd/, there is a version for the webserver (error/access_log) and for the administration interface (admin-error/access_log).

You can always test the syntax of the webserver configuration file by executing the following:
Code: [Select]
httpd -tIf OK it should echo somethng like "Syntax OK", otherwise it give you a pointer to the offending line or configuration instruction.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline thomasch

  • *
  • 232
  • +0/-0
Re: Location of log file when httpd.conf has errors ?
« Reply #2 on: February 27, 2009, 09:05:21 AM »

The question ; Where are these errors logged to : I looked in messages, boot.log, httpd/access_log ; httpd/error_log ( could see http 304 );


warren,

AFAIK no httpd.conf syntax error log will be written anywhere. httpd will never be started if httpd.conf is broken, maybe that's why no log written.

test httpd.conf  syntax as cactus advise you.

thomasch


Offline warren

  • *
  • 293
  • +0/-0
Re: Location of log file when httpd.conf has errors ?
« Reply #3 on: February 28, 2009, 09:07:42 AM »
cactus,

Quote
Code: [Select]
httpd -t

Thanks I'll keep that handy. Strange though that the service showed as running; Anyways, using httpd -t , should show up any errors.

Offline David Harper

  • *
  • 653
  • +0/-0
  • Watch this space
    • Workgroup Technology Solutions
Re: Location of log file when httpd.conf has errors ?
« Reply #4 on: February 28, 2009, 03:18:12 PM »
AFAIK no httpd.conf syntax error log will be written anywhere. httpd will never be started if httpd.conf is broken, maybe that's why no log written.

When I was writing the PHP5-CGI contrib, I managed to get httpd-esmith to start with errors in httpd.conf. It did start but was not pretty - continuous errors scrolling on to the screen and no way to interact with the console as a result. IIRC I ended up rolling the VM back (I was using VMWare) because I couldn't find a way to fix it.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Location of log file when httpd.conf has errors ?
« Reply #5 on: February 28, 2009, 03:20:40 PM »
httpd will never be started if httpd.conf is broken
No, that is not true, if the error is not vital for the core it might start...
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)