sudo apt-get install apache2 sudo apt-get install libapache2-mod-wsgi
/var/www/yo/public_html# cat yo.wsgi
def application(environ, start_response):
status = '200 OK'
output = 'Yo World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
/etc/apache2/sites-available# cat yo.conf
<VirtualHost *:80>
ServerName yohost
# WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
DocumentRoot /var/www/yo/public_html
<Directory /var/www/yo/public_html>
# WSGIProcessGroup cwpmash
# WSGIApplicationGroup %{GLOBAL}
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
/etc/apache2/sites-available# ls ../sites-enabled/
000-default.conf yo.conf
[Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] mod_wsgi (pid=2305): Destroying interpreters.
[Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] mod_wsgi (pid=2305): Cleanup interpreter ''.
[Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] mod_wsgi (pid=2306): Destroying interpreters.
[Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] mod_wsgi (pid=2306): Cleanup interpreter ''.
[Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] mod_wsgi (pid=2305): Terminating Python.
[Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] mod_wsgi (pid=2306): Terminating Python.
[Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] mod_wsgi (pid=2305): Python has shutdown.
[Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] mod_wsgi (pid=2306): Python has shutdown.
[Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 139868472567680] AH00096: removed PID file /var/run/apache2/apache2.pid (pid=2302)
[Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 139868472567680] AH00491: caught SIGTERM, shutting down
[Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Thu Sep 25 13:04:47.348963 2014] [mpm_event:info] [pid 2484:tid 140368719771520] AH00490: Server built: Jul 22 2014 14:36:38
[Thu Sep 25 13:04:47.349000 2014] [core:notice] [pid 2484:tid 140368719771520] AH00094: Command line: '/usr/sbin/apache2'
[Thu Sep 25 13:04:47.349215 2014] [:info] [pid 2487:tid 140368719771520] mod_wsgi (pid=2487): Initializing Python.
[Thu Sep 25 13:04:47.351673 2014] [:info] [pid 2488:tid 140368719771520] mod_wsgi (pid=2488): Initializing Python.
[Thu Sep 25 13:04:47.371271 2014] [:info] [pid 2487:tid 140368719771520] mod_wsgi (pid=2487): Attach interpreter ''.
[Thu Sep 25 13:04:47.372339 2014] [:info] [pid 2488:tid 140368719771520] mod_wsgi (pid=2488): Attach interpreter ''.
I am trying to follow the instructions for running the mod_wsgi hello world application:
https://code.google.com/p/modwsgi/wiki/WhereToGetHelp
I installed apache2 and libapache2-mod-wsgisudo apt-get install apache2 sudo apt-get install libapache2-mod-wsgi
My wsgi hello world:/var/www/yo/public_html# cat yo.wsgi
def application(environ, start_response):
status = '200 OK'
output = 'Yo World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
My virtualhost:/etc/apache2/sites-available# cat yo.conf
<VirtualHost *:80>
ServerName yohost
# WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
DocumentRoot /var/www/yo/public_html
Please help. What am I doing wrong?
...
Thank you for the fast response.
The failure is that I can not browse to my hello world app, and see the expected response "Yo World".
yohost is in my hosts files (tied currently to 127.0.0.1).. pingable and resolvable.
i've tried to get to the site using wget
wget http://yohost/yo
I am able to wget the base apache page
wget http://yohost
Should I see anything in a log somewhere that would indicate that yo.wsgi has been loaded?
Is the SIGTERM that you see in the error.log related to wsgi?
I did notice that I still see that even when i disable my yohost site. It does seem however that mod_wsgi is running, starting pything, and attaching interpreters. I would have thought that some log would say "mod_wsgi... loading yo", or something akin to that.
--
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 modwsgi+u...@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.
...
...
...
...
root@sensis-8930:/etc/apache2# telnet yohost 80
Trying 127.0.1.1...
Connected to sensis-8930.corp.sensis.com.
Escape character is '^]'.
GET /yo HTTP/1.0
Host: yohost
HTTP/1.1 200 OK
Date: Thu, 25 Sep 2014 14:31:54 GMT
Server: Apache/2.4.7 (Ubuntu)
Content-Length: 9
Vary: Accept-Encoding
Connection: close
Content-Type: text/plain
Yo World!Connection closed by foreign host.
...
...