To add a new user who will be able to access the tomcat web interface (manager-gui and admin-gui) we need to define the user in tomcat-users.xml file as shown below. Sudo nano /opt/tomcat/conf/tomcat-users.xml Sudo firewall-cmd -zone=public -permanent -add-port=8080/tcp & sudo firewall-cmd -reload Then update firewall for adding the tcp port for tomcat. Sudo systemctl daemon-reload & sudo systemctl enable tomcat & sudo systemctl start tomcat & sudo systemctl status tomcat Then restart all services and start our tomcat service. Sudo nano /etc/systemd/system/rviceĮnvironment="JAVA_OPTS=file:///dev/urandom"Įnvironment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"Įnvironment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC" Sudo ln -sfn /opt/tomcat/apache-tomcat-9.0.24 /opt/tomcat & sudo chown -R tomcat: /opt/tomcat & sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'Ĭreate a systemd unit file for making Tomcat a service. Sudo tar -zxvf apache-tomcat-9.0.24.tar.gz -C /opt/tomcat -strip-components=1 & rm -rf apache-tomcat-9.0.24.tar.gz Sudo yum install -y java-1.8.0-openjdk.x86_64 & sudo groupadd tomcat & sudo mkdir /opt/tomcat & sudo useradd -s /bin/nologin -g tomcat -d /opt/tomcat tomcat & cd ~ & java -version Install java and a dedicated user for tomcat. Sudo yum install epel-release -y & sudo yum update kernel -y & sudo yum update -y & sudo yum upgrade -y & sudo yum install nano net-tools git wget -y & sudo reboot -h nowĪdduser & usermod -aG wheel & passwd & exit
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |