Tuesday, January 29, 2019

Re: Django, mod_wsgi and apache2.4 = 403 forbidden

I have no experience in configure apache. But these two lines have conflict.

    DocumentRoot C:\Frontier_Website\FATWebsite\FrontierWebApp\zigview\templates\FrounterWeb
and:
    WSGIScriptAlias / C:\Frontier_Website\FATWebsite\FrontierWebApp\FrounterWeb\wsgi.py

Both of these lines tell apache how to handle the /
But for the first one you did not grant access to it's folder and you shouldn't
So you should remove the first line. I mean DocumentRoot. You do not need it when you are configure your django site at root ( / )

On Tuesday, January 29, 2019 at 11:12:22 AM UTC+3:30, Rookies DJ wrote:
I'm sorry if I'm asking the repetitive but i really need assistance I been trying to setup a server for my company system but I had no progress. 

As the tile subject mention the I'm Using Mod_wsgi 4.6.5 and Apache 2.4

for my Django is 2.1 and python 3.7

When try to run on my local machine I get 403 and I did many google search and the only answer I get is add in Require all granted which I had already add in. you could see below for particle section for my Apache http

LoadModule wsgi_module "C:\users\user\appdata\local\programs\python\python37\lib\site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
WSGIScriptAlias / "C:\Frontier_Website\FrounterWebApp\FrounterWeb\wsgi.py"\
WSGIPythonPath "C:\Frontier_Website\FrounterWebApp\zigview"
WSGIPythonHome "C:\Users\user\AppData\Local\Programs\Python\Python37"

<Directory C:\Frontier_Website\FrounterWebApp\zigview\static>
Require all granted
</Directory>

<Directory C:\Frontier_Website\FrounterWebApp\FronterWeb>
<Files wsgi.py>
Require all granted
</Files>
</Directory>


for more detail you can look at at code in stackoverflow.com:
 
  
I had try to run the system in virtualenv but I get no result as well and when I try to start the server, I get this error: The system cannot find the path specified.
The virtualenv code is below;

#python and mod_wsgi setting 
<VirtualHost *:86>
 ServerName Localhost.com 
 DocumentRoot C:\Frontier_Website\FATWebsite\FrontierWebApp\zigview\templates\FrounterWeb
LoadModule wsgi_module C:\users\user\appdata\local\programs\python\python37\lib\site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd
WSGIScriptAlias / C:\Frontier_Website\FATWebsite\FrontierWebApp\FrounterWeb\wsgi.py
WSGIPythonHome C:\Frontier_Website\FATWebsite\Lib
WSGIPythonPath C:\Frontier_Website\FrounterWebApp\zigview

Alias /static \Frontier_Website\FATWebsite\FrounterWebApp\zigview\static
<Directory C:\Frontier_Website\FATWebsite\FrounterWebApp\zigview\static>
Require all granted
</Directory>

<Directory C:\Frontier_Website\FATWebsite\FrounterWebApp\FronterWeb\wsgi-script>
<Files wsgi.py>
   Require all granted
</Files>

</Directory>
</VirtualHost> 
 
Please help I had been trying to solve this problem for month now

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/aba38722-89e1-455a-a536-8713b79c39c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment