Centos7 build java web server tomcat

First, if you have not registered Tencent Cloud Account, you must first register and complete the real-name authentication. Before purchasing cloud products such as Tencent Cloud Server, remember to receive (Voucher Gift Pack)

Related packages used below

Download link

Install mysql

Installer

yum install mysql mysql-devel mariadb-server mariadb –y

The related commands of the mariadb database are:

systemctl start mariadb #Start MariaDB

systemctl stop mariadb #Stop MariaDB

systemctl restart mariadb #Restart MariaDB

systemctl enable mariadb #Set boot up

Start the database###

Systemctl start mariadb

Set database password###

Configure mysql

Mysql configuration file is /etc/my.cnf

Add coding configuration at the end

[ mysql]]
default-character-set =utf8

The character encoding here must be the same as in /usr/share/mysql/charsets/Index.xml.

Install JDK

Installation Notes

System environment: centos-7.2
Installation method: rpm installation
Software: jdk-7-linux-x64.rpm
Download link: http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html

Check the original version of the system

java –version

rpm -qa | grep java

If you find that there are installed OpenJDK and installation packages, then uninstall them in sequence first. Uninstall command:

rpm -e --nodeps tzdata-java-2012c-1.el6.noarch
rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64

Verify installation

java

javac

java –version

Since my environment has changed without configuration, I started to install Tomcat directly.

Install Tomcat

Installation Notes
Installation environment: CentOS-7.2

Installation method: source installation
Software: apache-tomcat-7.0.29.tar.gz
Download link: http://tomcat.apache.org/download-70.cgi

Upload apache-tomcat-7.0.29.tar.gz to the /root directory and perform the following operations

apache-tomcat-7.0.29 renamed to tomcat

Modify the default port 80
1、 Open the tomcat configuration file

vi /tomcat/conf/server.xml

2、 After opening the Tomcat configuration file, press/8080 to quickly retrieve

3、 Modify the port, press i to change all 8080 to 80

4、 Press: wq to save and exit

5、 Restart tomcat

/tomcat/bin/shutdown.sh

/tomcat/bin/startup.sh

Start Tomcat

#. /tomcat/bin/shutup.sh //Close tomcat

The firewall opens port 8080

firewall-cmd --zone=public --add-port=80/tcp --permanent

Success appears to indicate successful addition

Restart firewall###

Enter the IP address on the browser, and the apache interface appears, indicating that the installation is successful.

other instructions###

After completing the above installation, you can put the web program under /tomcat/webapps/ROOT. Configure the database, then restart tomcat, enter the server's IP address in the browser, and then you can access the web.

Since I made a javaweb program that needs to be run on the server, I used a virtual machine to simulate it myself. This tutorial was written after I completed the server setup, so there is no picture. I hope to rewrite the tutorial next time. Let more friends who want to learn understand my tutorial.

Recommended Posts

Centos7 build java web server tomcat
Build OpenV** Server under CentOS7
Build OpenLDAP server under CentOS7
CentOS6.5 install Java 8 and Tomcat8
CentOS6.5 install Java 8 and Tomcat8
CentOS6.5 install Java 8 and Tomcat8
Ubuntu server builds Java web server
Centos8 implementation steps to build a local web server
CentOS8.1 build Gitlab server detailed tutorial
Tencent Cloud Centos7 install java server
Ubuntu16.04 build php5.6 Web server environment
Build an FTP server under centos7
virtualBox install centos, and build tomcat
Centos7.5 configuration java environment installation tomcat explanation
Centos6.5 install Tomcat
CentOS7 build jenkins
Centos build lnmp
Centos7 build python3.8.5+scrapy+gerapy
CentOS 7 install Java 1.8
CentOS 7 install Java 1.8
How to quickly build Nginx server under CentOS
Centos7 tutorial to build a master-slave DNS server
CentOS7.3 64 bit, build Zabbix3.4
CentOS build private git
Linux (centos7) build gitlab
Build k8s1.9.9 on centos7
Install Java on Centos 7
3 minutes to teach you to build gitea on Centos server
CentOS6.7 build LNMP environment
Build a basic environment for Java development under Centos7
Centos6.9 build rabbitmq 3.6.8 cluster
CentOS 7.3 + Server JRE 1.8 + Hadoop-2.8.0
CentOS server deployment (YUM)
CentOS uses Nginx to build a download function server
Jenkins build on centos
CentOS7 install JDK8, tomcat8
Build Hadoop in CentOS
Centos7 build DNS service
CentOS Python Java installations
CentOS 7 build LNMP environment
CentOS7.6 server deployment VNC
Build docker environment under Centos6.5
[Linux] Build Samba server (ubuntu16.04)
CentOs7.3 build Solr stand-alone service
Build zabbix monitoring zabbix4.2 in CentOS7.6
CentOS 7 install JAVA environment (JDK 1.8)
ubuntu 16.04 build pptpd V** server
Centos7.6 method to install Tomcat-8.5.39
Build zabbix monitoring zabbix4.2 in CentOS7.6
Build MariaDB replication on CentOS
CentOs7.3 build ZooKeeper-3.4.9 stand-alone service
Build Ubuntu 12.04 cross compilation server
Install Java JDK8 under CentOS6
install virtualbox on centos server
CentOs7.3 build SolrCloud cluster service
Centos7 installation tomcat process introduction
Install Nginx server on CentOS 7
Ubuntu16.04 build GitLab server tutorial
Centos8 uses Apache httpd2.4.37 to install web server steps in detail