0. Create a Personal Folders
# Yum install using tomcat and mysql
# Create a folder
cd / usr / local
mkdir hehe
1. Installation rzsz
# 1. Installation rzsz
yum list lrzsz *
yum install lrzsz -y
2. Install JDK, path and the like has been automatically set up
# 2. Install the JDK
yum list java *
yum install java-1.7.0-openjdk * -y
3. Install mysql
# 3. Install mysql
yum list mysql *
yum install mysql-server * -y
# Modify / etc / my.Set default encoding cnf and a storage location of the database, if possible, to optimize memory configuration
vi / etc / my.cnf
3.1 mysql profile substantially as follows:
[Mysqld]
# Datadir = / var / lib / mysql
datadir = / usr / local / hehe / mysql_data
socket = / var / lib / mysql / mysql.sock
user = mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links = 0
default-character-set = utf8
[Mysqld_safe]
log-error = / var / log / mysqld.log
pid-file = / var / run / mysqld / mysqld.pid
[Mysql]
default-character-set = utf8
Wherein, when vi is to enter the command mode, to enter the edit mode, you can use the keys "i" denotes insert, insert mode.
The exit edit mode, use the Esc key to exit edit mode, you are in command mode, enter the command in command mode will not be added into the content,
In the command mode, input line number, such as 22, the transport, the cursor jumps to the line 22, using a colon command may perform related operations, such as
: Wq for write files and exit
: Wq! It indicates a mandatory written to the file, and exit for read-only file or something.
: Q for quit without saving
Remember to add the Enter key.
About MySQL memory settings, you can also refer to: MySQL 5.The initial configuration tuning 6
Of course, if you do not consider migration, it is recommended to use Ali cloud MySQL, 5 dollars a month, is peace of mind, if you''re using another cloud platform, you can also use the cloud service, high performance and low price, save time and worry and effort.
4. Tomcat installation
# 4. Tomcat installation
cd / usr / local
wget http: // mirrors.hust.edu.cn / apache / tomcat / tomcat-7 / v7.0.63 / bin / apache-tomcat-7.0.63.tar.gz
tar -zxf apache-tomcat-7.0.63.tar.gz
mv apache-tomcat-7.0.63 tomcat
4.1 to modify the configuration file
cd / usr / local / tomcat / conf
# Modify the configuration file server.xml, can not have Chinese.
# Configure the port number, bind the domain name, aliases, and set the thread pool, the mapping context folder
vi server.xml
Then modify the Server part, of course, ftp, or other tools can be used to download to windows edited, and then uploaded back there, and remember if you have any Chinese comments, you need to modify encoded as UTF-8, or in plain English, using the default ANSI also be.
lt; Executor name = "tomcatThreadPool" namePrefix = "catalina-exec-"
maxThreads = "250" minSpareThreads = "20" />
connectionTimeout = "20000" redirectPort = "8443" compression = "on" compressionMinSize = "2048" noCompressionUserAgents = "gozilla, traviata" compressableMimeType = "text / html, text / xml, text / javascript, text / css, text / plain, application / json, application / javascript, application / x-javascript" /> resourceName = "UserDatabase" /> unpackWARs = "true" autoDeploy = "true" xmlValidation = "false" xmlNamespaceAware = "false"> 5. Start mysqld service, and tomcat --5. Start mysqld service, and tomcat cd / usr / local / hehe mkdir mysql_data # You must modify the user belongs to, oh, if you modify the mysql data file directory, then chown mysql: mysql mysql_data service mysqld start / Usr / local / tomcat / bin / startup.sh 5.1 set Tomcat to start automatically There are a number of ways, such as setting service, or use rc.local loading. Modify / etc / rc.d / rc.local file: vim / etc / rc.d / rc.local Inside the increase Tomcat startup script, then save. The final results are shown below: [Root @ xxx bin] # cat / etc / rc.d / rc.local #!/ Bin / sh # # This script will be executed * after * all the other init scripts. # You can put your own initialization stuff in here if you do not # Want to do the full Sys V style init stuff. touch / var / lock / subsys / local # Start tomcat / Usr / local / tomcat / bin / startup.sh You can see, we only increased the last line.After the completion of meaning is to start in Linux, other loads after the initial script is complete, execute the command to start Tomcat. Way, of course, start other programs can also be used in this way, but it is a little soil, but can not use chkconfig to configure and invoke (That did not use to install Service.) 6. Because we modify the context corresponding tomcat, so access is not what it needs to in / Hehe / myapp Following a corresponding javaEE app can. The above method is under CentOS small series to introduce yum install mysql, jdk and tomcat, and we want to help, if you have any questions please give me a message, Xiao Bian will promptly reply to your.In this I am also very grateful for the support of the home-site scripting! You may also be interested in the article: Linux system installed JDK1.Detailed tutorials centos 8 installation jdk1.8 occurs no / lib / ld-linux.so.2: This document analyzes the reasons centOS7 installation jdk1.8. A method of installing Linux JDK Tomcat MySQL tutorial (using Mac remote access) Detailed Linux installation JDK, Tomcat and MySQL (with illustrations) Centos6.5 Under Jdk + Tomcat + Mysql environment under the graphic tutorial to install redhat apache + php + mysql + imap + ldap + jdk + installed under Window tomcat installation JDK1.8 + Tomcat9.0.27 + Mysql5.7.Graphic tutorial 28