----- Original Message -----
From: "Ciro Iriarte"
2008/8/11 Brian K. White
: Verify that /etc/sysconfig/apache2 has "env" somewhere in the APACHE_MODULES="..." line. If it is not, you can simply add it to the line, or run yast, network services, http server, [Server Mod] tab, scroll down and enable env.
create a new file: /etc/apache2/conf.d/cio8.conf
In that file place any httpd.conf statements you want, including but not limited to: SetEnv MYVAR=value... SetEnv OTHERVAR=othervalue...
or maybe:
SetEnv MYVAR=value... </Directory> etc...
Then restart apache: rcapache2 restart
Even if it's just one line this is probably the most correct way to do it, because it's a seperate file you can blindly copy to new machines without worrying about existing files, and updates won't overwrite it.
Bear in mind: a few variables are not settable via SetEnv. PATH can not be set via SetEnv.
Bear in mind: when you manually run "rcapache2 restart", apache (and cgi scripts) picks up the PATH that you currently have while interactively logged in as root, which is entirely different from the PATH that apache gets when started by the rc scripts at boot. So to really test your settings, beleive it or not, reboot.
I have not yet discovered the best way to doctor apache's PATH in apache2 & opensuse.
-- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
----- Original Message ----- From: "Ciro Iriarte"
To: "opensuse" Sent: Monday, August 11, 2008 3:44 PM Subject: [opensuse] Apache2 and environment variables Is there any elegant-already-thought way of setting environment variables for apache2? (that means not touching /etc/init.d/apache2), i've added oci8 support for apache2 on a server and defined variables in '/etc/profile.d' which allows me to start apache2 with oci8 support, BUT if the server is restarted apache2 starts without oci8 module and I have to restart manually.
Regards, Ciro
Ok, tried using SetEnv inside and outside the <directory> tag and it didn't work, probably they are set, but it's too late to help apache load the oci8 module apparently..
If you need to load a module then load a module Add this at the top of oci8.conf LoadModule oci8_module /usr/lib/apache2/mod_oci8.so Change the path & filename as appropriate. Similarly, add whatever else it takes to set up oci8. Any AddHandler, and Directory or Alias directives etc... StEnv are just environment variables because that's what you asked for. Maybe you need directives not environment variables? After the LoadModule, enclose everything that is oci8-specific (basically, everything else period) in: <IfModule mod_oci8.c> ...stuff... So that if the module load fails then at least Apache will still start up instead of crashing on invalid directives. Change the module name as appropriate there too. Surely all necessary apache httpd.conf directives and the exact file names are documented on some oci8 site somewhere, merely minus the opensuse particulars? -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org