进入centos命令行终端 开始输入命令
一 安装nginx
1:yum install gcc gcc-c++ # 安装依赖
2:wget http://nginx.org/download/nginx-1.17.1.tar.gz # 下载nginx源码
3:tar -zxvf nginx-1.17.1.tar.gz # 解压
4:cd nginx-1.17.1 # 进入解压后的文件夹
5:./configure --prefix=/usr/local/nginx # 配置nginx安装路径
6:make && make install
7:ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx # 创建nginx软链接,若已被占用,则在 /usr/bin 下 rm-rf nginx
8:nginx # 启动ngixn
9:nginx -s stop # 停止nginx服务
二 安装mysql
1:wget http://dev.mysql.com/get/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar #下载mysql安装包
2:tar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar #解压安装包
3:rpm -qa|grep mari #查询mariadb相关安装包 有则卸载
4:rpm -e --nodeps mariadb-libs #卸载mariadb相关
5:rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm #依次安装mysql
6:rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm
7:rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm
8:rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm
9:systemctl start mysqld.service #启动mysql
当然还有更简便的方式 直接输入命令安装宝塔可视化管理界面
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh ed099927