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.