Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
documentation:server-install-components [2019/01/04 11:27] mpospisek [Config files settings] |
documentation:server-install-components [2019/08/01 09:09] tjotov removed |
||
---|---|---|---|
Line 115: | Line 115: | ||
# D | install systemd unit file | # D | install systemd unit file | ||
# create and open unit file service | # create and open unit file service | ||
- | vi /usr/lib/systemd/system/tomcat9.service | + | #vi /usr/lib/systemd/system/tomcat9.service |
- | </sxh> | + | echo \ |
- | File contents: | + | "[Unit] |
- | <sxh bash> | + | |
- | [Unit] | + | |
Description=Apache Tomcat 9.0.x Servlet Container | Description=Apache Tomcat 9.0.x Servlet Container | ||
After=syslog.target network.target | After=syslog.target network.target | ||
Line 127: | Line 125: | ||
Group=tomcat | Group=tomcat | ||
Type=forking | Type=forking | ||
- | #Environment=JAVA_HOME=/usr/java/default | + | Environment=JAVA_HOME=/usr/java/default |
- | Environment=JAVA_HOME=/usr/lib/jvm/jre | + | #Environment=JAVA_HOME=/usr/lib/jvm/jre |
Environment=CATALINA_PID=/opt/tomcat/tomcat.pid | Environment=CATALINA_PID=/opt/tomcat/tomcat.pid | ||
Environment=CATALINA_HOME=/opt/tomcat | Environment=CATALINA_HOME=/opt/tomcat | ||
Line 136: | Line 134: | ||
[Install] | [Install] | ||
- | WantedBy=multi-user.target | + | WantedBy=multi-user.target" >/usr/lib/systemd/system/tomcat9.service |
- | </sxh> | + | |
- | + | # Prepare config files | |
- | Prepare config files | + | # /opt/tomcat/bin/tomcat-startup.sh |
- | <codedoc code:bash> | + | echo \ |
- | vi /opt/tomcat/bin/tomcat-startup.sh | + | "#!/bin/bash -x |
- | </codedoc> | + | |
- | + | ||
- | <sxh bash> | + | |
- | #!/bin/bash -x | + | |
cd $CATALINA_BASE | cd $CATALINA_BASE | ||
- | ./bin/startup.sh | + | ./bin/startup.sh" >/opt/tomcat/bin/tomcat-startup.sh |
- | </sxh> | + | |
- | <codedoc code:bash> | + | # /opt/tomcat/bin/tomcat-shutdown.sh |
- | vi /opt/tomcat/bin/tomcat-shutdown.sh | + | echo \ |
- | </codedoc> | + | "#!/bin/bash -x |
- | + | ||
- | <sxh bash> | + | |
- | #!/bin/bash -x | + | |
cd $CATALINA_BASE | cd $CATALINA_BASE | ||
- | ./bin/shutdown.sh | + | ./bin/shutdown.sh" >/opt/tomcat/bin/tomcat-shutdown.sh |
- | </sxh> | + | |
- | The Dcom.sun.management lines are just voluntarily, in case you want monitor Tomcat | + | # /opt/tomcat/bin/setenv.sh |
- | <codedoc code:bash> | + | # The Dcom.sun.management lines are just voluntarily, in case you want monitor Tomcat |
- | vi /opt/tomcat/bin/setenv.sh | + | # *** Check validity of Xms-Xmx settings in your environment *** |
- | </codedoc> | + | echo \ |
- | + | "CATALINA_OPTS="-server \ | |
- | <sxh bash> | + | |
- | CATALINA_OPTS="-server \ | + | |
-Dcom.sun.management.jmxremote.port=8086 \ | -Dcom.sun.management.jmxremote.port=8086 \ | ||
-Dcom.sun.management.jmxremote.ssl=false \ | -Dcom.sun.management.jmxremote.ssl=false \ | ||
Line 175: | Line 162: | ||
-XX:+UseStringDeduplication \ | -XX:+UseStringDeduplication \ | ||
-XX:MaxGCPauseMillis=100 \ | -XX:MaxGCPauseMillis=100 \ | ||
- | " | + | " >/opt/tomcat/bin/setenv.sh |
+ | |||
+ | # make the scripts executable | ||
+ | chmod +x /opt/tomcat/bin/*.sh | ||
</sxh> | </sxh> | ||
- | <codedoc code:bash> | + | Add ${catalina.home}/conf to the common.loader values in the catalina.properties file and modify last two lines of the file to somewhat speed Tomcat startup |
- | cd /opt/tomcat/bin | + | |
- | chmod +x *.sh | + | <codedoc> |
- | # | + | |
vi /opt/tomcat/conf/catalina.properties | vi /opt/tomcat/conf/catalina.properties | ||
</codedoc> | </codedoc> |