Hello I'm trying to deploy my first Django website using Apache inside of Centos7
Versions:
Apache: 2.4.6
Django: 2.2.6
Python: 3.6.8
My Django project is located inside the /srv directory and looks like this:
/srv/
└── MyApp
├── apps
│ └── index
├── db.sqlite3
├── manage.py
├── media
├── root
│ ├── __init__.py
│ ├── __pycache__
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── static
│ ├── css
│ └── images
└── venv
├── bin
├── include
├── lib
├── lib64 -> lib
├── pip-selfcheck.json
└── pyvenv.cfg
Test I have done:
1) I'm able to access my Django website if I do:
python manage.py runserver 0.0.0.0:80
2) When using only Apache I'm able to see the Apache placeholder website.
3) I've also tried using mod_wsgi without Django following this tutorial (https://www.shellhacks.com/modwsgi-hello-world-example/) and I was able to make it work (only had to replace the following to make it work):
Allow from all --> Require all granted
Order allow,deny --> Satisfy Any
My Apache config file located inside /etc/httpd/conf.d
WSGIScriptAlias / /srv/MyApp/root/wsgi.py
WSGIPythonPath /srv/MyApp
<Directory /srv/MyApp/root>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess myapp.com python-home=/srv/MyApp/root/venv python-path=/srv/MyApp
WSGIProcessGroup myapp.com
I'm pretty new to all of this and I'm sure it might be something stupid that I'm not setting up properly but I've been googling and testing for over 10 hours now and I can't seem to figure this out.
I hope someone could give me some guidance. Many thanks in advance.