[centos7 tomcat9] by 무한일요일

https://tomcat.apache.org/download-90.cgi 
core 에서 tar.gz 다운로드 / wget

tar xvzpf apache-tomcat-9.0.17.tar.gz

mv apache-tomcat-9.0.17 /opt

cd /opt; mv apache-tomcat-9.0.17 tomcat


useradd tomcat

groupadd tomcat

cd /opt

chown -R tomcat:tomcat tomcat


vi /etc/systemd/system/tomcat.service

# cat /etc/systemd/system/tomcat.service

# Systemd unit file for tomcat

[Unit]

Description=Apache Tomcat Web Application Container

After=syslog.target network.target

 

[Service]

Type=forking

 

Environment=JAVA_HOME=/usr/lib/jvm/jre

Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid

Environment=CATALINA_HOME=/opt/tomcat

Environment=CATALINA_BASE=/opt/tomcat

Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'

Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

 

ExecStart=/opt/tomcat/bin/startup.sh

ExecStop=/bin/kill -15 $MAINPID

 

User=tomcat

Group=tomcat

UMask=0007

RestartSec=10

Restart=always

 

[Install]

WantedBy=multi-user.target


:wq


systemctl daemon-reload

systemctl start tomcat


vi /opt/tomcat/webapps/manager/META-INF/context.xml 

<!--  <Valve className="org.apache.catalina.valves.RemoteAddrValve"

         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> 주석처리


vi /opt/tomcat/webapps/host-manager/META-INF/context.xml 

<!--  <Valve className="org.apache.catalina.valves.RemoteAddrValve"

         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> 주석처리


vi /opt/tomcat/conf/tomcat-users.xml 

<tomcat-users> </tomcat-users> 사이에


  <role rolename="tomcat"/>

   <role rolename="admin-gui"/>

   <role rolename="manager-gui"/>

   <role rolename="manager-status"/>

   <user username="admin" password="passwd" roles="manager-gui,admin-gui,manager-status" />








google


통계 위젯 (블랙)

629
162
557231

SNS

FaceBook



QR code