On 21/01/2015, at 5:28 PM, nitin chandra <[email protected]> wrote:
> Thanks Graham, > > I shall start compiling the two. > > Apache is running fine (I guess). It is the mod_wsgi which is crashing > (guessing again). > > When I restart apache there is a ServerName warning, not error. In my > /etc/hosts I have an entry ... 127.0.1.1 www.healthcare.in > > When I open the browser and type "healthcare.in", it shows Download > the file ... dialog box in FireFox and on chrome it dumps the code. Okay, I have gotten confused about what you are saying was the issue. When you used the word 'dumped' I wrongly got the impression you were trying to say that Apache was 'dumping core' and crashing. Now whether you get a save as dialog, or it displays it, what you are saying is you see the Python source code? In doing that though, what exact URL are you using to access the site, including host name? The problem is likely because you have muddled up your configuration and trying to use both WSGIScriptAlias and DocumentRoot/AddHandler at the same time. Quoting your configuration: <VirtualHost 127.0.1.1:80> ServerName www.healthcare.in DocumentRoot "/home/nitin/wsgi-scripts" <Directory "/home/nitin/wsgi-scripts"> Options +Indexes +FollowSymLinks +MultiViews +ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex index.html index.wsgi index.py </IfModule> ServerAlias healthcare.in Redirect / http://www.healthcare.in/index.py WSGIDaemonProcess healthcare.in processes=6 threads=15 display-name=%{GROUP} WSGIProcessGroup healthcare.in WSGIScriptAlias /wsgi-scripts/ /home/nitin/wsgi-scripts/index.py <Directory /home/nitin/wsgi-scripts> Options +Indexes +MultiViews +FollowSymLinks +ExecCGI Order allow,deny Allow from all AddHandler wsgi-script .py WSGIProcessGroup healthcare.in </Directory> ServerAdmin webmaster@localhost #DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> So if someone accesses '/wsgi-scripts/', it may run the WSGI application in index.py in the directory /home/nitin/wsgi-scripts. At the same time, if someone accesses '/index.py', it may run the same WSGI application in index.py in the directory /home/nitin/wsgi-scripts. Then you have the redirect for '/' which confuses everything and which redirects to '/index.py' but with '/' being a prefix would likely end up in a redirect loop. Just because you say ServerAlias doesn't mean the fix follow it only apply to when that server alias is used. So you have overlapping/conflicting configuration as well as duplicated things in multiple places. Please explain exactly what you expect different URLs to do. That is for: / /index.py /wsgi-scripts /wsgi-scripts/ > Also, can I request which version of mod_wsgi is compatible with Apache 2.4.x > ? > > I also tried 'pip install mod_wsgi', it downloaded 4.4 but could not find > apxs. The PyPi page explains the system requirement of needing to have the Apache dev package installed for your Apache installation. If you do not then apxs will not be found. Graham > Thx > > > On 21 January 2015 at 04:08, Graham Dumpleton > <[email protected]> wrote: >> I am not sure there is much I can do to help you. >> >> Ubuntu is shipping a version of mod_wsgi which is well over 2 years old and >> about 20 versions behind. >> >> I also have no idea what version of Apache their mod_wsgi binary was >> compiled for. The issue could well be that you need to update your Apache >> package as well. >> >> If though the issue is that they have updated Apache and back ported changes >> which change the ABI, they may need to provide a recompiled version of >> mod_wsgi against the patched Apache version. >> >> If you read: >> >> * http://blog.dscpl.com.au/2015/01/important-modwsgi-information-about.html >> >> this could be the issue, although at this point I don't believe mod_wsgi 3.X >> should have been affected. I don't rule out that Ubuntu could have mucked up >> things in doing back porting of changes so as to cause mod_wsgi to crash >> anyway. >> >> Anyway, an initial question to start working out problem. >> >> Is this Apache which is crashing on initial startup, or is a mod_wsgi daemon >> process crashing on the first request? >> >> Graham >> >> On 21/01/2015, at 1:01 AM, nitin chandra <[email protected]> wrote: >> >>> Hi All, >>> >>> I had to re-install the Apache, so did apt-get with apache and mod_wsgi. >>> >>> nitin@nitin:/var/log/apache2$ apache2 -v >>> Server version: Apache/2.4.7 (Ubuntu) >>> Server built: Jul 22 2014 14:36:38 >>> >>> libapache2-mod-wsgi_3.4-4ubuntu2.1.14.04.2_amd64.deb >>> >>> nitin@nitin:/var/log/apache2$ python >>> Python 2.7.6 (default, Mar 22 2014, 22:59:56) >>> [GCC 4.8.2] on linux2 >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> I am getting this in my apache error.log >>> >>> [Tue Jan 20 14:17:16.128911 2015] [core:notice] [pid 7716] AH00094: >>> Command line: '/usr/sbin/apache2' >>> [Tue Jan 20 18:10:52.196255 2015] [mpm_prefork:notice] [pid 7716] >>> AH00169: caught SIGTERM, shutting down >>> [Tue Jan 20 18:10:53.206180 2015] [mpm_prefork:notice] [pid 8994] >>> AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 mod_wsgi/3.4 >>> Python/2.7.6 configured -- resuming normal operations >>> [Tue Jan 20 18:10:53.206268 2015] [core:notice] [pid 8994] AH00094: >>> Command line: '/usr/sbin/apache2' >>> >>> on the Browser code is getting dumped. >>> >>> in my 000-default.conf the config lines are : >>> >>> <VirtualHost 127.0.1.1:80> >>> ServerName www.healthcare.in >>> DocumentRoot "/home/nitin/wsgi-scripts" >>> <Directory "/home/nitin/wsgi-scripts"> >>> Options +Indexes +FollowSymLinks +MultiViews +ExecCGI >>> AllowOverride All >>> Order allow,deny >>> Allow from all >>> </Directory> >>> >>> <IfModule dir_module> >>> DirectoryIndex index.html index.wsgi index.py >>> </IfModule> >>> >>> ServerAlias healthcare.in >>> Redirect / http://www.healthcare.in/index.py >>> WSGIDaemonProcess healthcare.in processes=6 threads=15 >>> display-name=%{GROUP} >>> WSGIProcessGroup healthcare.in >>> WSGIScriptAlias /wsgi-scripts/ /home/nitin/wsgi-scripts/index.py >>> <Directory /home/nitin/wsgi-scripts> >>> Options +Indexes +MultiViews +FollowSymLinks +ExecCGI >>> Order allow,deny >>> Allow from all >>> AddHandler wsgi-script .py >>> WSGIProcessGroup healthcare.in >>> </Directory> >>> ServerAdmin webmaster@localhost >>> #DocumentRoot /var/www/html >>> >>> ErrorLog ${APACHE_LOG_DIR}/error.log >>> CustomLog ${APACHE_LOG_DIR}/access.log combined >>> >>> </VirtualHost> >>> >>> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet >>> >>> -- >>> 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 http://groups.google.com/group/modwsgi. >>> For more options, visit 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 http://groups.google.com/group/modwsgi. >> For more options, visit 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 http://groups.google.com/group/modwsgi. > For more options, visit 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 http://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
