What do you actually have in the directory: /home/nitin/wsgi-scripts
Up till now you have given the impression you only have a single WSGI application script file called index.py. You are now mentioning a home.py file, which suggests you have more than one WSGI script file in that directory. Your prior description overall of what you expect to happen when you visit different URLs therefore appears to be incomplete. So can you describe better how your overall WSGI application hangs together and whether you are using one WSGI script file with some sort of framework which does routing or whether you have separate WSGI script files for different URLs. If you have multiple WSGI script files, then the configuration required would be different. If you don't but you are not using a framework, then you are likely not constructing relative links for access over resources in your application correctly. Graham On 23/01/2015, at 6:54 AM, nitin chandra <[email protected]> wrote: > After saying Thank You, can I still ask for a way to resolve my issue ? :P > > The page is displayed, but the subsequent links to other page do not > load those pages. The same page reloads or refreshes. Like Index / > log-in page, after entering the username and password, remains the > same. > > Renamed my home.py to index.py, which has more links, none of the > linksp page opened. Same page, index.py / home.py, page renders. > > =============================================== > > Below is from apache error.log > > [Fri Jan 23 00:50:22.963557 2015] [core:notice] [pid 11649] AH00094: > Command line: '/usr/sbin/apache2' > [Fri Jan 23 01:07:28.628276 2015] [mpm_prefork:notice] [pid 11649] > AH00169: caught SIGTERM, shutting down > [Fri Jan 23 01:07:29.807991 2015] [mpm_prefork:notice] [pid 11945] > AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 mod_wsgi/3.4 > Python/2.7.6 configured -- resuming normal operations > [Fri Jan 23 01:07:29.808091 2015] [core:notice] [pid 11945] AH00094: > Command line: '/usr/sbin/apache2' > [Fri Jan 23 01:11:31.669262 2015] [mpm_prefork:notice] [pid 11945] > AH00169: caught SIGTERM, shutting down > [Fri Jan 23 01:11:32.740238 2015] [mpm_prefork:notice] [pid 12162] > AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 mod_wsgi/3.4 > Python/2.7.6 configured -- resuming normal operations > [Fri Jan 23 01:11:32.740330 2015] [core:notice] [pid 12162] AH00094: > Command line: '/usr/sbin/apache2' > > ===================================================== > Mongodb logs > > 2015-01-23T00:50:44.031+0530 [clientcursormon] connections:3 > 2015-01-23T00:50:44.128+0530 [initandlisten] connection accepted from > 127.0.0.1:46995 #12 (4 connections now open) > 2015-01-23T00:50:44.129+0530 [conn12] end connection 127.0.0.1:46995 > (3 connections now open) > 2015-01-23T00:50:44.240+0530 [initandlisten] connection accepted from > 127.0.0.1:46996 #13 (4 connections now open) > 2015-01-23T00:50:44.241+0530 [conn13] end connection 127.0.0.1:46996 > (3 connections now open) > 2015-01-23T00:50:45.675+0530 [initandlisten] connection accepted from > 127.0.0.1:46997 #14 (4 connections now open) > 2015-01-23T00:50:45.676+0530 [conn14] end connection 127.0.0.1:46997 > (3 connections now open) > 2015-01-23T00:50:45.707+0530 [initandlisten] connection accepted from > 127.0.0.1:46998 #15 (4 connections now open) > 2015-01-23T00:50:45.711+0530 [conn15] end connection 127.0.0.1:46998 > (3 connections now open) > 2015-01-23T00:52:42.450+0530 [PeriodicTaskRunner] task: > DBConnectionPool-cleaner took: 11ms > 2015-01-23T00:52:42.544+0530 [PeriodicTaskRunner] task: > WriteBackManager::cleaner took: 45ms > 2015-01-23T00:53:44.070+0530 [clientcursormon] mem (MB) res:15 virt:1193 > 2015-01-23T00:53:44.070+0530 [clientcursormon] mapped (incl journal view):992 > 2015-01-23T00:53:44.070+0530 [clientcursormon] connections:3 > 2015-01-23T00:55:56.630+0530 [initandlisten] connection accepted from > 127.0.0.1:47029 #16 (4 connections now open) > 2015-01-23T00:55:57.141+0530 [conn16] end connection 127.0.0.1:47029 > (3 connections now open) > 2015-01-23T00:55:57.710+0530 [initandlisten] connection accepted from > 127.0.0.1:47030 #17 (4 connections now open) > 2015-01-23T00:55:57.712+0530 [conn17] end connection 127.0.0.1:47030 > (3 connections now open) > 2015-01-23T00:58:44.088+0530 [clientcursormon] mem (MB) res:14 virt:1193 > 2015-01-23T00:58:44.088+0530 [clientcursormon] mapped (incl journal view):992 > 2015-01-23T00:58:44.088+0530 [clientcursormon] connections:3 > 2015-01-23T01:03:44.106+0530 [clientcursormon] mem (MB) res:14 virt:1193 > 2015-01-23T01:03:44.106+0530 [clientcursormon] mapped (incl journal view):992 > 2015-01-23T01:03:44.106+0530 [clientcursormon] connections:3 > 2015-01-23T01:08:44.125+0530 [clientcursormon] mem (MB) res:14 virt:1193 > 2015-01-23T01:08:44.125+0530 [clientcursormon] mapped (incl journal view):992 > 2015-01-23T01:08:44.125+0530 [clientcursormon] connections:3 > 2015-01-23T01:13:44.143+0530 [clientcursormon] mem (MB) res:14 virt:1193 > 2015-01-23T01:13:44.144+0530 [clientcursormon] mapped (incl journal view):992 > 2015-01-23T01:13:44.144+0530 [clientcursormon] connections:3 > 2015-01-23T01:18:44.162+0530 [clientcursormon] mem (MB) res:14 virt:1193 > 2015-01-23T01:18:44.162+0530 [clientcursormon] mapped (incl journal view):992 > 2015-01-23T01:18:44.162+0530 [clientcursormon] connections:3 > > > > > > On 22 January 2015 at 21:45, nitin chandra <[email protected]> wrote: >> YES ...!! THANK YOU VERY MUCH !!!! >> >> Now I need to re-code as per latest mongodb functions. :P >> >> But yes, at least the pages are getting rendered. >> >> On 22 January 2015 at 15:19, Graham Dumpleton >> <[email protected]> wrote: >>> >>> On 22/01/2015, at 7:38 PM, nitin chandra <[email protected]> wrote: >>> >>> It is still showing the code of "index.py" file. >>> >>> If I set DocumentRoot / --> it gives a 403 error. >>> >>> >>> I didn't say to set DocumentRoot to '/'. I said to leave it unset, and >>> therefore falling back to whatever DocumentRoot is set to that server level >>> outside of the VirtualHost. Or create an empty directory on the file system >>> and have it set to that. Or simply set it to the Apache default directory. >>> >>> >>> ------------------------------------------------------------- >>> my /etc/hosts file is set as follows : >>> >>> nitin@nitin:~$ cat /etc/hosts >>> 127.0.0.1 localhost >>> 127.0.1.1 nitin >>> 127.0.1.1 www.healthcare.in >>> 127.0.1.1 healthcare.in >>> ------------------------------------------------------------ >>> apache 000-default.conf file: >>> >>> <VirtualHost 127.0.0.1:80> >>> >>> 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> >>> ServerName www.healthcare.in >>> ServerAlias healthcare.in >>> WSGIDaemonProcess healthcare.in processes=6 threads=15 >>> display-name=%{GROUP} >>> WSGIProcessGroup healthcare.in >>> WSGIScriptAlias / /home/nitin/wsgi-scripts/index.py >>> <Directory /home/nitin/wsgi-scripts> >>> Order allow,deny >>> Allow from all >>> </Directory> >>> >>> ServerAdmin webmaster@localhost >>> #DocumentRoot /var/www/html >>> >>> ErrorLog ${APACHE_LOG_DIR}/error.log >>> CustomLog ${APACHE_LOG_DIR}/access.log combined >>> >>> </VirtualHost> >>> >>> >>> This doesn't match what I said to try. >>> >>> I would also stop using an IP address in the VirtualHost. It more often that >>> not just causes problems and you keep changing it and showing it >>> differently. >>> >>> Since you are on Apache 2.4, also use new access control directives from >>> Apache 2.4. If you don't have the appropriate compatibility module in place >>> the old Apache 2.2 directives may not work. So try: >>> >>> <VirtualHost *:80> >>> ServerName www.healthcare.in >>> ServerAlias healthcare.in >>> ServerAdmin webmaster@localhost >>> DocumentRoot /var/www/html >>> WSGIDaemonProcess healthcare.in processes=6 threads=15 display-name=%{GROUP} >>> WSGIProcessGroup healthcare.in >>> WSGIScriptAlias / /home/nitin/wsgi-scripts/index.py >>> <Directory /home/nitin/wsgi-scripts> >>> Require all granted >>> </Directory> >>> >>> ErrorLog ${APACHE_LOG_DIR}/error.log >>> CustomLog ${APACHE_LOG_DIR}/access.log combined >>> >>> </VirtualHost> >>> >>> For exactly that, if there is an error, then say what error messages there >>> was in the Apache error log and not just that you got a particular status in >>> the browser. >>> >>> Make sure there are no other VirtualHost's being defined in the Apache >>> configuration which are screwing things up. >>> >>> Graham >>> >>> >>> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet >>> >>> On 22 January 2015 at 03:57, Graham Dumpleton >>> <[email protected]> wrote: >>> >>> >>> I just want to server my site from /wsgi-scripts/index.py from ONLY one URL. >>> >>> / --> /home/nitin/wsgi-scripts/ >>> >>> >>> Your second line here doesn't really match the explanation of the first. >>> >>> If that is all you want is for the WSGI application contained in the >>> index.py file to be available at the root of the web site, then all you need >>> is: >>> >>> <VirtualHost 127.0.1.1:80> >>> ServerName www.healthcare.in >>> ServerAlias healthcare.in >>> WSGIDaemonProcess healthcare.in processes=6 threads=15 display-name=%{GROUP} >>> WSGIProcessGroup healthcare.in >>> WSGIScriptAlias / /home/nitin/wsgi-scripts/index.py >>> <Directory /home/nitin/wsgi-scripts> >>> Order allow,deny >>> Allow from all >>> </Directory> >>> ServerAdmin webmaster@localhost >>> #DocumentRoot /var/www/html >>> >>> ErrorLog ${APACHE_LOG_DIR}/error.log >>> CustomLog ${APACHE_LOG_DIR}/access.log combined >>> >>> </VirtualHost> >>> >>> Note, DO NOT set DocumentRoot to where your source code files are. Allow it >>> to default to the empty DocumentRoot directory for the whole server, or if >>> there is stuff in that you do not want exposed, then create a new empty >>> directory with nothing in it, and set DocumentRoot to refer to is. >>> >>> Graham >>> >>> >>> -- >>> 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.
