Since I needed a java server on the external network, I used Tencent Cloud to build one.
I built this only for learning, after all, the security is not high.
Below is the process I built.
First, if you have not [registered Tencent Cloud Account] (https://partners.cloud.tencent.com/invitation/1000062081375d1c9bfd9e7b5), you must first register and complete the real-name authentication. Before purchasing Tencent [Cloud Server] (https://cloud.tencent.com/product/cvm?from=10680) and other cloud products, remember to receive (Voucher Package)
yum install mysql mysql-devel mariadb-server mariadb –y
systemctl start mariadb
mysqladmin -u root password "password"
Mysql configuration file is /etc/my.cnf
vim /etc/my.cnf
Add coding configuration at the end
#[ mysql]]default-character-set=utf8
Upload the new jdk-7-linux-x64.rpm software to /root, and perform the following operations:
rpm –ivh jdk-7-linux-x64.rpm
which java
ls –lrt /usr/java/default/bin/java
/usr/java/default ---- is the path of our java.
vim /etc/profile
export JAVA_HOME=/usr/java/defaultexport PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Esc → :wq save
source /etc/profiel
tar –zxvf apache-tomcat-7.0.29.tar.gz
mv apache-tomcat-7.0.29 tomcat
Open the tomcat configuration file
vi /tomcat/conf/server.xml
After opening the Tomcat configuration file, press/8080 to quickly retrieve
Modify the port, press i to change all 8080 to 80
Press: wq to save and exit
# /tomcat/bin/shutdown.sh
# /tomcat/bin/startup.sh
This completes the configuration of the java server of Tencent centos7 host.
If you need a jdk or tomcat installation package, you can go to "centos7 build javaweb server tomcat" to download. I used it before.
Well, I should also do other things.
Recommended Posts