Question

Mod_wsgi (19) Permission denied while deploying a django application using Apache

Hello guys, I am quite new to Linux so your help and patience is very much appreciated.

I have been trying to deploy a django website on an Ubuntu instance. I have successfully setup an apache configuration file, and then removed the secret token from the settings.py file in the django project, putting it somewhere safe. When I tried to check if my website was working, it gave me this error in apache error.log file:

https://prnt.sc/_rv3zM3Z0K5x

I have checked the configuration file to make sure that the path was the correct the one. I am sharing a screenshot of that apache configuration as well for reference:

https://prnt.sc/x3vMom5VyIM2

I have tried running chown and chmod on both the venv in that directory and also on the main directory. I also ran ls -la to see if the permissions are correct as shown in this screenshot:

https://prnt.sc/eRfj0b1DOQj-

Unfortunately, as I am still a beginner, I couldn’t have figured out what the next steps should be. I did try looking at stack overflow and different articles, but a lot of them are not very specific to the issue I am facing.

Your help and guidance would be much appreciated, thank so much in advance for it.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @fliper05,

Most likely the issue is coming from filesystem permissions with Apache user unable to read from where the WSGI script file is or read the WSGI script file itself.

This specific error is described in the presentation:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations