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://cloud.tencent.com/act/cps/redirect?redirect=1040&cps_key=47783d44e3444c17b1d7f94099f3ee17&from=10680), you must first register and complete the real-name authentication. Before purchasing Tencent [Cloud Server] (https://cloud.tencent.com/act/cps/redirect?redirect=1014&cps_key=47783d44e3444c17b1d7f94099f3ee17&from=10680) and other cloud products, remember to receive (Voucher Gift Pack)
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 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