1. Create file tomcat.service in /usr/lib/systemd/system/
2. Edit file tomcat.service add
[Unit]
Description=tomcat7
[Service]
Type=forking
WorkingDirectory=/usr/local/tomcat7/bin
ExecStart=/bin/bash /usr/local/tomcat7/bin/startup.sh start
ExecStop=/bin/bash /usr/local/tomcat7/bin/shutdown.sh stop
User=root
Group=root
[Install]
WantedBy=multi-user.target
#make sure used exact Tomcat install location
3. Start Tomcat service
#service tomcat start OR #systemctl start tomcat
4. Stop Tomcat service
#service tomcat stop OR #systemctl stop tomcat
0 comments:
Post a Comment