tomcat web services to build

First, prepare two source packages are jdk package and tomcat package

One. Jdk environment variable settings.

(1)  extracting jdk packet , the following command.

 

tar  zxvf  jdk-8u221-linux-x64.tar.gz

 

etc. jdk1.8.0_221 /usr/local/jdk1.8

 

(2)  Set jdk environment variable, by vi editing editor command is as follows.

vi / etc / profile

In profile the last line in the file ( may be entered using the keyboard two uppercase GG , skip to the last line, then the keyboard input lowercase o) Add the following content. After save and exit (vi currently in edit mode, first switch to command mode ( by esc keyboard click ) , then keyboard input : wq Enter Exit )

#### Insert the following text

JAVA_HOME=/usr/local/jdk1.8/

JAVA_BIN=/usr/local/jdk1.8/bin

JRE_HOME=/usr/local/jdk1.8/jre

PATH=$PATH:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/bin

CLASSPATH=/usr/local/jdk1.8/jre/lib:/usr/local/jdk1.8/lib:/usr/local/jdk1.8/jre/lib/charsets.jar

### Exit

After passing through the source to update the previous settings of the command, the command is as follows.

source /etc/profile

 

Then linux Enter the following command window to check the jdk environment variable settings successful.

java -version

Execution results shown in Figure 1 shown in FIG.

 

 

Output appears as shown above , it shows jdk environment variable setup is successful.

Second, install tomcat package

(1)  extracting tomcat of the package and start tomcat, following commands ,

tar zxvf apache-tomcat-8.5.45.tar.gz

mv  apache-tomcat-8.5.45   /usr/local/tomcat

cd /usr/local/tomcat

./bin/startup.sh

 

(2)  installed NET-Tools , the following command.

 

yum install -y net-tools

netstat -lntp | grep 8080

iptables -F

iptables -Z

iptables -X

 

Third, accessed through a browser tomcat page ( or via curl localhost: 8080)

Guess you like

Origin www.cnblogs.com/yidaoyun/p/11594979.html