[Graphic] How to install tomcat on centos

First go to the tomcat official website to download the installation package (download the version you want)

image.png

Assuming you are using windows system now

Then unzip the compressed package you downloaded and put it in a directory

Install xshell and xftp in your local windows system

image.png

This small icon in xshell can directly open xftp

image.png

First log in to your centos server through xshell (just follow the operation and you will be asked to enter your username and password)

Then open xftp through xshell (no need to log in again at this time)
Then upload the tomcat file you unzip to the /usr/local/tomcat directory via xftp

After uploading, you need to set some file permissions

image.png

After that, execute the following command in xshell:

/usr/local/tomcat/bin/startup.sh

You may get the following response:

Neither the JAVA_HOME nor the JRE_HOME environment variable is definedAt least one of these environment variable is needed to run this program

At this time, directly open the setclasspath.sh file in xftp, as shown below

image.png

Add the following at the beginning of the file

export JAVA_HOME=/usr/local/jdk1.8.0_151  export JRE_HOME=/usr/local/jdk1.8.0_151/jre    export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH    export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

Note that before adding these content, you must first make sure that your centos system already has jdk things (/usr/local/jdk1.8.0_151)

If not, you can go to the official website of java to download, and then follow the above method to upload the JDK to your server. It is not a big problem in what directory to put

image.png

This is the IP address of your server, you may still not be able to access anything

It may be the reason why you did not open your 80 port

You need to open port 80 through the following command

firewall-cmd --zone=public--add-port=80/tcp --permanent  systemctl stop firewalld.service  systemctl start firewalld.service  

The first line is to permanently open port 80

The second and third lines are to stop and start the firewall

If you are prompted at the beginning that the firewall has not been activated; then you execute the third sentence first

After performing this step, you still cannot access anything

You need to modify the tomcat configuration file

image.png

Around line 69, change the default port from 8080 to 80

< Connector port="80" protocol="HTTP/1.1"               connectionTimeout="20000"               redirectPort="8443"/>

Visit your IP address at this time, you will get the following screen as you wish:

image.png

This is a sample screen of tomcat

This sample page is stored in the following directory:

image.png

You can delete all the items in this directory, and then put your own items, which is your website.

Recommended Posts

[Graphic] How to install tomcat on centos
How to install Tomcat 9 on CentOS 8
How to install and uninstall tomcat on centos
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Memcached on CentOS 8
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8
How to install PHP on CentOS 8
How to install MongoDB on CentOS 8
How to install Apache Maven on CentOS 8
How to install Apache Kafka on CentOS 7
R&amp;D: How To Install Python 3 on CentOS 7
How to install Apache Tomcat 8 on Ubuntu 16.04
How to install GCC compiler on CentOS 7
How to install offline JDK1.8 on centos7.0
How to install Visual Studio Code on CentOS 8
How to install and use Docker on CentOS 7
How to install RPM packages on CentOS Linux
Centos7.6 method to install Tomcat-8.5.39
How to install and configure VNC on CentOS 8
How to install and use Composer on CentOS 8
How to install and configure Redis on CentOS 8
How to install Node.js and npm on CentOS 8
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install and configure phpMyAdmin on CentOS 6
How to install and use Curl on CentOS 8
How to install and configure Owncloud on CentOS 8
How to install VirtualBox client extension on CentOS 8
How to install Docker CE on RHEL 8 / CentOS 8
How to install and configure Redmine on CentOS 8