logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2.4.3 not generating correct URLs?
Author
alderson



Joined: 17 Aug 2013
Posts: 4
Location: USA, Seattle

PostPosted: Thu 22 Aug '13 20:20    Post subject: Apache 2.4.3 not generating correct URLs? Reply with quote

We're running Apache 2.4.3 on Slackware 14:

LCMlinux ~> uname -a
Linux LCMlinux 3.2.29-smp #2 SMP Mon Sep 17 13:16:43 CDT 2012 i686
LCMlinux ~> httpd -v
Server version: Apache/2.4.3 (Unix)
Server built: Aug 23 2012 11:07:26
LCMlinux ~>

We are using this both for the Trac issue-tracking application and for a small, simple internal mirror web site. Trac is working perfectly; the web site works if exact URLs are provided (as in <a href=...> entries in HTML files, or typed directly into a browser).

The issue is with selecting entries on an autoindexed page. The resulting URL does not include the name of the current directory, and so results in a 404 error.

For example, if we go to http://lcmlinux/public_net/foo/, which gets autoindexed, and select the entry named BAR, the resulting URL is http://lcmlinux/public_net/BAR rather than the expected http://lcmlinux/public_net/foo/BAR.

I know it's something silly that I've misconfigured, but the online doc for mod_autoindex and "Mapping URLs to Filesystem Locations" is not bringing it to light, so I hoped the Lounge could push me in the right direction.


Thanks,
Rich


Rich Alderson
Vintage Computing Sr. Systems Engineer
Living Computer Museum
2245 1st Avenue S
Seattle, WA 98134
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 03 Sep '13 11:36    Post subject: Reply with quote

Please post you auto index config
Back to top
alderson



Joined: 17 Aug 2013
Posts: 4
Location: USA, Seattle

PostPosted: Tue 03 Sep '13 20:07    Post subject: Reply with quote

I've removed all of the configuration sections for log formats, CGI, LDAP, etc. as irrelevant. What remains follows:

Quote:
ServerRoot "/usr/lib/httpd"

LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule log_debug_module modules/mod_log_debug.so
LoadModule mime_module modules/mod_mime.so
LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule status_module modules/mod_status.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule version_module modules/mod_version.so
LoadModule wsgi_module modules/mod_wsgi.so

<IfModule unixd_module>
User apache
Group apache
</IfModule>

<Directory />
AllowOverride none
Require all denied
</Directory>

DocumentRoot "/srv/httpd/htdocs"
<Directory "/srv/httpd/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Wed 04 Sep '13 10:52    Post subject: Reply with quote

it seems not to be apache. Maybe you have some special characters in your file names like ä ö or something like that.

You should check your locale

Code:

james@server:~$ locale -a
C
de_DE.utf8
POSIX


make sure you have utf8 as default you you use special characters.

If it isn't that. You may post the broken link so I / we can check what it is.
Back to top
alderson



Joined: 17 Aug 2013
Posts: 4
Location: USA, Seattle

PostPosted: Wed 04 Sep '13 21:33    Post subject: Reply with quote

There are no non-ASCII characters in the file or directory names.

I don't understand quite what you mean by "post the broken link". If you mean the URL for the top level of our internal web site, I'm afraid that that is impossible (or at least, entirely useless), since it is behind a corporate firewall which is maintained by our parent organization and not subject to breaching at our request.

I can give you the complete configuration, for replication on a test system at your location, to see whether you get the same result I described in my original post.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Thu 05 Sep '13 0:16    Post subject: Reply with quote

I know there is now way to access the inner network. But you shall post the html of a broken link. Did you check the locale on the console?

Code:

locale -a


?
Back to top
alderson



Joined: 17 Aug 2013
Posts: 4
Location: USA, Seattle

PostPosted: Thu 05 Sep '13 2:58    Post subject: Reply with quote

All right. To begin, here is an obscured directory listing of relevant directories:

Code:

LCMlinux ~> v /var/www/htdocs/
total 76
drwxr-xr-x  4 root root 4096 Aug 29 13:37 ./
drwxr-xr-x  6 root root 4096 Aug 23  2012 ../
drwxr-xr-x  2 root root 4096 Jul  4  2012 htdig/
-rw-r--r--  1 root root 1449 Jun 24 11:10 index.html
lrwxrwxrwx  1 root root   12 Aug 17  2011 public_net -> /public_net//
-rw-r--r--  1 root root   20 Aug 29 13:38 test.pdp
LCMlinux ~>
LCMlinux ~>
LCMlinux ~> v /public_net/
total 132
drwxrwxrwx  29 alderson users  4096 Jun 24 11:12 ./
drwxr-xr-x  24 root     root   4096 Jul 17 10:21 ../
drwxr-xr-x  32 alderson users  4096 Apr 12  2012 0.0.0.0/
drwxr-xr-x   3 alderson users  4096 Jan 29  2007 d-h/
drwxr-xr-x   4 alderson users  4096 Jun 14 17:23 f.b.o/
drwx------   3 alderson users  4096 Jan  8  2013 ff.c/
drwxr-xr-x  10 alderson users  4096 Apr 13  2012 lvm.o/
drwxr-xr-x  23 alderson users  4096 Apr 17  2012 pm.c/
drwxr-xr-x   3 alderson users  4096 Jan  6  2013 s-m-s.c/
drwxr-xr-x   2 alderson users  4096 Jan 26  2012 s_f/
drwxrwxr-x   5 alderson users  4096 Jul 24 17:54 t-e.c/
drwxr-xr-x   3 alderson users  4096 Feb  9  2012 t.m.c/
drwxr-xr-x   2 alderson users  4096 Jan 15  2013 w.bc.o/
drwxr-xr-x   3 alderson users  4096 Jan  9  2013 w.c.o/
drwxr-xr-x   3 alderson users  4096 Jan  8  2013 w.cd.o/
drwxr-xr-x   3 alderson users  4096 Apr 19  2012 w.cf.o/
drwxr-xr-x  11 alderson users  4096 Apr 15  2012 w.ct.o/
drwxr-xr-x   3 alderson users  4096 Jan 26  2012 w.d.n/
drwxrwxr-x   4 alderson users  4096 Nov  9  2011 w.d.nl/
drwxr-xr-x  31 alderson users  4096 Feb 10  2012 w.f-j.de/
drwxr-xr-x   3 alderson users 12288 Apr 12  2012 w.h-390.o/
drwxrwxr-x 277 alderson users 12288 Jan 15  2013 w.ib.o/
drwxr-xr-x   2 alderson users  4096 Jan  7  2013 w.ls.o/
drwxr-xr-x   2 alderson users  4096 Jan  9  2013 w.nywc.o/
drwxr-xr-x   2 alderson users  4096 Jan  9  2013 w.ocag.c/
drwxr-xr-x  50 alderson users  4096 Jan  8  2013 w.p8o.c/
drwxr-xr-x   9 alderson users  4096 Nov 19  2012 w.pf.c/
drwxr-xr-x   2 alderson users  4096 Jan  9  2013 w.tl.o/
drwxr-xr-x   2 alderson users  4096 Jan  9  2013 w.up.u.e/
LCMlinux ~>
LCMlinux ~>
LCMlinux ~> v /public_net/t-e.c/
total 6376
drwxrwxr-x  5 alderson users    4096 Jul 24 17:54 ./
drwxrwxrwx 29 alderson users    4096 Jun 24 11:12 ../
-rwxr-xr-x  1 alderson users 1818314 Apr 15  2011 b.log*
drwxr-xr-x 14 alderson users    4096 Apr  3  2011 b-m/
-rwxr-xr-x  1 alderson users 4641819 Apr 13  2011 f.log*
drwxr-xr-x  3 alderson users    4096 Aug  6  2010 f.t-e.c/
-rw-r--r--  1 alderson users     298 Jul 24 17:54 index.html
drwxr-xr-x  3 alderson users   36864 Aug  7  2010 p-t-i/
LCMlinux ~>


Next, we have the source view from a browser of the top-level index.html

Code:

<html><body><h1>It works!</h1>

<p><a href="public_net/0.0.0.0">SD</a>
<p><a href="public_net/t-e.c">T E</a>
<p><a href="public_net/w.h-390.o">H</a>
<p><a href="public_net/w.ib.o/jm">J M 4 H</a>
<p><a href="public_net/w.c.o">tools</a>
<p><a href="public_net/pm.c">PM</a>
<p><a href="public_net/lvm.o">L zVM</a>
<p><a href="public_net/w.d.nl">D (N)</a>
<p><a href="public_net/w.d.n/dec/index2.htm">D documentation</a>
<p><a href="public_net/s_f">S documentation</a>
<p><a href="public_net/w.f-j.de/j/h">C H</a>
<p><a href="public_net/w.cf.o">CF</a>
<p><a href="public_net/w.pf.c">PP</a>
<p><a href="public_net/s-m-s.c">VS</a>
<p><a href="public_net/w.p8o.c">DG</a>
<p><a href="public_net/w.ib.o/p/a/c-s/">C S</a>
<p><a href="public_net/f.b.o/">AK</a>

</body></html>


Select T E, then view the source (generated by Apache's modules/mod_autoindex.so) for the resulting page:

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /public_net/t-e.c</title>
 </head>
 <body>
<h1>Index of /public_net/t-e.c</h1>
<ul><li><a href="/public_net/"> Parent Directory</a></li>
<li><a href="b.log"> b.log</a></li>
<li><a href="b-m/"> b-m/</a></li>
<li><a href="f.log"> f.log</a></li>
<li><a href="f.t-e.c/"> f.t-e.c/</a></li>
<li><a href="index.html"> index.html</a></li>
<li><a href="p-t-i/"> p-t-i/</a></li>
</ul>
</body></html>


As for locale, I still don't see why this is relevant (and "locale -a" lists every possible locale setting, so I don't think it's what you want anyway), but a simple "locale" yields the following:

Code:

LCMlinux ~> locale
LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE=C
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
LCMlinux ~>


Will this suffice?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Thu 05 Sep '13 11:38    Post subject: Reply with quote

alderson wrote:

As for locale, I still don't see why this is relevant (and "locale -a" lists every possible locale setting, so I don't think it's what you want anyway), but a simple "locale" yields the following:


my guess was that since there are non ascii characters they might be broken if the webservers reads it from not UTF-8 (in your case en_US.UTF-Cool. Cause I had that issue.
Now it seems more an issue with the symlink.
Back to top


Reply to topic   Topic: Apache 2.4.3 not generating correct URLs? View previous topic :: View next topic
Post new topic   Forum Index -> Apache