In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to install Tomcat 9 in CentOS7, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Tomcat doesn't explain much, just drive.
1. Download the installation package on the official website
Install tomcat to the / usr/local/tomcat/ directory
Cd / usr/local/mkdir tomcat/cd tomcat/wget http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.0.M18/bin/apache-tomcat-9.0.0.M18.tar.gz
two。 Extract and execute the following command
Tar-zxvf apache-tomcat-9.0.0.M18.tar.gz
3. Rename directory
Mv apache-tomcat-9.0.0.M18 tomcat_8080 (/ path (destination path))
4. Configure self-startup, change to the bin directory of Tomcat to execute vi setenv.sh, and press I to enter edit mode, copy and paste the following code
# add tomcat pidCATALINA_PID= "$CATALINA_BASE/tomcat.pid" # add java optsJAVA_OPTS= "- server-XX:PermSize=256M-XX:MaxPermSize=1024m-Xms512M-Xmx1024M-XX:MaxNewSize=256m"
Then press the ESC key, press shift+: (":" appears in the lower left corner), and then type wq to save exit.
Finally, execute chmod + x setenv.sh to ensure that the file setenv.sh is executable.
5. Configure service to execute cd / usr/lib/systemd/system to change to directory and execute vi tomcat.service (you can also vi / usr/lib/systemd/system/tomcat.service directly)
Copy and paste the following code (be sure to replace the Tomcat path / usr/local/apache-tomcat-9.0.0.M18 in lines 6 and 7 with your own absolute Tomcat path)
[Unit] Description=TomcatAfter=syslog.target network.target remote-fs.target nss- lookup.target [service] Type=forkingPIDFile=/usr/local/tomcat/tomcat_8080/tomcat.pid # set to its own path ExecStart=/usr/local/tomcat/tomcat_8080/bin/startup.sh # set its own path ExecReload=/bin/kill-s HUP $MAINPIDExecStop=/bin/kill-s QUIT $MAINPIDPrivateTmp= true [install] WantedBy=multi-user.target
From boot to boot
/ / configure boot systemctl enable tomcat// to start tomcatsystemctl start tomcat// stop tomcatsystemctl stop tomcat// and restart tomcatsystemctl restart tomcat
When the configuration is complete, it is recommended to restart the server, that is, enter the command reboot (or sudo reboot) to enter your server address + port 8080 in the browser.
(for example, 192.168.1.161purl 8080), if you see a kitten, please check that all of the above steps are performed correctly.
Configure environment variables
Vi / etc/profile
Increase
Export CATALINA_HOME=/usr/local/tomcat/tomcat_8080export PATH=$TOMCAT_HOME/bin:$PATH
If you can't access it, it could be because of the firewall.
Systemctl stop firewalld.service turn off the firewall cd / usr/local/tomcat/tomcat_8080/bin and enter the tomcat root directory. / startup.sh enable tomcat
6. Modify the port and change to the Tomcat conf directory
Cd / usr/local/tomcat/tomcat_8080/conf// input instruction to open the file vi server.xml// input / 8080 and enter to search for the 8080 string, find the following two places
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.