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/...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
>>>>> "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! |
|
|||
|
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! |
|
|||
|
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. |