PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > Changing an environment variable in .htaccess
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Changing an environment variable in .htaccess

Réponse
 
LinkBack Outils de la discussion
Vieux 09/10/2006, 15h32   #1
Peter Scott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Changing an environment variable in .htaccess

Hello. I am trying to install a large system on a web server I don't run,
and the people who do have screwed up the setting of $SCRIPT_NAME
horribly. Unfortunately SCRIPT_NAME is used in many places throughout the
system I am trying to install. I thought I could set it in .htaccess with
mod_rewrite, but it appears that the web host prohibits this (results in
403, and yes, I did try +FollowSymLinks).

Is there any other way of setting an environment variable in .htaccess?

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

  Réponse avec citation
Vieux 13/10/2006, 16h17   #2
Kenneth Svee
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Changing an environment variable in .htaccess

[ Peter Scott ]

> Hello. I am trying to install a large system on a web server I don't
> run, and the people who do have screwed up the setting of
> $SCRIPT_NAME horribly. Unfortunately SCRIPT_NAME is used in many
> places throughout the system I am trying to install. I thought I
> could set it in .htaccess with mod_rewrite, but it appears that the
> web host prohibits this (results in 403, and yes, I did try
> +FollowSymLinks).
>
> Is there any other way of setting an environment variable in
> .htaccess?


You don't specify which Apache-version you run, but have a look at the
docs:

http://httpd.apache.org/docs/2.2/env.html

Note the context of the directives (e.g. 'SetEnv' can be used in a
..htaccess).

If you use another version of Apache, see its documentation.


Rgds,
Kenneth Svee
  Réponse avec citation
Vieux 14/10/2006, 05h06   #3
Peter Scott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Changing an environment variable in .htaccess

On Fri, 13 Oct 2006 17:17:28 +0200, Kenneth Svee wrote:
>> Is there any other way of setting an environment variable in .htaccess?

>
> You don't specify which Apache-version you run, but have a look at the
> docs:
>
> http://httpd.apache.org/docs/2.2/env.html
>
> Note the context of the directives (e.g. 'SetEnv' can be used in a
> .htaccess).
>
> If you use another version of Apache, see its documentation.


Thanks. I tried to make this work on my own web server first, which is
"Apache/2.2.0 (Fedora)" and couldn't get it to work. I turned selinux off
first (setenforce 0) to be on the safe side and restarted Apache. I have
a .htaccess in my ~/public-html/ containing:

Options ExecCGI
SetEnv FOO bar

and in my httpd.conf I have:

<Directory "/home/*/public_html">
AllowOverride FileInfo Options
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>

But a CGI in the same directory that lists all environment variables
doesn't show FOO. I tried putting the SetEnv in the global config block
above and that didn't . Nothing in the error_log. mod_env is loaded.
I tried SetEnvIf as well and it didn't work. I also tried AllowOverride
All. I also tried UnSetEnv SERVER_SOFTWARE and that didn't work
(although I think I'm not supposed to be able to unset that one).

I figure if I can't make this work on my own system first I won't know
what I'm doing on the target system. What have I missed?

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10302 seconds with 11 queries