The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

htaccess Directive and 500 Internal Server Error

Discussion in 'Data Protection' started by Shaya, Apr 17, 2005.

  1. Shaya

    Shaya Member

    Joined:
    Jan 4, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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, webmaster@domain.com 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
     
  2. Shaya

    Shaya Member

    Joined:
    Jan 4, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Anybody?????
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    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
     
  4. Shaya

    Shaya Member

    Joined:
    Jan 4, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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:
     
    #4 Shaya, Apr 18, 2005
    Last edited: Apr 18, 2005
  5. RickG

    RickG Well-Known Member

    Joined:
    Feb 28, 2005
    Messages:
    238
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    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!
     
    #5 RickG, Apr 18, 2005
    Last edited: Apr 18, 2005

Share This Page