On 21 January 2015 at 13:00, Graham Dumpleton <[email protected]> wrote: > > 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?
Yes > > In doing that though, what exact URL are you using to access the site, > including host name? http://healthcare.in/wsgi-scripts/index.py > > The problem is likely because you have muddled up your configuration and > trying to use both WSGIScriptAlias and DocumentRoot/AddHandler at the same > time. So I have commented the Redirect and WSGIScriptAlias line. > > 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. Now when I read, I feel so stupid :P of my over enthusiasm. > > Please explain exactly what you expect different URLs to do. That is for: > > / > /index.py > /wsgi-scripts > /wsgi-scripts/ > > I just want to server my site from /wsgi-scripts/index.py from ONLY one URL. / --> /home/nitin/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. I have /etc/apache2/mods-available/ and I have /etc/apache2/mods-enabled/ both have wsgi.conf, wsgi.load. So, is it necessary to install both of them again ? If this compatible configuration works ? > > Graham > >> Thx -- 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.
