htaccess Directive and 500 Internal Server Error

Shaya

Member
Jan 4, 2005
8
0
151
Hello All,

We have a client who wants to use htaccess directives. But it returns this error:

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


This is his .htaccess file:

LogFormat "customers: host %h, logname %l, user %u, time %t, request %r, status$
ErrorLog /home/username/www/foldername/log1


Any help is really appreciated.

Thank you,
Shaya
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
31
473
Go on, have a guess
You need to read up on htaccess files and what you can and cannot specify in them. AFAICS, you've got an invalid line in there. Your first place to check when you have apache errors is the error log:
/etc/httpd/logs/error_log
 

Shaya

Member
Jan 4, 2005
8
0
151
Thank you Chirpy for your reply. I checked it and here is the error_log:

[alert] [client x.x.x.x] /home/username/public_html/folder/.htaccess: LogFormat not allowed here
[error] [client x.x.x.x] File does not exist: /home/username/public_html/500.shtml


What should I do now for allowing LogFormat in htaccess?! :confused:
 
Last edited:

RickG

Well-Known Member
Feb 28, 2005
238
2
168
North Carolina
Shaya:

I've never heard of being able to define a LogFormat in an .htaccess file ... and basically the error message you reported above states exactly that.

In order for your client to use a custom log format and log location, you'll need to make a number of changes directly in the /usr/local/apache/conf/httpd.conf file, including:

- creating the CustomLog directive and assigning it a "nickname"
- modifying the account's <VirtualHost> container where you specify the new log location and format.

If you look in the httpd.conf file for CustomLog directive as well as the client's VirtualHost settings, it should be self explanatory. After making the changes you will need to restart the httpd services. Just be careful -- making a mistake (even a typo) in this file will bring a halt to all web page delivery on the server. So make a backup before you begin and check, double check, and triple check your work!
 
Last edited: