VirtualHost pointant le même projet Django (mod_wsgi)
Bonjour,
J'ai essayer de configurer apache de façon à obtenir :
- site.com, www.site.com => /home/user/projects/www/www/wsgi.py
- test.site.com => /home/user/projects/test/www/wsgi.py
Le dossier "/home/.../test" est un copier-coller de "/home/.../www", mais les fichiers du dossier test sont bien modifiés pour pointer sur le dossier test, l'erreur ne doit pas venir de là.
Mon fichier apache ressemble à ceci :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| NameVirtualHost 0.4.1.3 #(<= oui, c'est juste un exemple. L'hébergement ne permet pas le fonctionnement avec le classique *:80)
<VirtualHost 0.4.1.3>
ServerName test.site.com
ServerAdmin admin@exemple.com
Alias /static/ /home/user/projects/test/static/
Alias /media/ /home/user/projects/test/media/
WSGIDaemonProcess test python-path=/home/user/projects/test:/path/to/lib/python2.7/site-packages
WSGIProcessGroup test
WSGIScriptAlias / /home/user/projects/test/www/wsgi.py process-group=test
<Directory /home/user/projects/test/>
Order deny,allow
Allow from all
</Directory>
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/test_error.log
CustomLog ${APACHE_LOG_DIR}/test_access.log combined
</VirtualHost>
<VirtualHost 0.4.1.3>
ServerName site.com
ServerAlias site.com
ServerAdmin admin@exemple.com
Alias /static/ /home/user/projects/test/static/
Alias /media/ /home/user/projects/test/media/
WSGIDaemonProcess www python-path=/home/user/projects/www:/path/to/lib/python2.7/site-packages
WSGIProcessGroup www
WSGIScriptAlias / /home/user/projects/www/www/wsgi.py process-group=www
<Directory /home/user/projects/www/>
Order deny,allow
Allow from all
</Directory>
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/www_error.log
CustomLog ${APACHE_LOG_DIR}/www_access.log combined
</VirtualHost> |
Avec cette configuration je tombe toujours sur le site du dossier "/home/.../www", que ce soit sur site.com, test.site.com ou trucmuche.site.com
Un peu d'aide serait la bienvenue :)