Retourner aux forums || Retourner au forum Linux.general

Linux.general : Utiliser WSGI avec Apache

Posté par Morreale Jean Roc () le 08 août 2008
0
J'essaye d'installer le mod WSGI pour Apache afin de pouvoir utiliser le logiciel MapFish, mais je me prend immanquablement un mur taggé 404 avec un simple hello world.

I/ Environnement

Apache/2.2.9 (Mandriva Linux/PREFORK-7mdv2009.0)

Utilisation du serveur par défaut
# vi /etc/httpd/conf/httpd.conf
ServerName localhost:80
DocumentRoot "/var/www/html"

# vi /etc/hosts
127.0.0.1 jerash.localhost
# lynx http://jerash.localhost/ It works !

# ls /var/www/
cgi-bin/ drupal/ error/ geoweb/ html/ icons/ perl/

#ls /var/www/geoweb/
GAS/ mapfish/

II/ WSGI

1. Installation du module apache-mod_wsgi via urpmi

2. Chargement du module par "LoadModule wsgi_module modules/mod_wsgi.so" dans /etc/httpd/conf/httpd.conf

3. Création d'un fichier mapfish.wsgi dans ./geoweb/mapfish

#
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]


4. Ajout de directives dans httpd.conf

< Directory "/var/wwww/geoweb/mapfish/" >
WSGIProcessGroup mapfish
Order allow,deny
Allow from all
< /Directory >
WSGIScriptAlias /mapfish /var/wwww/geoweb/mapfish
WSGIDaemonProcess mapfish threads=25


5. Résultat final : # lynx http://jerash.localhost/ Error 404

III/ Quelques sources
http://code.google.com/p/modwsgi/wiki/ConfigurationGuideline(...)
http://wiki.pylonshq.com/display/pylonscookbook/mod_wsgi+and(...)
http://trac.mapfish.org/trac/mapfish/wiki/HowToMapFishServer(...)

> Lire le message (1 commentaire, moyenne: 1).  

Note : les commentaires appartiennent à ceux qui les ont postés. Nous n'en sommes pas responsables.

Config d'apache

Posté par d-jo (page perso, ) le 11/08/2008 à 23:37. (lien). Évalué à 1.

Si apache ne sert pas l'index qui est dans /var/www/html
C'est que :
_ il n'y en a pas (d'ou le 404)
_ il ne va pas le chercher là (un include dans ta conf ?)
_ il n'est pas reconnu comme un index (Directive DriectoryIndex)
_ L'acces est interdit (droit unix, Deny From All dans un .htaccess ou un fichier include dans ta conf)

Donc que donne :
ls -la /var/www/html/ est la premiere des choses à voir.
La seconde est de tout commenter dans ta conf pour voir quand ça marche et dans ça ne marche pas.

[ Répondre ]

Revenir en haut de page || Retourner aux forums || Retourner au forum Linux.general