0

I have a Debian 11 system with Apache2 2.4.6.2, mod_wsgi 4.7.1 and Python 3.9. I want to run two different Django projects under the same Apache2 server, and in the same virtual host as outlined e.g. here:

http://www.tobiashinz.com/2019/04/10/apache-django-virtualenv.html

The following additions in the apache2.conf have worked fine to get one Django project online:

WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess myapp python-home=/var/www/myproj/venv3/ python-path=/var/www/myproj/myproj
WSGIProcessGroup myapp
WSGIScriptAlias / /var/www/myproj/myproj/wsgi.py

To configure the second Django, I first tried to move the configuration of the first project to a virtual host section. However, if I move the configurations to a virtual host in available-sites (e.g. in 000-default.conf), I do not get any error message (e.g. in the apache error log), but instead of my Django project, I see the default apache2 landing page ("It works!"), even if I comment out DocumentRoot. Am I missing something?

asked Feb 6, 2025 at 11:07

1 Answer 1

0

I fixed it after trying to reproduce it in a new VM. The problem was that I put the WSGI config bits into the VirtualHost for port 80. It contains a Rewrite to forward everything to an SSL-secured connection. Thus, I needed to put the WSGI parameters into the VirtualHost at port 443.

answered Feb 10, 2025 at 12:53
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.