CentOS Configuration Meysql,tomcat Environment steps detailed

Source: Internet
Author: User
Tags character set mysql version zip centos port number yum repolist

Installing the Java Environment

1. Download jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. Upload JDK files to the server's/usr/local/download directory

Upload command: SCP jdk-8u111-linux-x64.rpm root@:/usr/local/download

3. Install JDK

Command: RPM-IVH jdk-8u111-linux-x64.rpm

4. Install MySQL

Download
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
Installation:

Add MySQL Yum Repository

Yum Localinstall mysql-community-release-el7-5.noarch.rpm

Verify that the success is added
Yum Repolist enabled | grep "Mysql.*-community.*"
-Select to enable MySQL version
Yum Repolist All | grep MySQL

You can see that the 5.5, 5.7 version is disabled by default because the latest stable version is now 5.6

[Root@bogon software]# yum repolist all | grep MySQL
MYSQL-CONNECTORS-COMMUNITY/X86_64 MySQL Connectors Community Enabled: 14
Mysql-connectors-community-source MySQL Connectors COMMUNITY-SOURC Disabled
mysql-tools-community/x86_64 MySQL Tools Community enabled: 17
Mysql-tools-community-source MySQL Tools Community-source Disabled
mysql55-community/x86_64 MySQL 5.5 Community Server disabled
Mysql55-community-source MySQL 5.5 Community SERVER-SOURC disabled
mysql56-community/x86_64 MySQL 5.6 Community Server enabled: 139
Mysql56-community-source MySQL 5.6 Community SERVER-SOURC Disabled
mysql57-community-dmr/x86_64 MySQL 5.7 Community Server Develop disabled
Mysql57-community-dmr-source MySQL 5.7 Community Server Develop disabled


```
-You can start some versions by using a statement similar to the following
```
Yum-config-manager--disable mysql56-community
Yum-config-manager--enable MYSQL57-COMMUNITY-DMR
```

Note: Only one version can be enabled at any time.

-View the current MySQL version of the startup

```
Yum Repolist enabled | grep MySQL

[Root@bogon software]# yum repolist enabled | grep MySQL
MYSQL-CONNECTORS-COMMUNITY/X86_64 MySQL Connectors Community 14
mysql-tools-community/x86_64 MySQL Tools Community 17
mysql56-community/x86_64 MySQL 5.6 Community Server 139

```

# # to install MySQL via Yum
Yum Install Mysql-community-server

Yum will automatically handle MySQL dependencies with other components:

-Executive
Rpm-qi mysql-community-server.x86_64 0:5.6.24-3.el7

# # Start and close MySQL Server

1 Start MySQL Server

Systemctl Start mysqld

2 View MySQL Server status

Systemctl Status Mysqld

3 Shut down MySQL Server

Systemctl Stop Mysqld

4. Test whether the installation was successful

Mysql

# # Firewall settings

1. Remote access to MySQL, you need to open the default port number 3306.

-Firewall-cmd
Firewall-cmd--permanent--zone=public--add-port=3306/tcp

Firewall-cmd--permanent--zone=public--add-port=3306/udp

Bring the latest firewall settings rule into effect.

Firewall-cmd--reload

# # Boot from

1. See if the MySQL service boots up

[Root@localhost ~]# systemctl is-enabled Mysql.service;echo $?

Enabled
0

If it is enabled, it is automatically turned on and, if not, perform
Chkconfig--levels 235 mysqld on

# # Set Character Set

Modify the/etc/my.cnf file to add settings for the character set
[Mysqld]

Character Set server = UTF8

[MySQL] default-character-set = UTF8

Restart MySQL, you can see that the character set has been modified
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)

# Install Tomcat

1. Download Tomcat http://tomcat.apache.org/

2. Upload the tomcat file to the server and extract
SCP Apache-tomcat-9.0.0.m11.zip Root@172.16.199.129:/usr/local/download

If the unzip command is not installed, install Yum install first unzip

Extract Tomcat and rename

Unzip Apache-tomcat-9.0.0.m11.zip MV Apache-tomcat-9.0.0.m11.zip. /tomcat

3. Start port number 8080
Firewall-cmd--zone=public--add-port=8080/tcp--permanent

Command meaning:

--zone #作用域

--ADD-PORT=80/TCP #添加端口, Format: Port/Communication protocol

--permanent #永久生效, failure after reboot without this parameter

Reboot firewall Firewall-cmd--reload

An error appears for the FIREWALLD is not running to be used to order the FIREWALLD up

Systemctl Start Firewalld

Systemctl Enable Firewalld

4. Start Tomcat
Go to Tomcat's Bin directory and modify the permissions for all suffixes named. sh

Cd/usr/local/tomcat/bin

chmod u+x *.sh

Start the Tomcat service./startup.sh

Stop the Tomcat service./shutdown.sh

```

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.