You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Jon Barnett <jo...@haht.com> on 1998/10/01 07:49:22 UTC

config/3118: Alias on default server seems to also translate to virtual server on another port

>Number:         3118
>Category:       config
>Synopsis:       Alias on default server seems to also translate to virtual server on another port
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Sep 30 22:50:01 PDT 1998
>Last-Modified:
>Originator:     jonb@haht.com
>Organization:
apache
>Release:        1.2.6
>Environment:
Linux syd001 2.0.33 #2 Wed Jun 10 06:54:28 CDT 1998 i486

1.2.6 compiled under
Reading specs from /usr/lib/gcc-lib/i486-pc-linux-gnulibc1/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)

Also 1.2.1 showed the same problem and that was compiled under
gcc 2.7.2.2

libc5.4.* libraries used (1.2.6 build operating with libc5.4.44)
>Description:
Sorry if this is a dumb configuration setup on my part but I couldn't find any
reference to it under bug reports, FAQ or in the main documentation.

What I was looking at was how the VirtualHost configuration was affected by
the alias command.  What I found seems a bit surprising, but perhaps I am doing
something wrong.

When I apply an alias within the <VirtualHost > directive pair, the alias only
applies to the virtual host, and not the default (which is what I would expect).

Using the example, if I access http://syd001.ads.com.au/Virtua/ I get a
'File Not Found' error page. Accessing http://syd001.ads.com.au:443/Virtua/
gives me the content I expect (content contained in /home/httpsd/htdocs).

When I apply an alias command to the default host, and an alias to the virtual
host, I get the expected results.

So accessing http://syd001.ads.com.au/Virtua/ gives me the content in
/home/web/VirtuaContent, and accessing http://syd001.ads.com.au:443/Virtua/
give the content in /home/httpsd/htdocs.

However, when I apply an alias to only the default host, the virtual host also
seems to recognise the alias and refers to the smae directory.  I also cleared
browser cache to ensure that this wasn't affecting the observed results.

Again, in the example, access to http://syd001.ads.com.au/Virtua/ gives me the
content in /home/web/VirtuaContent but http://syd001.ads.com.au:443/Virtua/ also
gives me access to /home/web/VirtuaContent.

Finally as a test reference, if I take out all aliasing, I get 'File Not Found'
pages for both http://syd001.ads.com.au/Virtua/ and
http://syd001.ads.com.au:443/Virtua/

Note that I am using a plain Apache compile (no SSL).  I apologise that I
haven't got around to testing the Apache 1.3 against it yet.
>How-To-Repeat:
My virtual host test setting.

<VirtualHost syd001.ads.com.au:443>
	ServerAdmin jonb@syd001.ads.com.au
	DocumentRoot /home/httpsd
	ServerName syd001.ads.com.au
	ErrorLog logs/test-error_log
	TransferLog logs/test-access_log
	<Directory /home/httpsd/htdocs>
	        options Indexes ExecCGI FollowSymLinks
	</Directory>
#	Alias /Virtua /home/httpsd/htdocs
</VirtualHost>

I have in the srm.conf the line following line and this Alias should refer to
the default host:
#        Alias /Virtua /home/web/VirtuaContent

The ServerRoot is defined as
    ServerRoot /home/web

Trialling the various combinations of the Alias lines being 'commented out/not
commented out' gave me the results I reported.
>Fix:
This seems to be a logic error in interpreting the configuration.  Since it was
there in 1.2.1 and still there in 1.2.6, I would assume that it has only come
about because of the introduction of the virtual hosting directives.  I haven't
investigated the code yet to determine the fix for it.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]