Introduction to CentOS7 installation process of openjdk, tomcat and mysql

The first is foreplay. It is recommended to use a remote tool Xshell and Xftp together. The following is the official website of Xshell
http://www.netsarang.com/products/xsh_overview.html


1. openjdk

How to download and install prebuilt OpenJDK packages
JDK 8
Debian, Ubuntu, etc.
On the command line, type:
$ sudo apt-get install openjdk-8-jre
The openjdk-8-jre package contains just the Java Runtime Environment. If you want to develop Java programs then please install the openjdk-8-jdk package.
Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
On the command line, type:
$ su -c “yum install java-1.8.0-openjdk”
The java-1.8.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.8.0-openjdk-devel package.

The above mentioned the installation methods of different systems, and also pointed out that the command is only to install JRE. If you need to develop applications, you need to install it separately (it has been marked in bold). If you want to install other versions, see the introduction of openjdk official website
http://openjdk.java.net/install/

[ root@VM_207_229_centos ~]# java -version
openjdk version"1.8.0_71"
OpenJDK Runtime Environment (build 1.8.0_71-b15)
OpenJDK 64-Bit Server VM (build 25.71-b15, mixed mode)

2. tomcat

# cd /usr/local
# wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.tar.gz
# tar xzf apache-tomcat-8.0.36.tar.gz
# mv apache-tomcat-8.0.36 tomcat
# ls
apache-tomcat-8.0.36.tar.gz  etc    include  lib64    logs    sa    share  tomcat   bin   games  lib   libexec  qcloud  sbin  src

I am used to putting tomcat under /user/local, unzip it after downloading, and rename it to tomcat
If you want other versions... Find a good path to download at the following address
https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/

Modify the configuration file conf/server.xml to monitor port 80, the default encoding is utf-8, and gzip compression is enabled

< Connectorport="80"protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443"executor="tomcatThreadPool"URIEncoding="utf-8"compression="on"compressionMinSize="50"noCompressionUserAgents="gozilla, traviata"compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"/><!-- A "Connector" using the shared thread pool-->

Start tomcat, enter the ip address in the browser, and see the tomcat kitten page. CentOS7 opens port 80, and Centos 7 uses firewalld to replace the original iptables.

<!- - Start firewall-->
# systemctl start  firewalld
<!- - Open port 80, success appears to indicate successful addition-->
# firewall-cmd --zone=public --add-port=80/tcp --permanent
<!- - Restart firewall-->
# systemctl restart firewalld.service
<!- - Check port-->
# firewall-cmd --permanent --zone=public --list-ports
<!- - Self-starting firewall-->
# systemctl enable firewalld

Also change the default access address, do not want to see the tomcat kitten (this step depends on personal needs)

< Enginename="Catalina"defaultHost="www.caihongwen.cn"><RealmclassName="org.apache.catalina.realm.LockOutRealm"><RealmclassName="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/></Realm><Hostname="www.caihongwen.cn"appBase="webapps"unpackWARs="true"autoDeploy="true"><ContextdocBase="blog"path=""debug="0"reloadable="true"/><!-- Access log processes all example.
    Documentation at: /docs/config/valve.html
    Note: The pattern used is equivalent to using pattern="common" --><ValveclassName="org.apache.catalina.valves.AccessLogValve"directory="logs"prefix="localhost_access_log"suffix=".txt"pattern="%h %l %u %t &quot;%r&quot; %s %b"/></Host></Engine>

Please note that a piece of code is added between the Host

< Context docBase="blog" path="" debug="0"  reloadable="true"/>

This blog is the name of the war package of the webapps project. Enter the blog directly through ip or domain name, and the tomcat kitten management page will not appear. Starting tomcat for the first time is slightly slower. The newly added war package needs to be restarted to take effect. Another important point is to open port 80 to the outside world.


3. mysql

Use RPM package to install, this kind of installation process will automatically complete the relevant configuration of the system, which is more convenient.
In addition, there is a .tar.gz compressed file installation method, and a blog introduction is recommended.
http://blog.csdn.net/superchanon/article/details/8546254/

Uninstall the original MySQL or Mariadb installer
1、 CentOs7 version installs mariadb-libs by default, you must uninstall it before you can continue to install MySql.
a) Find if mariadb-libs was installed before

# rpm -qa | grep -i mariadb-libs

b) Uninstall the installed mariadb-libs

# yum remove mariadb-libs-5.5.44-2.el7.centos.x86_64

2、 Find whether MySQL was installed before

# rpm -qa | grep -i mysql

Delete if so

Install MySQL

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server

Restart mysql service after successful installation

# service mysqld restart

The first time mysql is installed, the root account does not have a password. The method of setting the password

# mysql -uroot
mysql> set password for 'root'@'localhost' = password('mypasswd');

Remote authorization to connect to mysql

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypasswd' WITH GRANT OPTION;
FLUSH   PRIVILEGES;

Modify mysql default encoding

# vim /etc/my.cnf

Make the following changes

[ client]default-character-set=utf8[mysqld]character_set_server=utf8

Then restart mysql

# service mysqld restart
# mysql -uroot -p
mysql> show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> show variables like 'collation%';
+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database   | utf8_general_ci |
| collation_server     | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)

Install mysql-jdbc driver

# yum install mysql-connector-java

Finished! ! !

Connect to mysql remotely. If the connection fails, port 3306 may not be opened.
Finally, share a mysql remote management artifact Navicat, you know
http://pan.baidu.com/s/1mh87vGc

Recommended Posts

Introduction to CentOS7 installation process of openjdk, tomcat and mysql
Centos7 installation tomcat process introduction
Installation and use of Mysql under CentOS
Centos mysql installation and configuration
Environment configuration of JDK, mysql and tomcat under Centos7
Centos7 installation and configuration of Jenkins
Centos6.5 installation and deployment of KVM
CentOS7 installation and maintenance of Gitlab
CentOS7 installation and maintenance of nginx from entry to master
CentOS 7 Tomcat service installation and configuration
Centos7 mysql database installation and configuration
Ubuntu basic settings: introduction to the installation and use of openssh-server
Tomcat installation and configuration under CentOS 7 (Tomcat startup)
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
Centos-6.5 installation and deployment of LNMP environment
Centos7 installation and deployment of gitlab server
Centos7 installation and deployment of Airflow detailed
Installation and configuration of JDK in CentOS 7 system
Centos7 installation of PHP and Nginx tutorial detailed
Installation and configuration of rsync server under CentOS 6.5
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
MySQL 8.0 installation and deployment under CentOS, super detailed!
How to install and uninstall tomcat on centos
MySQL 8.0 installation, deployment and configuration tutorial on CentOS 8
From installation to entry of FastDFS under Centos7
Ubuntu introduction and installation
Graphical installation of CentOS8
Mysql8.0.15 installation configuration (centos7)
Installation and cracking of confluence6.3 operation records under Centos
Installation and simple practice of MySQL in ubuntu environment (1)
Centos7 to install the correct posture of Tomcat8 and set the boot self-start practice notes
Python introduction and environment installation
Centos 7 mini installation process record
Centos7.6 method to install Tomcat-8.5.39
Anaconda introduction and Ubuntu/windows installation Anaconda
Centos7 installation and configuration prometheus
Detailed explanation of Spark installation and configuration tutorial under centOS7
CentOS6.5 install Java 8 and Tomcat8
CentOS 7 installation and configuration PPTP
CentOS 6.x installation mysql5.7 record
CentOS installation and configuration cmake
Ubuntu16.04.5LTS installation process of SVN
Graphical centos installation detailed process
Centos7.5 installation and configuration MongoDB4.0.4
CentOS 7 installation and configuration PPTP
centos7 kvm installation and use
CentOS6.5 install Java 8 and Tomcat8
CentOS6.5 install Java 8 and Tomcat8
CentOS7 postgresql installation and use
CentOS environment installation of Docker
Centos8 minimal deployment and installation of OpenStack Ussuri detailed tutorial
CentOS8 Linux 8.0.1905 installation process (illustration)
Centos7 elk7.1.1 installation and use
CentOS8 deploys LNMP environment to compile and install mysql8.0.29 tutorial details
Server upgrade to centos8 website configuration-php and mysql upgrade from 5.6 to php7 and msyql
How to install MySQL on CentOS 8
CentOS7 yum install and start mysql
Analysis of Hyper-V installation CentOS 8 problem
CentOS Yum compile and install MySQL 5.6
[Introduction to redis] Install redis under Centos
Centos7 installation of Dameng database tutorial