Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
becki:linux:apache_tomcat [2010-04-30 14:23] becki created |
becki:linux:apache_tomcat [2010-05-05 08:33] (aktuell) becki |
||
---|---|---|---|
Zeile 6: | Zeile 6: | ||
Tomcat is available as package at www.slackpackages.net. Installing the package adds the user and group 'tomcat' with a user- and group ID of 8080. ''/etc/rc.d./rc.tomcat'' and ''/etc/profile.d/catalina.sh'' and ''catalina.csh'', which creates the ''CATALINA_HOME'' env. var. | Tomcat is available as package at www.slackpackages.net. Installing the package adds the user and group 'tomcat' with a user- and group ID of 8080. ''/etc/rc.d./rc.tomcat'' and ''/etc/profile.d/catalina.sh'' and ''catalina.csh'', which creates the ''CATALINA_HOME'' env. var. | ||
- | Tomcat is started with ''/etc/rc.d./rc.tomcat start''. Make rc.tomcat runnable and enable autostart at power on by starting/stopping it with an entries in ''rc.local'' / ''rc.local_shutdown''. (See comments in rc.tomcat) | + | Tomcat is controlled with ''/etc/rc.d./rc.tomcat start|stop|restart''. Make rc.tomcat runnable and enable autostart at power on by starting/stopping it with an entries in ''rc.local'' / ''rc.local_shutdown''. (See comments in rc.tomcat) |
After start you should see the default Tomcat home page at http://localhost:8080/ If not, check ''/usr/share/apache-tomcat/RUNNING.txt'' | After start you should see the default Tomcat home page at http://localhost:8080/ If not, check ''/usr/share/apache-tomcat/RUNNING.txt'' | ||
Zeile 14: | Zeile 14: | ||
The ''CATALINA_HOME'' env var points to ''/usr/share/apache-tomcat'' | The ''CATALINA_HOME'' env var points to ''/usr/share/apache-tomcat'' | ||
- | Hypertext docs live in subdirs of ''$CATALINA_HOME/webapps''. The default home page is ''$CATALINA_HOME/webapps/ROOT/index.html''. It has pointers to Servlets Examples, JSP Examples and the Tomcat Documentation. | + | Hypertext docs live in subdirs of ''$CATALINA_HOME/webapps''. The default home page is ''$CATALINA_HOME/webapps/ROOT/index.html''. It has pointers to Servlets Examples, JSP Examples and the Tomcat Documentation. Access the default home page at http://localhost:8080/ . |
- | Static HTML can be served by simply creating a subdir in ''webapps'' and providing an ''index.html'' within that new dir. (Tried) | + | Static HTML can be served by simply creating a subdir in ''$CATALINA_HOME/webapps'' and providing an ''index.html'' within that new dir. (Tested) |
+ | A WAR file (eg. from [[:becki:coding:apache click]]) can be deployed just by dropping it into ''$CATALINA_HOME/webapps'' Note that Tomcat extracts the .war file into the webapps dir and serves content from the extracted directory and not from the war file. [[http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html#Deployment%20With%20Tomcat%206|More]] | ||
+ | |||
+ | ===== Tomcat Manager == | ||
+ | |||
+ | Tomcat ships with a web based configuration app. Among, others it can be used to //reload newly compiled// web apps (eg. java classes) without restarting the server. | ||
+ | |||
+ | In order to access the manager, you have to create a rolename called ''manager'', add some user and assign him the ''magnager'' role in '' | ||
+ | $CATALINA_HOME/conf/tomcat-users.xml''. [[http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html|More]] | ||
+ | |||
+ | <code xml> | ||
+ | <tomcat-users> | ||
+ | <!-- Add the following 2 lines: --> | ||
+ | <role rolename="manager"/> | ||
+ | <user username="bigboss" password="geheim" roles="manager"/> | ||
+ | </tomcat-users> | ||
+ | </code> | ||
+ | |||
+ | <note important>'' | ||
+ | tomcat-users.xml'' by default is world readable. You may want to restrict access to the ''tomcat'' user only</note> | ||
+ | |||
+ | FIXME How to encrypt the password? |