Site5 - Built For Designers & Developers MENU

Can you help with setting Apache environmental variables?

[4 Grey Star Level]

I’m trying to set some environmental variables using the .htaccess file which I then access from Perl scripts.

Everything works fine on my PC, but I can’t get the thing to work within my Site5 account. The .htaccess files contains lines like:

SetEnv DB_USER “username”
PassEnv DB_USER

Any idea what the problem is ?

Do I need to change some flag in the Apache server so that it reads my .htaccess file (for example AllowOverride FileInfo). If so I do I do it ?

Many thanks in advance.

Answer #1

Hello,

I hope this reply finds you well!

Unfortunately Apache environmental variables like that cannot be customized on our managed services.

However, we are in the process of launching a new unmanaged VPS product line that will allow you root access and the ability to customize Apache. For more information, please see the following link…

http://www.site5.com/vps/unmanaged/

If you have any questions, please feel free to leave a comment here, or, if you would prefer, you can contact our support department directly by opening a ticket through Backstage.

Answers Answered By: joliver [476 Blue Star Level]

Answer #2

Joliver,
thanks for the quick reply.

Actually experimenting further I found that I could set the environment variables using the .htaccess file in the main htdocs directory, but not in the cgi-bin subdirectory. Thus my PHP scripts are able to access the environmental variables but not my Perl scripts. This is very strange, since as understand it (and I’m no Apache expert), the dictates in .htaccess should be recursive; i.e. they should be picked up by the cgi-bin subdirectory.

Anyway I’ve got round the problem by hard coding the database username and password into the Perl script; thus avoiding the need to reference the environmental variables.

Thanks again.

Answers Answered By: Radnip [4 Grey Star Level]

Answer this Question

You must be Logged In to post an Answer.

Not a member yet? Sign Up Now »

Money Back Guarantees
Click to verify BBB accreditation and to see a BBB report.