I'm a newbie to apache. So I'm trying to run at least two different django projects on one Ubuntu Server with a single IP address.
- IP: 123.456.789
- Domain 1: www.example.de for Project1
- Domain 2: www.test.de for Proejct2
The DNS for both domains is pointing on the same IP Address. I'm using apache2 with mod_wsgi in Daemon mode. Each Project has its own directory in ~/. I've also installed a virtaulenv with python inside the Project directorys
The problem is that no matter how I configurate the apache2.conf, both domains point to Project1. What is weird is that they even do when it when I comment all the custom settings in apache2.conf. Can someone please explain this?
here is my apache2.conf
Listen 80
<VirtualHost *:80>
ServerName www.example.de
WSGIScriptAlias / /home/user/example/example-project/wsgi.py
Alias /static/ /home/user/example/static/
WSGIPythonPath /home/user/example
<Directory /home/user/example/static>
Require all granted
</Directory>
<Directory /home/user/example/example>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess example.de python-path=/home/user/example:/home/user/example/exampleenv/lib/python2.7/site-packages
WSGIProcessGroup example.de
</VirtualHost>
Listen 8080
<VirtualHost *:80>
Servername www.test.de
WSGIScriptAlias / /home/user/test/test-project/wsgi.py
Alias /static/ /home/user/test/static/
<Directory /home/user/test/static>
Require all granted
</Directory>
<Directory /home/user/test/test-project>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess test.de python-path=/home/user/test:/home/user/test/testenv/lib/python2.7/site-packages
WSGIProcessGroup test.de
</VirtualHost>
Even if there is something wrong with my config, why does it still run when i comment everything in this blog? Where else is apache getting the information from?