So lets start first then with redirection.
If you use the directive Redirect, RedirectTemp or RedirectPermanent the
problem is that the URL path is used as a prefix when matching, so if you use:
RedirectTemp / http://www.healthcare.in/index.py
then it will redirect every URL of the site and when it comes back to the site
on the redirected request, it hits the redirect again and causes a loop. This
therefore cannot be used.
A way around the redirect loop is to apply the directive to just the specific
path of '/'. This can be done using:
<LocationMatch '^/$'>
RedirectTemp / http://www.healthcare.in/index.py
</LocationMatch>
You could also have used mod_rewrite, but this is probably simpler.
Next we need to have files with a .py extension handled as WSGI application
script files. This is done using Options ExecCGI and AddHandler as you were
doing. Thus something like:
<Directory /home/nitin/wsgi-scripts>
Options ExecCGI
AddHandler wsgi-script .py
Order allow,deny
Allow from all
</Directory>
That should be enough. Get rid of the WSGIScriptAlias directive you had.
BTW, do note that because you are using AddHandler, each of the WSGI script
files will run in its own separate sub interpreter. If you don't want that and
they can and should run in the same Python sub interpreter context, you should
also be setting:
WSGIApplicationGroup %{GLOBAL}
Graham
On 24/01/2015, at 8:44 AM, nitin chandra <[email protected]> wrote:
> Most of the time I have followed index.html / index.py as the first
> page of the web page. So, when I '/' to redirect to '/index.py', I
> mean to load the index.py as the first page of the application.
>
> So should I do "/wsgi-scripts/ /home/nitin/wsgi-scripts/" ?
>
> Thx
>
> Nitin
>
> On 24 January 2015 at 02:39, Graham Dumpleton
> <[email protected]> wrote:
>> But you also want '/' to redirect to '/index.py'?
>>
>> Graham
>>
>> On 24/01/2015, at 7:25 AM, nitin chandra <[email protected]> wrote:
>>
>>> On 24 January 2015 at 01:29, Graham Dumpleton
>>> <[email protected]> wrote:
>>>>
>>>> On 24/01/2015, at 3:58 AM, nitin chandra <[email protected]> wrote:
>>>>
>>>>> On 23 January 2015 at 16:33, Graham Dumpleton
>>>>> <[email protected]> wrote:
>>>>>> Why were you even using:
>>>>>>
>>>>>> WSGIScriptAlias /wsgi-scripts/ /home/nitin/wsgi-scripts/index.py
>>>>>>
>>>>>> in the first place?
>>>>>>
>>>>>> What is significant about the /wsgi-scripts/ URL prefix?
>>>>>
>>>>> This was from the previous apache installation which was working. Also
>>>>> then I had configures SSL with this configuration.
>>>>
>>>> That is not really answering the question.
>>>>
>>>> Does your application depend on any part of if being accessible via a URL
>>>> with prefix /wsgi-scripts/ or is it completely fine if that is removed?
>>>
>>> It is completely fine to be removed from URL.
>>>
>>> So if URL shows as
>>>
>>> http://www.healthcare.in/index.py
>>> http://www.healthcare.in/home.py
>>> http://www.healthcare.in/editPatient.py
>>>
>>> Yes Works best.
>>>
>>> NOT Required as below
>>>
>>> http://www.healthcare.in/wsgi-scripts/index.py
>>> http://www.healthcare.in/wsgi-scripts/home.py
>>> http://www.healthcare.in/wsgi-scripts/editPatient.py
>>>
>>>>
>>>> The next configuration I give you still will not have that, so if you are
>>>> for some reason dependent on that, them something else will not work and
>>>> so we go around in circles yet again.
>>>
>>> Sorry. Hope I have been specific and clear above.
>>>
>>>>
>>>> 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.