CentOS installation Nginx / Redis / MySql

1. Extract the installation package
tar -zxvf nginx-1.14.2.tar.gz

2. Install the dependent software
yum -y install gcc // mounting GCC
yum the install PCRE PCRE -Y-mounted devel // PCRE
yum the install zlib zlib -Y-devel // mounting alib
yum the install -Y-devel openssl openssl openssl installed //

3. Install
./configure // configuration
make // compile
make install // installation

4. Stop & Start
CD / usr / local / Nginx / sbin /
./nginx
./nginx -s STOP
./nginx -s quit
./nginx -s reload

5.开机自启动
cd /lib/systemd/system/
vi nginx.service
**********
[Unit]
Description=nginx
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx reload
ExecStop=/usr/local/nginx/sbin/nginx quit
PrivateTmp=true

[Install]
WantedBy=multi-user.target
**********

chkconfig nginx on

 

1. Extract the installation package
tar -zxvf redis-5.0.3.tar.gz

2.安装
make
mkdir -p /usr/local/redis
cp ./src/redis-server /usr/local/redis/
cp ./src/redis-cli /usr/local/redis/
cp ./redis.conf /usr/local/redis/

3. Set the background process started
vi redis.conf
**********
daemonize yes
#bind 127.0.0.1
requirepass 123456
**********

4.开机自启动
cd /lib/systemd/system/
vi redis-server.service
**********
[Unit]
Description=Redis Server Manager
After=syslog.target
After=network.target

[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/redis-server /usr/local/redis/redis.conf
ExecStop=/usr/local/redis/redis-cli shutdown
Restart=always

[Install]
WantedBy=multi-user.target
**********

systemctl daemon-reload
systemctl start redis-server.service
systemctl enable redis-server.service

5.开放6379端口
firewall-cmd --add-port=6379/tcp --permanent
systemctl stop firewalld
systemctl start firewalld

 

1. Extract the installation package
tar -xvf mysql-5.7.15-1.el7.x86_64.rpm-bundle.tar

2. Install the software relies
rpm -qa | grep mariadb // check if there has been MariaDB
RPM -ev MariaDB-libs-5.5.41-2.el7_0.x86_64 // unload MariaDB
yum install perl
yum install NET-Tools
yum install autoconf

3.安装
rpm -ivh MySQL-server-5.6.41-1.el7.x86_64.rpm
rpm -ivh MySQL-client-5.6.41-1.el7.x86_64.rpm
rpm -ivh MySQL-devel-5.6.41-1.el7.x86_64.rpm
rpm -ivh MySQL-shared-5.6.41-1.el7.x86_64.rpm

4. Modify the Chinese distortion
Find / -name the my.cnf
VI /usr/my.cnf
**********
[MySQL]
default = UTF8-Character-SET
[mysqld]
the character_set_server = UTF8
***** *****

5. Start & Stop Service
Service Start MySQL
Service MySQL STOP

6. Modify the default password
cat /root/.mysql_secret // view the default password
MySQL -u root -p
the SET password = password ( 'password');
flush privileges;
// remote connection authorization
grant all privileges on * * to root @. '%' IDENTIFIED by '123456';
the flush privileges;

7.开放3306端口
firewall-cmd --add-port=3306/tcp --permanent
systemctl stop firewalld
systemctl start firewalld

8. boot from the start
chkconfig mysql on

Guess you like

Origin www.cnblogs.com/xesx/p/11942256.html