PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : apache,tomcat,mod_jk - jsp files trotzdem nur als download



El Kassem
04.05.11, 11:27
Hallo!
Ich habe eine Frage, habe hier einen Fedora14 Server.
Darauf wurde apache,tomcat und das modul mod_jk installiert und nach besten gewissen konfiguriert.

Leider dürfte irgendwas nicht klappen, wenn ich über meinen Browser das *.jsp File aufrufe, wird es mir als Download angeboten.

Wo könnte der Fehler liegen? (Vielleicht noch als Nebeninfo.. Ich will das Produkt InterScan Messaging Security Suite von Trend Micro zum laufen bringen)

Danke

marce
04.05.11, 11:34
Konfig, Logfiles, Fehlermeldung, Vorgehensweise?

hiyeah
04.05.11, 11:43
Hi,

was genau willst du?
Wie greifst du auf die JSP Seiten zu (URL)?
Welche Ports nutzt du?

Ciao

El Kassem
04.05.11, 11:51
Welche Config, Logs benötigst du denn ?

Folgende kann ich mal anbieten : das habe ich in der httpd.conf hinzugefügt :


LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile /etc/httpd/conf/workers.properties

# Where to put jk logs
JkLogFile /var/log/httpd/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 +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"


# Send servlet for context / jsp-examples to worker named worker1
JkMount /jsp-examples worker1
# Send JSPs for context /jsp-examples/* to worker named worker1
JkMount /jsp-examples/* worker1

workers.properties sehen so aus :


#workers.tomcat_home=/var/lib/tomcat5
#workers.java_home=/usr/lib/jvm
worker.list=worker1
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1


Der Inhalt auf den zugegriffen wird ist folgender Pfad : /opt/trend/imss/UI/adminUI/ROOT


Meine URL ist : http://localhost:8445
Auszug aus : netstat -nlp

tcp 0 0 :::8445 :::* LISTEN 11012/java

Falls noch etwas gebraucht wird, einfach sagen.

marce
04.05.11, 11:56
steht doch schon oben. Alle Konfigs und Logfiles.

El Kassem
04.05.11, 12:13
Ja, ausser die oben genannten fallen mir keine mehr ein die relevant sein könnten.
Hier vielleicht noch : /var/log/httpd/mod_jk.log

[20848:3079206736] [info] init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized


Aber das sieht ja gut aus..

marce
04.05.11, 12:14
es gibt sicherlich ein access_log, ein error_log,ein catalina.out, ein server.xml, die komplette Apache-Konfig, ...

Auch könntest Du mal versuchen, was denn passiert, wenn Du die Seite direkt vom Tomcat abziehen willst...

Naja, vielleicht bekommen wir jetzt ja brauchbare Infos...


(übrigens, bist Du Dir sicher mit den JkMount-Werten?)

El Kassem
04.05.11, 12:33
Im access_log ist nicht sonderlich viel zu sehen ... :

[03/May/2011:15:53:07 +0200] "GET /favicon.ico HTTP/1.1" 404 289 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20101005 Fedora/3.6.10-1.fc14 Firefox/3.6.10"


error_log:

[Wed May 04 14:18:15 2011] [notice] Digest: generating secret for digest authentication ...
[Wed May 04 14:18:15 2011] [notice] Digest: done
[Wed May 04 14:18:15 2011] [warn] No JkShmFile defined in httpd.conf. Using default /etc/httpd/logs/jk-runtime-status
[Wed May 04 14:18:15 2011] [warn] ./mod_dnssd.c: No services found to register
[Wed May 04 14:18:15 2011] [notice] Apache/2.2.17 (Unix) DAV/2 mod_jk/1.2.31 configured -- resuming normal operations


catalina.out:

INFO: Starting Servlet Engine: Apache Tomcat/5.5.27
May 4, 2011 10:13:32 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
log4j:WARN Please initialize the log4j system properly.
May 4, 2011 10:13:35 AM org.apache.catalina.startup.ContextConfig validateSecurityRoles
WARNING: Security role name used in an <auth-constraint> without being defined in a <security-role>
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@504ec 1)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 60
May 4, 2011 10:13:56 AM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRul e: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterR ule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingR ule: Redirect URL: http://jakarta.apache.org]]
May 4, 2011 10:13:56 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8445
May 4, 2011 10:13:57 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
May 4, 2011 10:13:58 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 25592 ms


server.xml:

<Server port="8005" shutdown="SHUTDOWN">

<!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycl eListener" />
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecyc leListener"/>

<!-- Global JNDI resources -->
<GlobalNamingResources>

<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>

<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactor y"
pathname="conf/tomcat-users.xml" />

</GlobalNamingResources>
....
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8445" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
keystoreFile="sslkey/.keystore" clientAuth="false" sslProtocol="TLS" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->

<!-- Note : To use gzip compression you could set the following properties :

compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
-->

<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<!--
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
-->
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" acceptCount="100" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->

<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host). -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
....
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
....
<Context path="" reloadable="true" docBase="/opt/trend/imss/UI/adminUI/ROOT" workDir="/opt/trend/imss/UI/adminUI/ROOT/work" />



Ich hab die Server.xml bisschen gekürzt, ein haufen Kommentare die per default drinnen sind. Wenn gewünscht stell ich aber gerne die komplette Datei hier unter Quote's .. dachte mir das sei ein bisschen unübersichtlich..

Alles andere in der httpd Conf ist standard. (das heißt der apache läuft auch primär auf den port 80 und hat als document_root /var/www/html.

Das Problem ist, das ich auch nicht genau sagen kann wie theoretisch das Produkt arbeiten sollte, die Doku ist dazu sehr lau..

@jkMount Werte: Nein. Interessant diesbezüglich wäre wohl der Pfad : /opt/trend/imss/UI/adminUI/ROOT/jsp ?
Das ändern der jkMount auf folgenden Pfad brachte kein Erfolg.

marce
04.05.11, 12:40
Wieso greifst Du mit http auf einen als https definierten Port im Tomcat zu und fragst hier nach einem Problem mit mod_jk, obwohl Du das scheinbar bei dem Problemrequest gar nicht verwendest?

Ansonsten solltest Du evtl. dann auch mal beim Tomcat ein AccessLog einschalten - und [nichts] als Context Path ist auch nicht unbedingt gut. Wo liegt denn das war-File? Wurde es entpackt beim Start?

El Kassem
04.05.11, 13:00
Vom Produkt (imss) hab ich kein war-file zur Verfügung.

Oh cool, wenn ich das Request mit https absetze bekomme ich folgende Tomcat Meldung:

HTTP Status 503 - This application is not currenctly available
type: status report
message: This application is not currenctly available
description: The requested service (This application is not currently available) is not currenctly available.

Foglendes spuckt /var/log/tomcat5/localhost.2011-05-04.log aus:

May 4, 2011 2:28:56 PM org.apache.catalina.core.ApplicationContext log
INFO: action: []: Verifying ModuleConfig for this module
May 4, 2011 2:28:57 PM org.apache.catalina.core.ApplicationContext log
INFO: action: []: Verification of ModuleConfig has been completed
May 4, 2011 2:29:10 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
May 4, 2011 2:29:10 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
May 4, 2011 2:29:14 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
May 4, 2011 2:29:14 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
May 4, 2011 3:03:18 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
May 4, 2011 3:03:18 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
May 4, 2011 3:03:18 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
May 4, 2011 3:03:18 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
May 4, 2011 3:04:49 PM org.apache.catalina.core.ApplicationContext log
INFO: action: []: Verifying ModuleConfig for this module
May 4, 2011 3:04:50 PM org.apache.catalina.core.ApplicationContext log
INFO: action: []: Verification of ModuleConfig has been completed
May 4, 2011 3:04:53 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
May 4, 2011 3:04:53 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
May 4, 2011 3:04:58 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
May 4, 2011 3:04:58 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()

marce
04.05.11, 13:03
aber irgendwas wird schon in dem VZ liegen, daß Du als DocBase angegeben hast?

El Kassem
04.05.11, 13:08
Natürlich..:) Hier der Auszug des Verzeichnis:


construction.html
global_setting.html
index.html
PermissionDenied.jsp
css
help
javascripts
reports
db_error.html
images
jsp
WEB-INF
Email
IMSS.html
logs
work

marce
04.05.11, 13:11
übrigens, das was Du da gepostet hast ist kein AccessLog.

Ansonsten wären Rechte bei der VZ-Inhalte evtl. auch nicht schlecht - auch die VZ bis dahin.

Du bist mit Deiner Informationspolitik generell ein wenig konservativ, das macht es nicht gerade einfach...

El Kassem
04.05.11, 13:14
-rwxr-x---. 1 imss imss 101 29. Jun 2009 construction.html
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 css
-rwxr-x---. 1 imss imss 255 29. Jun 2009 db_error.html
drwxrwxr-x. 2 imss imss 4096 2. Mai 13:46 Email
-rwxr-x---. 1 imss imss 328 29. Jun 2009 global_setting.html
drwxr-x---. 3 imss imss 4096 2. Mai 13:05 help
drwxr-x---. 3 imss imss 4096 2. Mai 13:39 images
-rwxr-x---. 1 imss imss 145 29. Jun 2009 IMSS.html
-rwxr-x---. 1 imss imss 145 29. Jun 2009 index.html
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 javascripts
drwxr-x---. 12 imss imss 4096 2. Mai 13:05 jsp
drwxrwxr-x. 2 root root 4096 2. Mai 13:50 logs
-rwxr-x---. 1 imss imss 91 29. Jun 2009 PermissionDenied.jsp
drwxrwxr-x. 3 imss imss 4096 2. Mai 13:46 reports
drwxr-x---. 5 imss imss 4096 2. Mai 13:39 WEB-INF
drwxrwxr-x. 2 root root 4096 4. Mai 15:17 work


Im jsp Verzeichnis wie folgt :


drwxr-x---. 2 imss imss 4096 2. Mai 13:39 admin
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 framework
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 global_setting
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 ipfilter
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 logs
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 policy
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 quarantines
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 reports
drwxr-x---. 2 imss imss 4096 2. Mai 13:39 summary

So sind auch alle anderen Verzeichnisse von der Berechtigung her..

Sorry, ich weiß leider nicht immer genau was du brauchst... Ich geb natürlich so viel her wie möglich, schließlich hilfst du ja ;)

marce
04.05.11, 13:15
als welche User/Gruppe läuft der Tomcat bzw. auch der Apache?

(übrigens darfst Du für solche Ausgaben gerne die [code] anstatt der [quote]-Tags nehmen, die Lesbarkeit gewinnt damit ungemein...)

El Kassem
04.05.11, 13:26
Ähmm... es geht. Ich hab zwar eigentlich nun nichts mehr verändert. Aber nun bekomm ich die Seiten ganz normal angezeigt. Login funktioniert, scheint alles zu klappen. Danke.