You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "David W. Gulley" <d-...@dstny.com> on 2004/06/19 22:23:10 UTC
[users@httpd] Environment diference between UNIX and windows
I am new to Apache (just installed today) and I am trying to understand
if I have a missed configuration or am just seeing the difference in the
way Unix and windows handles the reporting of the ENVironment strings.
Also I may be seeing a perl issue instead of a Apache one...
I have setup Apache on a Win2000 system with ActivePerl and can
access the server form other computers in my network. Perl seems to work
fine except:
When retreiving the environment variables
for example $ENV{SCRIPT_FILENAME}
Unix gives a path with no drive:
/home/user/public-html/cgi-bin/myperl.pl
and windows includes the drive:
C:/home/user/public-html/cgi-bin/myperl.pl
Is there a way to prevent the drive from being included in the path?
Is there a way to have the server "know" that files are at a path
C:/root/morepathstuff/home/user/...
but so that it reports that the path is /home/user/...
Bottom line:
Does the server always report the actual physical path when it
provides the environment variables?
If it is in the manual or the archives, I did not find the right key
words to find anything about it...
Thanks,
David
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Environment diference between UNIX and windows
Posted by Robert Andersson <ro...@profundis.nu>.
David W. Gulley wrote:
> 2) A problem with Perl's File::Find module:
> When running perl under taint mode, the Find routine fails due to
> the colon (:) in the windows pathname! A simple patch, but now the
> code is no longer "standard".
That sound rather as a bug in File::Find, otherwise the module isn't Windows
compatible.
> I assumed that a virtual host could "think" it was located at x when in
> reality it was at a/b/c/x.
I don't understand what use you would have of "x" in that case. How is your
script going to use "x" if it doesn't know it is below "/a/b/c"? The point
of those variables is to give the absolute system path.
Regards,
Robert Andersson
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Environment diference between UNIX and windows
Posted by "David W. Gulley" <d-...@dstny.com>.
I have (had) two reasons for asking:
1) esthetics:
I wanted to setup the directory of in-house test websites according
to client and support requirements, but did not want that monstrosity
carried over into what the CGI was handling.
2) A problem with Perl's File::Find module:
When running perl under taint mode, the Find routine fails due to
the colon (:) in the windows pathname! A simple patch, but now the code
is no longer "standard".
I realize the difference is fundamental in how the two OSs work,
however, I had hoped that using aliases and/or symbolic links, I could
fool the CGI into not noticing the differences...
I assumed that a virtual host could "think" it was located at x when in
reality it was at a/b/c/x. After all why does the server have to tell
the "truth" about where things are located. !}
David
Robert Andersson wrote:
> David W. Gulley wrote:
>
>> When retreiving the environment variables
>> for example $ENV{SCRIPT_FILENAME}
>> Unix gives a path with no drive:
>> /home/user/public-html/cgi-bin/myperl.pl
>> and windows includes the drive:
>> C:/home/user/public-html/cgi-bin/myperl.pl
>
>
> I don't see how that is a difference. A full path on Windows includes the
> drive, while on *nix it doesn't (because they don't exist). That is not a
> difference in the semantics of the environment variable; it is a difference
> between the operating systems.
>
> If the drive letter wasn't included on Windows, it wouldn't be a full and
> valid path.
>
>
>>Bottom line:
>> Does the server always report the actual physical path when
>>it provides the environment variables?
>
>
> I surely hope so. What else should it put there? Anything but the real path
> doesn't make sense. Without the drive letter, the path is useless unless you
> assume a drive letter (which is a bad idea).
>
> Bottom line: What are you trying to do? Please explain your goal and it
> might be easier to suggest how it should be accomplished.
>
> Regards,
> Robert Andersson
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Environment diference between UNIX and windows
Posted by Robert Andersson <ro...@profundis.nu>.
David W. Gulley wrote:
> When retreiving the environment variables
> for example $ENV{SCRIPT_FILENAME}
> Unix gives a path with no drive:
> /home/user/public-html/cgi-bin/myperl.pl
> and windows includes the drive:
> C:/home/user/public-html/cgi-bin/myperl.pl
I don't see how that is a difference. A full path on Windows includes the
drive, while on *nix it doesn't (because they don't exist). That is not a
difference in the semantics of the environment variable; it is a difference
between the operating systems.
If the drive letter wasn't included on Windows, it wouldn't be a full and
valid path.
> Bottom line:
> Does the server always report the actual physical path when
> it provides the environment variables?
I surely hope so. What else should it put there? Anything but the real path
doesn't make sense. Without the drive letter, the path is useless unless you
assume a drive letter (which is a bad idea).
Bottom line: What are you trying to do? Please explain your goal and it
might be easier to suggest how it should be accomplished.
Regards,
Robert Andersson
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org