Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: warren on February 27, 2009, 08:12:11 AM

Title: Location of log file when httpd.conf has errors ?
Post by: warren 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
Title: Re: Location of log file when httpd.conf has errors ?
Post by: cactus 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.
Title: Re: Location of log file when httpd.conf has errors ?
Post by: thomasch 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

Title: Re: Location of log file when httpd.conf has errors ?
Post by: warren 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.
Title: Re: Location of log file when httpd.conf has errors ?
Post by: David Harper 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.
Title: Re: Location of log file when httpd.conf has errors ?
Post by: cactus 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...