On 30 July 2011 02:16, [email protected] <[email protected]> wrote:
> Sorry for being so dense, I know just enough about Apache to be dangerous
> and our SysAdmin just quit.
> I'm running RHEL6 with mod_wsgi and Apache 2.2 whith Python 2.6 --  all
> default components.
> there is no envvars or envars file anywhere on the system.
>
> adding the following to /etc/profile (which others said would apply to
> Apache) and rebooting did not make these visible to Apache

Don't believe /etc/profile is used. If envvars doesn't exist, which
file you change depends on the platform.

Could be one of the follow:

   /etc/sysconfig/httpd
   /etc/init.d/httpd
   /etc/init.d/apache

> SQLANY12="/opt/sqlanywhere12"
> export SQLANY12
>
> PATH="$SQLANY12/bin32:${PATH:-}"
> export PATH
> LD_LIBRARY_PATH="$SQLANY12/lib32:${LD_LIBRARY_PATH:-}"
> export LD_LIBRARY_PATH
>
>
> export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
> ------------------------------------------------------------
> my /etc/httpd/conf.d/wsgi.conf has
> LoadModule wsgi_module modules/mod_wsgi.so
>
> WSGIScriptAlias /myapp /var/www/wsgi-scripts/myapp.wsgi
> WSGIScriptAlias /wsgi /var/www/wsgi-scripts
> WSGIPythonPath /var/www/djangodeploy

Not needed since you are using daemon mode and using python-path
option to WSGIDaemonProcess.

> WSGIScriptReloading On

Not needed as is the default.

> #WSGIReloadMechanism Process

Not needed and newer mod_wsgi versions don't even recognise that directive.

> WSGIDaemonProcess djangoapps processes=2 threads=15
> python-path=/var/www/djangodeploy
> WSGIProcessGroup djangoapps
> LogLevel info
> WSGISocketPrefix /var/run/wsgi
>
> <Directory /var/www/wsgi-scripts>
> Order allow,deny
> Allow from all
> </Directory>
>
> #<Directory /var/www/djangodeploy>
> #Order allow,deny
> #Allow from all
> #</Directory>
>
>
> -----------------------------------------------------------------------------
> on an older system running mod_python I have
> <Location "/django/">
>     SetHandler python-program
>     PythonHandler django.core.handlers.modpython
>     SetEnv DJANGO_SETTINGS_MODULE mds30.settings
>     PythonOption django.root /var/www//django/mds30
>     PythonPath "['/var/www/django'] + sys.path"
>     PythonDebug On
>     PythonAutoReload On
> </Location>
>
> Now I really don't comprehend the difference between the Location and the
> Directory directives, but can i put the equivalent of the  "SetEnv ..."
> statements in the wsgi.conf  <Directory settings?

SetEnv can be put in mod_wsgi but it only results in variables going
into per request environ and not os.environ.

It was a hack in mod_python Django adapter that SetEnv variables got
pushed to os.environ. It is actually really bad practice to update
os.environ on every request for a persistent process like Django was
doing in their mod_python adapter.

Graham

> logging os.environ returns {'LANG': 'C', 'CONSOLETYPE': 'vt', 'TERM':
> 'linux', 'SHLVL': '3', 'runlevel': '5', 'UPSTART_EVENTS': 'runlevel',
> 'PREVLEVEL': 'N', 'LANGSH_SOURCED': '1', 'UPSTART_INSTANCE': '', 'PWD': '/',
> 'RUNLEVEL': '5', 'UPSTART_JOB': 'rc', 'PATH':
> '/sbin:/usr/sbin:/bin:/usr/bin', 'HOME': '/var/www', '_': '/usr/sbin/httpd',
> 'previous': 'N'}
>  even after a brute force attempt in my wsgi script as follows:
> os.environ['SQLANY12'] = '/opt/sqlanywhere12'
> os.environ['PATH'] = '/opt/sqlanywhere12/bin32:'+os.environ['PATH']
> os.environ['LD_LIBRARY_PATH'] =
> '/opt/sqlanywhere12/lib32:'+os.environ['LD_LIBRARY_PATH']
>
>
> I't apparent that I'm failing to set the environment variables when running
> as Apache.
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/qLeOsHe3ES4J.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to