Example Analysis of CentOS Server Construction and initialization configuration in Linux
This article is to share with you the content of a sample analysis of setting up and initializing a CentOS server in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
First
Buy a server, casually buy a low configuration, I bought the student machine, 9.9 a month, cheap can not be cheaper, cheap can not be cheaper.
(it comes with mysql database, php Apache runtime environment, FTP,VSftpd, which saves me a lot of trouble.)
Step 1: install jdk
Go to the official website to download jdk (official website: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
Rz, upload JDK, (for example, my directory is / usr/java)
Then decompress jdk:tar-zxvf jdk-8u141-linux-x64.tar.gz
Next, configure the environment variable, the path of the environment variable: / etc/profile (you can copy a copy first, cp / etc/profile / etc/profile1)
Vi / etc/profile finds export and adds the following
Export JAVA_HOME=/usr/java/jdk/jdk1.8.0_112
Export JRE_HOME=/usr/java/jdk/jdk1.8.0_112/jre
Export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
Export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$JAVA_HOME:$PATH (ps: slightly modified according to the jdk version of each word, I won't elaborate later)
ZZ save, and then enter the command: source / etc/profile.
The OK,JDK configuration is complete.
Step 2: install tomcat
For those who have studied java, needless to say, the server is still the same. Download the compressed package on the official website (official website: http://tomcat.apache.org/download-90.cgi)
Rz, upload the compressed package (for example, my upload path is: / home)