AuthUserFile in .htaccess

This is a discussion on AuthUserFile in .htaccess within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi, With the AuthUserFile directive in .htaccess, is it possible to substitute the full path with something like $HOME/public_html/...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-07-2004
JS
 
Posts: n/a
Default AuthUserFile in .htaccess

Hi,

With the AuthUserFile directive in .htaccess, is it possible to
substitute the full path with something like $HOME/public_html/users ?

The reason I ask is because my ISP gives me some webspace on an apache
server, but I don't know what the full path is to my home directory on
there.

Thanks for any help.

JS.

  #2 (permalink)  
Old 01-08-2004
Bernd Muent
 
Posts: n/a
Default Re: AuthUserFile in .htaccess

JS schrieb:

> With the AuthUserFile directive in .htaccess, is it possible to
> substitute the full path with something like $HOME/public_html/users ?
>
> The reason I ask is because my ISP gives me some webspace on an apache
> server, but I don't know what the full path is to my home directory on
> there.


Ask your ISP oder start a cgi-script like this:
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}

This will return all the enviroment variables.
What you need should be this:
DOCUMENT_ROOT="/usr/local/apache2/htdocs"
SCRIPT_FILENAME="/usr/local/apache2/cgi-bin/printenv"

If you have got PHP, just use a simple php-script:
<? phpinfo(); ?>

Greetings, Bernd

--
BM Computer-Services, Bergmannstr. 66, 10961 Berlin
Webdesign, Internet, Layout und Grafik
Tel.: 030/20649400, mobil 0175/7419517, Fax: 030/20649401
Web: http://www.bmservices.de, eMail: kontakt@bmservices.de

  #3 (permalink)  
Old 01-08-2004
JS
 
Posts: n/a
Default Re: AuthUserFile in .htaccess

Bernd Muent wrote:
> JS schrieb:
>
>> With the AuthUserFile directive in .htaccess, is it possible to
>> substitute the full path with something like $HOME/public_html/users ?
>>
>> The reason I ask is because my ISP gives me some webspace on an apache
>> server, but I don't know what the full path is to my home directory on
>> there.

>
>
> Ask your ISP oder start a cgi-script like this:
> #!/usr/bin/perl
> print "Content-type: text/plain\n\n";
> foreach $var (sort(keys(%ENV))) {
> $val = $ENV{$var};
> $val =~ s|\n|\\n|g;
> $val =~ s|"|\\"|g;
> print "${var}=\"${val}\"\n";
> }
>
> This will return all the enviroment variables.
> What you need should be this:
> DOCUMENT_ROOT="/usr/local/apache2/htdocs"
> SCRIPT_FILENAME="/usr/local/apache2/cgi-bin/printenv"
>
> If you have got PHP, just use a simple php-script:
> <? phpinfo(); ?>
>
> Greetings, Bernd
>


It won't tell me the environmental variable of my home though.

JS.

  #4 (permalink)  
Old 01-08-2004
Bernd Muent
 
Posts: n/a
Default Re: AuthUserFile in .htaccess

JS schrieb:

> It won't tell me the environmental variable of my home though.


You are right: No, it won't. But why is this necessary. You just need
the absolute path to your AUTH file and that's all you need.
B.

--
BM Computer-Services, Bergmannstr. 66, 10961 Berlin
Webdesign, Internet, Layout und Grafik
Tel.: 030/20649400, mobil 0175/7419517, Fax: 030/20649401
Web: http://www.bmservices.de, eMail: kontakt@bmservices.de


  #5 (permalink)  
Old 01-08-2004
JS
 
Posts: n/a
Default Re: AuthUserFile in .htaccess

Bernd Muent wrote:
> JS schrieb:
>
>> It won't tell me the environmental variable of my home though.

>
>
> You are right: No, it won't. But why is this necessary. You just need
> the absolute path to your AUTH file and that's all you need.
> B.
>


That's the problem though, I don't know what the absolute path is, so I
need a way to specify the path using a variable which points to my home.

  #6 (permalink)  
Old 01-08-2004
Randal L. Schwartz
 
Posts: n/a
Default Re: AuthUserFile in .htaccess

>>>>> "JS" == JS <vervoom@hotmail.com> writes:

JS> The reason I ask is because my ISP gives me some webspace on an apache
JS> server, but I don't know what the full path is to my home directory on
JS> there.

You might not have a "home" directory there. Probably just webspace.

If you need to have a file that is outside servable filespace, you'll
need to talk to your ISP about a good location for that.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
  #7 (permalink)  
Old 01-09-2004
JS
 
Posts: n/a
Default Re: AuthUserFile in .htaccess

Randal L. Schwartz wrote:
>>>>>>"JS" == JS <vervoom@hotmail.com> writes:

>
>
> JS> The reason I ask is because my ISP gives me some webspace on an apache
> JS> server, but I don't know what the full path is to my home directory on
> JS> there.
>
> You might not have a "home" directory there. Probably just webspace.
>
> If you need to have a file that is outside servable filespace, you'll
> need to talk to your ISP about a good location for that.
>


I though there may be a way to pick up where the UserDir directive
points to. I'm fairly sure it can be done because a colleague of mine
managed to do it before, but unfortunately he can't remember how!


  #8 (permalink)  
Old 01-09-2004
Owen Jacobson
 
Posts: n/a
Default Re: AuthUserFile in .htaccess

On Fri, 09 Jan 2004 10:23:15 +0000, JS wrote:

> I though there may be a way to pick up where the UserDir directive
> points to. I'm fairly sure it can be done because a colleague of mine
> managed to do it before, but unfortunately he can't remember how!


Offhand a short CGI or SSI page that prints the contents of $ENV{PWD} or
`pwd` might do the trick.

Totally untested.

--
Some say the Wired doesn't have political borders like the real world,
but there are far too many nonsense-spouting anarchists or idiots who
think that pranks are a revolution.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:32 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0