1.解压安装包
tar -zxvf nginx-1.14.2.tar.gz
2.安装依赖软件
yum -y install gcc//安装gcc
yum -y install pcre pcre-devel//安装pcre
yum -y install zlib zlib-devel//安装alib
yum -y install openssl openssl-devel//安装openssl
3.安装nginx
./configure//配置
make//编译
make install//安装
4.启动&停止
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.解压安装包
tar -zxvf redis-5.0.3.tar.gz
2.安装redis
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.设置后台进程启动
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.解压安装包
tar -xvf mysql-5.7.15-1.el7.x86_64.rpm-bundle.tar
2.安装依赖软件
rpm -qa | grep mariadb //检查是否已经存在mariadb
rpm -ev mariadb-libs-5.5.41-2.el7_0.x86_64 //卸载mariadb
yum install perl
yum install net-tools
yum install autoconf
3.安装mysql
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.修改中文乱码
find / -name my.cnf
vi /usr/my.cnf
**********
[mysql]
default-character-set=utf8
[mysqld]
character_set_server=utf8
**********
5.启动&停止服务
service mysql start
service mysql stop
6.修改默认密码
cat /root/.mysql_secret //查看默认密码
mysql -u root -p
set password=password('password');
flush privileges;
//远程连接授权
grant all privileges on *.* to root@'%' identified by '123456';
flush privileges;
7.开放3306端口
firewall-cmd --add-port=3306/tcp --permanent
systemctl stop firewalld
systemctl start firewalld
8.开机自启动
chkconfig mysql on