I'm running Python scripts as a CGI under Apache 2.2. These scripts rely on environment variables set in my .bashrc to run properly. The .bashrc is never loaded, and my scripts fail.
I don't want to duplicate my bashrc by using a bunch of SETENV commands; the configuration files will easily get out of sync and cause hard-to-find bugs.
I'm running apache as my user, not as root. I'm starting/stopping it manually, so the /etc/init.d script shouldn't matter at all (I think).
Given these constraints, what can I do to have my .bashrc loaded when my CGI is called?
Edit: I use /usr/sbin/apache2ctl to do the restarting.
What? Surely you don't mean that your scripts rely on configurations in some account's personal home directory.
Apache config files can export environment variables to CGI scripts, etc.
Maybe your program is too dependent on too many environment variables. How about supporting a configuration file: /etc/mypythonprogram.rc.  There can be a single environment variable telling the program to use an alternative config file, for flexibility.
Apache httpd doesn't load .bashrc