Précédent   Forum du club des développeurs et IT Pro > Webmasters - Développement Web > Serveurs (Apache, IIS,...)
Serveurs (Apache, IIS,...) Forum d'entraide sur les Serveurs : Apache, IIS, ...
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 12/06/2012, 10h00   #1
Lady
Membre éprouvé
 
Avatar de Lady
 
Femme
Développeur Java
Inscription : mars 2003
Messages : 560
Détails du profil
Informations personnelles :
Sexe : Femme
Localisation : France

Informations professionnelles :
Activité : Développeur Java
Secteur : Santé

Informations forums :
Inscription : mars 2003
Messages : 560
Points : 438
Points : 438
Par défaut Apache+Glassfish : mod_jk et prettyfaces: blank page

Pour prévenir dès le départ : je nage un peu en eaux troubles quand on me parle de configuration serveur.

Les faits : j'ai installé une appli tournant sous Glassfish (3.1.2) derrière Apache (2.2) sous Linux en suivant un tuto : http://www.jskro.org/blog/?p=92 (même si je n'ai qu'une seule appli)

J'ai donc tout installer et tout fonctionne sauf que dans mon appli j'utilise de l'url rewritting via prettyfaces. Quand j'essaye d’accéder à mon appli via ma pretty url je reçoit une page vide (vraiment vide 0ko avec code 200) tandis que si je met l'url réelle tout se passe bien. (En accès direct sous Glassfish je n'ai pas ce problème)

Dans le fichier /etc/apache2/conf.d/jk j'ai essayé de remplacer l'option +ForwardURICompat par +ForwardURICompatUnparsed sans succès.

Et dans les logs il se passe juste "rien" (1 ligne dans acces.log et 1 ligne dans mod_jk.log)

Je ne sais pas trop quoi vous mettre de plus mais si vous avez besoin de quelques choses pour m'aider avec ce problèmes n’hésitez pas à demander.

Merci d'avance
__________________
(Bio)informaticienne folle ... MOUWAWAWAWA
Geekette fan de Marcus et de Nolife !!
Jeune Maman
Lady est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/06/2012, 10h21   #2
_Mac_
Rédacteur/Modérateur
 
Avatar de _Mac_
 
Inscription : août 2005
Messages : 9 146
Détails du profil
Informations forums :
Inscription : août 2005
Messages : 9 146
Points : 10 700
Points : 10 700
Elles ressemblent à quoi l'URL d'entrée (qui marche) de ton application et l'URL réécrite demandée par le navigateur (et qui récupère un résultat vide) ?
__________________

Du détail, du détail, du détail !!!
Revenons à la source : lisons la documentation et les fichiers de trace, la réponse à notre problème s'y trouve sans doute
_Mac_ est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/06/2012, 11h53   #3
Lady
Membre éprouvé
 
Avatar de Lady
 
Femme
Développeur Java
Inscription : mars 2003
Messages : 560
Détails du profil
Informations personnelles :
Sexe : Femme
Localisation : France

Informations professionnelles :
Activité : Développeur Java
Secteur : Santé

Informations forums :
Inscription : mars 2003
Messages : 560
Points : 438
Points : 438
Citation:
Envoyé par _Mac_ Voir le message
Elles ressemblent à quoi l'URL d'entrée (qui marche) de ton application et l'URL réécrite demandée par le navigateur (et qui récupère un résultat vide) ?
alors ma pretty url :: http://<ip>/<appli>/login

et la vrai : http://<ip>/<appli>/pages/login.xhtml

A noter que http://<ip>/<appli>/ redirige sur la pretty toujours en page blanche.
__________________
(Bio)informaticienne folle ... MOUWAWAWAWA
Geekette fan de Marcus et de Nolife !!
Jeune Maman
Lady est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/06/2012, 09h33   #4
Lady
Membre éprouvé
 
Avatar de Lady
 
Femme
Développeur Java
Inscription : mars 2003
Messages : 560
Détails du profil
Informations personnelles :
Sexe : Femme
Localisation : France

Informations professionnelles :
Activité : Développeur Java
Secteur : Santé

Informations forums :
Inscription : mars 2003
Messages : 560
Points : 438
Points : 438
Mon problème existe toujours.

Si ca peut aider voila les différents fichier de conf:

APACHE

/etc/apache2/jk/worker.properties
Code :
1
2
3
4
5
6
7
8
9
10
11
#Worker 1                                                                       
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
/etc/apache2/conf.d/jk
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Where to find workers.properties
JkWorkersFile /etc/apache2/jk/workers.properties
# Where to put jk logs
JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize -ForwardDirectories +ForwardURICompatUnparsed
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Locattion of shm file
JkShmFile /etc/apache2/jk/jk.shm
/etc/apache2/ports.conf
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# If you just change the port or add more ports here, you will likely also                 
# have to change the VirtualHost statement in                                              
# /etc/apache2/sites-enabled/000-default                                                   
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from                    
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and                     
# README.Debian.gz                                                                         

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change                  
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl                
    # to <VirtualHost *:443>                                                               
    # Server Name Indication for SSL named virtual hosts is currently not                  
    # supported by MSIE on Windows XP.                                                     
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>
/etc/apache2/sites-enabled/000-default
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
<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot /var/www/myAppDom
    JkMount /myApp/* worker1
    ServerName 176.31.131.244
    ErrorLog /var/log/apache2/myAppDom.error.log
    LogLevel warn
    CustomLog /var/log/apache2/myAppDom.access.log combined
</VirtualHost>
GLASSFISH

Mon appli est déployée sous glassfish avec les ports par défaut
J'ai utilisé les commandes suivante pour crée le listener
Code :
1
2
3
./asadmin create-http-listener --host localhost --port 4848 --listenerport 8009 --listeneraddress 0.0.0.0 --defaultvs server jk-connector
./asadmin set --host localhost --port 4848 configs.config.server-config.network-config.network-listeners.network-listener.jk-connector.jk-enabled=true


APPLICATION

/myApp/WEB-INF/web.xml
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
<!--Pretty faces filter -->
    <filter>
        <filter-name>Pretty Filter</filter-name>
        <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>

    <filter-mapping>
        <filter-name>Pretty Filter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

	[...]
	  <!-- Welcome file list configuration -->
    <welcome-file-list>
        <welcome-file>/pages/index.xhtml</welcome-file>
    </welcome-file-list>

    <!-- Error handling -->
    <error-page>
        <error-code>404</error-code>
        <location>/pages/index.xhtml</location>
    </error-page>

    <error-page>
        <exception-type>javax.faces.application.ViewExpiredException</exception-type>
        <location>/pages/login.xhtml</location>
    </error-page>

    <error-page>
        <error-code>500</error-code>
        <location>/pages/index.xhtml</location>
    </error-page>
/myApp/WEB-INF/pretty-config.xml
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
<pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.0
                                   		http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.0.xsd">

    <!-- Public pages -->
    <url-mapping id="login">
        <pattern value="/login"/>
        <view-id value="/pages/login.xhtml" />
    </url-mapping>

    <url-mapping id="login-error">
        <pattern value="/login/#{error}"/>
        <view-id value="/pages/login.xhtml" />
    </url-mapping>

    <url-mapping id="lost-login">
        <pattern value="/lostlogin"/>
        <view-id value="/pages/lost-login.xhtml"/>
    </url-mapping>

    <url-mapping id="new-user">
        <pattern value="/newuser"/>
        <view-id value="/pages/nouvel-utilisateur.xhtml"/>
        <action onPostback="false">#{newUserBean.cleanParameters}</action>
    </url-mapping>

   [...]
   
</pretty-config>

Merci à tous ceux qui y jette un oeil (voir les 2)
__________________
(Bio)informaticienne folle ... MOUWAWAWAWA
Geekette fan de Marcus et de Nolife !!
Jeune Maman
Lady est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 11h22.


 
 
 
 
Partenaires

Hébergement Web