LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-30-2012, 09:23 AM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Apache2 - file not found gets 500 Server Error instead of 404


I am getting messages like the following:
Code:
[Mon Jan 30 09:59:57 2012] [error] [client 61.247.204.37] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Mon Jan 30 10:00:52 2012] [error] [client 66.249.71.187] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Mon Jan 30 10:01:32 2012] [error] [client 66.249.66.100] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
in the "/var/log/apache2/error.log" file. These are happening as the result of requests for files that are not found (and possibly for other errors, too). I can reproduce the error be requesting a file I know does not exist (and I get a "500 Server Error" instead of "404 Not Found"). So for now I will focus on why that is not giving me the proper 404 status and error message.

Originally, there was no "ErrorDocument 404" coded in my config at all. According to the Apache documentation for the ErrorDocument directive, that should result in a default action. But what I am getting is the above error messages being logged, and a "500 Server Error" to the client.

I have now added a bunch of specific directives:
Code:
ErrorDocument 400 default
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 408 default
ErrorDocument 410 default
ErrorDocument 411 default
ErrorDocument 412 default
ErrorDocument 413 default
ErrorDocument 414 default
ErrorDocument 415 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 502 default
ErrorDocument 503 default
ErrorDocument 506 default
I added them in the server context as well as duplicated them in the virtualhost context for the vhost I'm performing the tests with. I still get the "500 Server Error" messages and the worthless message in the /var/log/apache2/error.log file. For now, I only want the basic simple error messages for errors.

How can I found out why Apache is doing this?

---
I added the "LogLevel debug" directive, but it's not helping. The added log messages are:
Code:
[Mon Jan 30 10:48:01 2012] [debug] core.c(3065): [client 66.249.66.215] r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /home/pub/doku.php
[Mon Jan 30 10:48:01 2012] [debug] core.c(3071): [client 66.249.66.215] redirected from r->uri = /robots.txt
Only one vhost, not one of those being tested, has Dokuwiki installed. And it's only installed in the document root for that vhost. It's not in any other vhost.

Last edited by Skaperen; 01-30-2012 at 10:01 AM. Reason: more info from LogLevel debug
 
Old 01-30-2012, 09:57 AM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Are there any .htaccess present in the web docs directory you try to access
 
Old 01-30-2012, 10:15 AM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Cedrik View Post
Are there any .htaccess present in the web docs directory you try to access
Not in the directory for the vhosts having this problem. There is one in the directory for the vhost using dokuwiki. It contains:
Code:
## Enable this to restrict editing to logged in users only

## You should disable Indexes and MultiViews either here or in the
## global config. Symlinks maybe needed for URL rewriting.
#Options -Indexes -MultiViews +FollowSymLinks

## make sure nobody gets the htaccess, README, COPYING or VERSION files
<Files ~ "^([\._]ht|README$|VERSION$|COPYING$)">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>

## Uncomment these rules if you want to have nice URLs using
## $conf['userewrite'] = 1 - not needed for rewrite mode 2
RewriteEngine on
#
## Not all installations will require the following line.  If you do, 
## change "/dokuwiki" to the path to your dokuwiki directory relative
## to your document root.
#RewriteBase /dokuwiki
#
## If you enable DokuWikis XML-RPC interface, you should consider to
## restrict access to it over HTTPS only! Uncomment the following two
## rules if your server setup allows HTTPS.
RewriteCond %{HTTPS} !=on
RewriteRule ^lib/exe/xmlrpc.php$      https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
#
RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&id=$2  [QSA,L]
RewriteRule ^$                        doku.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
RewriteRule ^index.php$               doku.php
It looks like somehow this .htaccess is being used. It should not be except for the vhost I'm testing dokuwiki in.
 
Old 01-30-2012, 10:32 AM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
I uninstalled the dokuwiki package, and the problem went away. That sure seems peculiar, as none of the files supposedly installed by the package would affect Apache. There may still be some latent config or something that is now ineffective with the lack of the package. The actual web vhost I have Dokuwiki in is still working (it was installed in that site directory from Dokuwiki source, not from the Ubuntu package "dokuwiki" that I just uninstalled).

---
I'm still wanting to know what caused this, but it's apparently devolved to an indeterminate case, now.

Last edited by Skaperen; 01-30-2012 at 11:18 AM. Reason: added part 2
 
Old 01-30-2012, 11:53 AM   #5
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
If that is the case, then your Vhost for "dokuwiki" was misconfigured.
Since the "httpd.conf" is not shown here, it's hard to say what was it.

Probably, because of misconfiguration, the Apache took the "dokuwiki" settings for all http server hosts and since .htaccess was there also the errors 500 arise.

good luck
 
Old 01-30-2012, 04:15 PM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Ultimately, the httpd.conf was not changed at all. I removed those additions I made earlier, as they have no effect. With the dokuwiki package not installed, everything works fine, now ... even the site I have dokuwiki running in (installed from source from the dokuwiki download site, and copied into this vhost's document root directory, and configured per dokuwiki instructions).

I didn't paste it because it is huge. If it would have been necessary, I could (but redacting the 1178 domain names would have been a bit of a chore). That number will be growing later when I start to deploy wikis.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 Server...File not found /htdocs scottley Debian 11 11-25-2012 08:10 PM
Apache2 + mod_auth_pgsql = 500 Internal Server Error on Debian Lenny Mleahy Linux - Server 1 07-05-2009 04:16 AM
Unexplainable 404 error in apache2 lgp171188 Linux - Server 1 05-26-2009 04:52 PM
Apache error: 404 Not Found, why? cucolin@ Ubuntu 3 08-14-2006 11:01 AM
apt-get 404 Not Found error Steve Riley Ubuntu 3 06-21-2006 06:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration