> On 17 Mar 2016, at 3:24 PM, Druva Ram <[email protected]> wrote:
> 
> Hello,
> 
> 
> 
> I am new to django and apache and mod-wsgi and askbot. Am getting the 
> following error when i start my apache:
> 
> 
> 
> [Tue Mar 15 10:25:42.367470 2016] [:info] [pid 6748:tid 139731953211264] 
> mod_wsgi (pid=6748): Attach interpreter ''.
> 
> [Tue Mar 15 10:25:48.464013 2016] [:info] [pid 6748:tid 139731953211264] 
> mod_wsgi (pid=6748): Shutdown requested 'askbot2'.
> 
> [Tue Mar 15 10:25:48.464132 2016] [:info] [pid 6748:tid 139731953211264] 
> mod_wsgi (pid=6748): Stopping process 'askbot2'.
> 
> [Tue Mar 15 10:25:48.464147 2016] [:info] [pid 6748:tid 139731953211264] 
> mod_wsgi (pid=6748): Destroying interpreters.
> 
> [Tue Mar 15 10:25:48.464157 2016] [:info] [pid 6748:tid 139731953211264] 
> mod_wsgi (pid=6748): Cleanup interpreter ''.
> 
> [Tue Mar 15 10:25:48.466515 2016] [:info] [pid 6748:tid 139731953211264] 
> mod_wsgi (pid=6748): Terminating Python.
> 
> [Tue Mar 15 10:25:48.468269 2016] [:info] [pid 6748:tid 139731953211264] 
> mod_wsgi (pid=6748): Python has shutdown.
> 
> [Tue Mar 15 10:25:49.662133 2016] [:info] [pid 6868:tid 139779358148480] 
> mod_wsgi (pid=6868): Attach interpreter ''.
> 
> [Tue Mar 15 10:26:29.357548 2016] [:info] [pid 6868:tid 139779358148480] 
> mod_wsgi (pid=6868): Shutdown requested 'askbot2'.
> 
> [Tue Mar 15 10:26:29.357727 2016] [:info] [pid 6868:tid 139779358148480] 
> mod_wsgi (pid=6868): Stopping process 'askbot2'.
> 
> [Tue Mar 15 10:26:29.357752 2016] [:info] [pid 6868:tid 139779358148480] 
> mod_wsgi (pid=6868): Destroying interpreters.
> 
> [Tue Mar 15 10:26:29.357771 2016] [:info] [pid 6868:tid 139779358148480] 
> mod_wsgi (pid=6868): Cleanup interpreter ''.
> 
> [Tue Mar 15 10:26:29.362974 2016] [:info] [pid 6868:tid 139779358148480] 
> mod_wsgi (pid=6868): Terminating Python.
> 
> [Tue Mar 15 10:26:29.367527 2016] [:info] [pid 6868:tid 139779358148480] 
> mod_wsgi (pid=6868): Python has shutdown.
> 
> 

There are no errors in that. That is all sort of normal stuff when shutting 
down or restarting Apache.

> My SITE CONFIG FILE IS AS BELOW :
> 
> 
> 
> 
> 
> #WSGISocketPrefix ${APACHE_RUN_DIR}
> 
> #WSGIPythonHome /usr/local
> 
> 
> 
> <VirtualHost *:8080>
> 
>      DocumentRoot /var/www/testweb
> 
>      ServerAdmin root@localhost
> 
>      ServerName www.testweb.com
> 
> 
> 
>      #aliases to serve static media directly
> 
>      #will probably need adjustment
> 
>      Alias /m/ /var/www/testweb/static/
> 
>      Alias /upfiles/  /var/www/testweb/askbot/upfiles/
> 
>      Alias /admin/ /var/www/testweb/askbot/admin/
> 
>      <DirectoryMatch "/var/www/testweb/askbot/skins/([^/]+)/media">
> 
>         Order deny,allow
> 
>         Allow from all
> 
>      </DirectoryMatch>
> 
>      <Directory "/var/www/testweb/askbot/upfiles">
> 
>         Order deny,allow
> 
>         Allow from all
> 
>      </Directory>
> 
>      #must be a distinct name within your apache configuration
> 
>      WSGIDaemonProcess askbot2 user=www-data group=www-data
> 
>      WSGIProcessGroup askbot2
> 
> 

If using daemon mode and only the one application, you should always also use:

WSGIApplicationGroup %{GLOBAL}
>      WSGIScriptAlias / /var/www/testweb/django.wsgi
> 
>      #make all admin stuff except media go through secure connection
> 
>     # <LocationMatch "/admin(?!/media)">
> 
>     # RewriteEngine on
> 
>         # RewriteRule /admin(.*)$ https://localhost/admin$1 [L,R=301]
> 
>          #</LocationMatch>
> 
>      CustomLog /var/log/apache2/access_log common
> 
>      ErrorLog /var/log/apache2/error_log
> 
>      LogLevel debug
> 
> </VirtualHost>
> 
> 
> 
> One more thing is when i uncomment the WSGIPythonHome i get an error in the 
> logs saying: IMPORT Error: No module named site
> 
> 

Your issue is likely going to be that mod_wsgi is compiled for a specific 
Python version. For that Ubuntu version, I would guess Python 2.7.

Underneath /usr/local you do not have a Python installation for version 2.7 and 
thus why it is failing.

You also can’t simply point mod_wsgi at a different Python installation you may 
have installed from source code like that anyway. What Python mod_wsgi was 
compiled against may not be compatible as far as options set when Python was 
installed.

If you want to use a separate Python installation, you should uninstall the 
packaged mod_wsgi version and then build and install mod_wsgi from source code 
against the alternate version.

So explain what it is you are trying to do and why you are setting 
WSGIPythonHome for in the first place.

Graham
> Am stuck at this point not knowing how to proceed further to get this 
> working. AM using Ubuntu 14.04 LTS.
> 
> 
> 
> Appreciate any kind of help received.
> 
> 
> 
> 
> 
> Thanks 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to