SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 500 Internal Server Error generic Apache message. What creates this?

    I'm deploying a java web application and defining my own custom error page inside my deployment xml but for some reason Apache always overrides my 500 page handler with its own generic message:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, you@your.address 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.
    I don't have ErrorDocument set in httpd.conf. Does anyone know where this message could be defined?

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    HG,

    Almost always, this is due to a syntax error (or unsupported directive) in your .htaccess file. Since this is your server, have you attempted to use mod_rewrite directives without removing the comment from the LoadModule directive for mod_rewrite?

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Both LoadModule and AddModule for mod_rewrite are in httpd.conf. I can only find one .htaccess file and it's under the document root and it contains:


    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !443
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L]

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    HG,

    Remove the + from your first line and give that a go.

    Personally, I alter the httpd.conf (of my test server) to avoid having to play with the Options FollowSymLinks et al in .htaccess.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately that didn't appear to make a difference. I can look in the error_log* file and see that the Content-Location header is being set to my error page url but it just never displays it.

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    HG,

    Another tact: Have you setup the secure server properly. If not, Apache must throw an error. I don't bother with that on the test server because I'm aware that Windows does not use a compatible security setup so I'd have to go get an app online to encode the encrypted part of that setup (and use a self-signed cert).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  7. #7
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I don't know why or who put that file there but it isn't in any of the directories of my application or any URLs I am accessing. I removed that file just in case but it didn't have any effect. In httpd.conf Port is set to 7777 and Listen to 7778. Not sure why they are different. I didn't set up this configuration but am the one working on it now.

  8. #8
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    HG,

    Because you're attempting to redirect to https, that's on port 443 unless you specify differently (check the httpd-vhosts.conf file for that), you're using port 443.

    What I was referring to was the pair of crypto files that Apache needs to setup the secure server. Unfortunately, I'm a lazy {whatever} and don't bother do that on my test server; I use cPanel on the production server for the secure server setup.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  9. #9
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually I'm not using 443. Someone else attempted to do this but they no longer work here and I'm cleaning up the mess. All urls for my application on this server are accessed by specifiying port 7777 or 7778 explicitly in the url. That directory where the .htaccess file was found is not part of my application and I have removed it. By the way this is an old version of apache. I can't get an exact version number thanks to Oracle:

    Code:
    Server version: Oracle-Application-Server-10g/10.1.2.3.0 Oracle-HTTP-Server
    Server built:   Apr  2 2009 15:56:58

  10. #10
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    David, also I have discovered that it's not just error code 500 that displays its own page but also 404. If I test out a code like 501 it displays my error page properly.

  11. #11
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    HG,

    Questions about an Oracle server in the Apache forum? Hmmm.

    Oh, well, if you expect to have your website serve requests, it must respond to the ports which are receiving the requests, i.e., port 80 and 443. Of course, you can "hide" your server by using other ports (typically 8080 and ... well, I have no idea what non-standard port would be used for SSL).

    From your description of the "mess" and apparent lack of knowledge about your server, I would recommend that you remove the existing server and replace it with a current version of Apache. Because Apache needs to be "hardened," I would recommend that a sysadmin be used to do this for you (I am very familiar with Apache but do not feel up to sysadmin level - there's just so much there which needs to be done correctly).

    Okay, I don't feel like I'm being much help here - sorry - but the responses are to your direct questions and are my best suggestions ... assuming an Apache server, of course.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  12. #12
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Believe me dk, If I had my way we would sure start over with something different and more current. Unfortunately there's not much I can do about that for reasons I really can't get into. But from my experience with Apache I'm pretty sure that what I'm seeing is a configuration issue somewhere so that's why I asked here. It's very suspicious that only certain error codes don't work with my error page handler.

  13. #13
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    HG,

    I understand (and expected) the limit imposed by your situation and can only offer my condolences.

    Please confirm that your .htaccess is simply:
    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !443
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L]
    Then, please confirm your ports for http and https (obviously, port 443 is used in the code above so, if your https port is not 443, this will never complete - Apache would opt out of the loop after 10 cycles but Oracle obviously does not).

    Finally, Advice Redux: In an attempt to sort out the mess, you've got to determine where the problem is. Since you've narrowed it down to the .htaccess (as a possibility, if nothing else), then comment out the whole thing and run your test URI (on the desired URI of your redirection). If there is no problem (i.e., the file exists and displays properly), then sequentially remove the comment tags (#'s) until an error is presented to you. That last UNCOMMENT uncovered the error.

    If you have other code in your .htaccess, you may need to show your test URI's, too.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •