Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm setting up a web server on my CentOS 5.4.3 (x86_64) system and the Python toolkit that I'm using (RDKit - RDKit.org) expects to have its location specified in the PATH environment variable. This is all good and fine when I use the toolkit on my own as I have
But, since this is a web server, I need to have the PATH set for Apache. I can get all the other necessary environment variables set from httpd.conf, but not PATH.
I also tried to include a new .sh file in /etc/profile.d - rdkit.sh - which contained the specified export PATH statement above, but Apache doesn't recognize it even if I include the PassEnv directive in httpd.conf:
I guess you simply have to set the variable system wide in /etc/profile with the mentioned export statements, then
'source /etc/profile'
and restart apache.
'/usr/sbin/apache2ctl restart'
I tried adding the export line to /etc/profile - no luck. I also notice that if I look at the environment variables in apache with this code running from my web page:
for a in os.environ.keys():
print a, ' = ', os.environ[a], '<BR>'
and comparing that to what I get as my user or root, the PATH variable is different from all of them. In other words, I can see that this approach changed the root PATH variable, but it seems to have no effect with the webserver.
zhjim:
Thanks for the idea, but I've tried that. I have all my other necessary environment variables set using SetEnv within httpd.conf. I also tried PassEnv PATH once I had root's environment variable set correctly - still no luck.
Any other ideas out there??? How do I get to the apache user's account and how it has its environment variables set?
Well, I can't seem to affect the PATH, but as it turns out I can opt to set PYTHONPATH instead. I also discovered that within the httpd.conf file, I have to explicitly spell out the directories. In other words, this didn't work:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.