Skip to content

Commit

Permalink
use tomcat8
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrenn committed Jun 8, 2018
1 parent 10183e3 commit a93f0fe
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 126 deletions.
10 changes: 5 additions & 5 deletions 00_ctsms_https.conf
Expand Up @@ -22,15 +22,15 @@
Require all granted
</Directory>

Alias /resources /ctsms/apache-tomcat-6.0.48/webapps/ROOT/resources
<Directory "/ctsms/apache-tomcat-6.0.48/webapps/ROOT/resources">
Alias /resources /var/lib/tomcat8/webapps/ROOT/resources
<Directory "/var/lib/tomcat8/webapps/ROOT/resources">
#Options FollowSymLinks
#allow from all
AllowOverride None
Require all granted
</Directory>
Alias / /ctsms/apache-tomcat-6.0.48/webapps/ROOT/
<Directory "/ctsms/apache-tomcat-6.0.48/webapps/ROOT">
Alias / /var/lib/tomcat8/webapps/ROOT/
<Directory "/var/lib/tomcat8/webapps/ROOT">
#Options FollowSymLinks
#allow from all
AllowOverride None
Expand All @@ -42,7 +42,7 @@
deny from all
</Location>

DocumentRoot /ctsms/apache-tomcat-6.0.48/webapps/ROOT
DocumentRoot /var/lib/tomcat8/webapps/ROOT
JkMount /*.jsf ajp13
JkMount /rest/* ajp13
JkMount /inputfieldimage ajp13
Expand Down
Binary file removed apache-maven-3.2.5-bin.tar.gz
Binary file not shown.
Binary file removed apache-tomcat-6.0.48.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dbtool.sh
@@ -1,2 +1,2 @@
#!/bin/bash
java -DCTSMS_PROPERTIES="/ctsms/properties" -Dfile.encoding=Cp1252 -Djava.awt.headless=true -Xms2048m -Xmx4096m -Xss256k -XX:+UseParallelGC -XX:MaxGCPauseMillis=1500 -XX:GCTimeRatio=9 -XX:+CMSClassUnloadingEnabled -XX:ReservedCodeCacheSize=256m -classpath /ctsms/apache-tomcat-6.0.48/webapps/ROOT/WEB-INF/lib/ctsms-core-1.6.1.jar:/ctsms/apache-tomcat-6.0.48/webapps/ROOT/WEB-INF/lib/* org.phoenixctms.ctsms.executable.DBTool $*
java -DCTSMS_PROPERTIES="/ctsms/properties" -Dfile.encoding=Cp1252 -Djava.awt.headless=true -Xms2048m -Xmx4096m -Xss256k -XX:+UseParallelGC -XX:MaxGCPauseMillis=1500 -XX:GCTimeRatio=9 -XX:+CMSClassUnloadingEnabled -XX:ReservedCodeCacheSize=256m -classpath /var/lib/tomcat8/webapps/ROOT/WEB-INF/lib/ctsms-core-1.6.1.jar:/var/lib/tomcat8/webapps/ROOT/WEB-INF/lib/* org.phoenixctms.ctsms.executable.DBTool $*
46 changes: 21 additions & 25 deletions install.sh
Expand Up @@ -11,7 +11,6 @@ apt-get -y install sudo wget lsb-release

###create 'ctsms' user
useradd ctsms -p '*' --groups sudo
usermod www-data --append --groups ctsms

###prepare /ctsms directory with default-config and master-data
mkdir /ctsms
Expand All @@ -31,30 +30,25 @@ chown ctsms:ctsms /ctsms -R
###install OpenJDK 8
apt-get -y install openjdk-8-jdk

###install tomcat6
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/apache-tomcat-6.0.48.tar.gz -O /ctsms/apache-tomcat-6.0.48.tar.gz
tar -zxvf /ctsms/apache-tomcat-6.0.48.tar.gz -C /ctsms
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/server.xml -O /ctsms/apache-tomcat-6.0.48/conf/server.xml
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/workers.properties -O /ctsms/apache-tomcat-6.0.48/conf/workers.properties
chown ctsms:ctsms /ctsms/apache-tomcat-6.0.48 -R
rm /ctsms/apache-tomcat-6.0.48.tar.gz -f
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/tomcat.service -O /lib/systemd/system/tomcat.service
ln -s /lib/systemd/system/tomcat.service /etc/systemd/system/multi-user.target.wants/tomcat.service
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/tomcat.service.conf -O /etc/systemd/tomcat.service.conf
mkdir /run/tomcat
chown ctsms:ctsms /run/tomcat
chmod 755 /run/tomcat
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/tomcat.conf -O /etc/tmpfiles.d/tomcat.conf
systemctl start tomcat
###install tomcat8
apt-get -y install libservlet3.1-java tomcat8
systemctl stop tomcat8
usermod --append --groups tomcat8,adm ctsms
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/workers.properties -O /etc/tomcat8/workers.properties
chown root:tomcat8 /etc/tomcat8/workers.properties
chmod 640 /etc/tomcat8/workers.properties
chmod 770 /var/log/tomcat8
chmod g+r /var/log/tomcat8/*
sed -r -i 's/TOMCAT8_USER.+/TOMCAT8_USER=ctsms/' /etc/default/tomcat8
sed -r -i 's/TOMCAT8_GROUP.+/TOMCAT8_GROUP=ctsms/' /etc/default/tomcat8
sed -r -i 's/^JAVA_OPTS.+/JAVA_OPTS="-server -Djava.awt.headless=true -Xms2048m -Xmx4096m -Xss256k -XX:+UseParallelGC -XX:MaxGCPauseMillis=1500 -XX:GCTimeRatio=9 -XX:+CMSClassUnloadingEnabled -XX:ReservedCodeCacheSize=256m"/' /etc/default/tomcat8
echo 'CTSMS_PROPERTIES=/ctsms/properties' >>/etc/default/tomcat8
systemctl start tomcat8

####build phoenix
apt-get -y install git
apt-get -y install git maven
mkdir /ctsms/build
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/apache-maven-3.2.5-bin.tar.gz -O /ctsms/build/apache-maven-3.2.5-bin.tar.gz
cd /ctsms/build
tar -zxf /ctsms/build/apache-maven-3.2.5-bin.tar.gz
ln -s /ctsms/build/apache-maven-3.2.5/bin/mvn /usr/bin/mvn
rm /ctsms/build/apache-maven-3.2.5-bin.tar.gz -f
git clone https://github.com/phoenixctms/ctsms
sed -r -i 's/<java\.home>.+<\/java\.home>/<java.home>\/usr\/lib\/jvm\/java-8-openjdk-amd64<\/java.home>/' /ctsms/build/ctsms/pom.xml
sed -r -i 's/<stagingDirectory>.+<\/stagingDirectory>/<stagingDirectory>\/ctsms\/build\/ctsms\/target\/site<\/stagingDirectory>/' /ctsms/build/ctsms/pom.xml
Expand Down Expand Up @@ -83,11 +77,13 @@ sudo -u ctsms psql -U ctsms ctsms < /ctsms/build/ctsms/core/db/schema-create.sql

###deploy ctsms-web.war
chmod 755 /ctsms/build/ctsms/web/target/ctsms-1.6.1.war
rm /ctsms/apache-tomcat-6.0.48/webapps/ROOT/ -rf
cp /ctsms/build/ctsms/web/target/ctsms-1.6.1.war /ctsms/apache-tomcat-6.0.48/webapps/ROOT.war
rm /var/lib/tomcat8/webapps/ROOT/ -rf
cp /ctsms/build/ctsms/web/target/ctsms-1.6.1.war /var/lib/tomcat8/webapps/ROOT.war

###setup apache2
apt-get -y install apache2 libapache2-mod-jk libapache2-mod-fcgid
#usermod --append --groups ctsms www-data
##usermod --append --groups tomcat8 www-data
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/00_ctsms_http.conf -O /etc/apache2/sites-available/00_ctsms_http.conf
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/00_ctsms_https.conf -O /etc/apache2/sites-available/00_ctsms_https.conf
wget https://raw.githubusercontent.com/phoenixctms/install-debian/master/01_signup_http.conf -O /etc/apache2/sites-available/01_signup_http.conf
Expand Down Expand Up @@ -182,8 +178,8 @@ cd /ctsms/build/ctsms
mvn -f web/pom.xml -Dmaven.test.skip=true
chmod 755 /ctsms/build/ctsms/web/target/ctsms-1.6.1.war
systemctl stop tomcat
rm /ctsms/apache-tomcat-6.0.48/webapps/ROOT/ -rf
cp /ctsms/build/ctsms/web/target/ctsms-1.6.1.war /ctsms/apache-tomcat-6.0.48/webapps/ROOT.war
rm /var/lib/tomcat8/webapps/ROOT/ -rf
cp /ctsms/build/ctsms/web/target/ctsms-1.6.1.war /var/lib/tomcat8/webapps/ROOT.war

###ready
systemctl start tomcat
Expand Down
2 changes: 1 addition & 1 deletion jk.conf
Expand Up @@ -20,7 +20,7 @@

# We need a workers file exactly once
# and in the global server
JkWorkersFile /ctsms/apache-tomcat-6.0.48/conf/workers.properties
JkWorkersFile /etc/tomcat8/workers.properties

# Our JK error log
# You can (and should) use rotatelogs here
Expand Down
132 changes: 72 additions & 60 deletions server.xml
@@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
Expand All @@ -20,16 +20,16 @@
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
Expand All @@ -46,57 +46,76 @@
</GlobalNamingResources>

<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">

<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->


<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector address="127.0.0.1" port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
<Connector address="127.0.0.1" port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
This connector uses the NIO implementation. The default
SSLImplementation will depend on the presence of the APR/native
library and the useOpenSSL attribute of the
AprLifecycleListener.
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
This connector uses the APR/native implementation which always uses
OpenSSL for TLS.
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
certificateFile="conf/localhost-rsa-cert.pem"
certificateChainFile="conf/localhost-rsa-chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
URIEncoding="UTF-8"
keystoreFile="conf/phoenix.keystore" keystorePass="rauhamAt6"
ciphers="SSL_RSA_WITH_RC4_128_MD5,
SSL_RSA_WITH_RC4_128_SHA,
TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
TLS_ECDHE_RSA_WITH_RC4_128_SHA,
TLS_ECDH_ECDSA_WITH_RC4_128_SHA,
TLS_ECDH_RSA_WITH_RC4_128_SHA"
clientAuth="false" sslProtocol="TLS" /> -->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector address="127.0.0.1" port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>

<Connector address="127.0.0.1" port="8009" protocol="AJP/1.3" redirectPort="8443" />



<!-- An Engine represents the entry point (within Catalina) that processes
Expand All @@ -106,37 +125,30 @@
Documentation at /docs/config/engine.html -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">

<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->

<!-- The request dumper valve dumps useful debugging information about
the request and response data received and sent by Tomcat.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->

<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>

<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
unpackWARs="true" autoDeploy="true">

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
Expand All @@ -145,11 +157,11 @@
-->

<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
-->
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />

</Host>
</Engine>
Expand Down
1 change: 0 additions & 1 deletion tomcat.conf

This file was deleted.

19 changes: 0 additions & 19 deletions tomcat.service

This file was deleted.

14 changes: 0 additions & 14 deletions tomcat.service.conf

This file was deleted.

0 comments on commit a93f0fe

Please sign in to comment.