Created
May 25, 2018 09:29
-
-
Save fnzv/c83140713cd27235a529e015ee80debc to your computer and use it in GitHub Desktop.
install script for tomcat 8.5 on centos 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum -y install java-1.8.0-openjdk-devel | |
yum install -y wget unzip | |
sudo useradd -m -U -d /opt/tomcat -s /bin/false tomcat | |
cd /tmp | |
wget http://apache.panu.it/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.zip | |
unzip apache-tomcat-*.zip | |
sudo mv apache-tomcat-*/ /opt/tomcat/ | |
sudo chown -R tomcat: /opt/tomcat | |
sudo chmod +x /opt/tomcat/bin/*.sh | |
echo "[Unit] | |
Description=Tomcat 8.5 servlet container | |
After=network.target | |
[Service] | |
Type=forking | |
User=tomcat | |
Group=tomcat | |
Environment="JAVA_HOME=/usr/lib/jvm/jre" | |
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom" | |
Environment="CATALINA_BASE=/opt/tomcat/" | |
Environment="CATALINA_HOME=/opt/tomcat/" | |
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid" | |
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC" | |
ExecStart=/opt/tomcat/bin/startup.sh | |
ExecStop=/opt/tomcat/bin/shutdown.sh | |
[Install] | |
WantedBy=multi-user.target" > /etc/systemd/system/tomcat.service | |
sudo systemctl daemon-reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment