一:软件包安装更新
1.更新系统软件包
yum update -y
2.安装软件管理包和可能使用的依赖
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel psmisc libffi-devel
yum -y groupinstall "Development tools"
二:安装MySQL-5.7
1.下载
wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2.安装
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
3.启动mysql57并查看启动状态
systemctl start mysqld.service
systemctl status mysqld.service
4.查看默认密码,并登陆
grep "password" /var/log/mysqld.log
mysql -uroot -p
5.修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
三:安装Redis-5.0.5
1.下载
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
2.解压
tar -xf redis-5.0.5.tar.gz
3.进入解压后的文件夹
cd redis-5.0.5
4.编译环境
make
5.复制环境到指定路径完成安装
cp -r ~/redis-5.0.5 /usr/local/redis
6.建立软链接
ln -s /usr/local/redis/src/redis-server /usr/bin/redis-server
ln -s /usr/local/redis/src/redis-cli /usr/bin/redis-cli
7.后台运行Redis
cd /usr/local/redis
redis-server
按Ctrl+C
即可停止
8.测试redis环境
redis-cli
9.关闭redis服务
pkill -f redis -9
四:安装Python-3.6
1.下载
wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xz
2.解压
tar -xf Python-3.6.7.tar.xz
3.进入目标文件
cd Python-3.6.7
4.配置安装路径:/usr/local/python3
./configure --prefix=/usr/local/python3
5.编译并安装
make && sudo make install
6.建立软连接:终端命令 python3,pip3
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip3
五:安装Nginx
0.什么是Nginx
Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器
Apache和Nginx最核心的区别在于 apache 是同步多进程模型,一个连接对应一个进程;
而 nginx 是异步的,多个连接(万级别)可以对应一个进程
作用:
http请求转发
反向代理服务器
负载均衡
动静分离
1.下载
wget http://nginx.org/download/nginx-1.13.7.tar.gz
2.解压
tar -xf nginx-1.13.7.tar.gz
3.进入目标文件
cd nginx-1.13.7
4.配置安装路径:/usr/local/nginx
./configure --prefix=/usr/local/nginx
5.编译并安装
make && sudo make install
6.建立软链接
ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
7.测试Nginx环境,服务器运行nginx,本地访问服务器ip
nginx
>: 服务器绑定的域名 或 ip:80
8.Nginx命令
# 启动
nginx
# 关闭nginx
nginx -s stop
# 重启nginx
nginx -s reload
# 查看端口,强行关闭
ps -aux|grep nginx
kill <pid:进程编号>