/data/server 服务安装位置
/usr/local/src 安装包位置
关闭防火墙和沙盒
systemctl stop firewalld.service
setenforce 0
创建/data/server用于存放解析后的文件
mkdir -p /data/server
搭建Nginx:
源码安装nginx下载并解压
cd /usr/local/src
wget http://nginx.org/download/nginx-1.16.0.tar.gz
下载依赖包:
cd /data/server
yum install openssl openssl-devel zlib zlib-devel pcre pcre-devel gcc gcc-c++ -y
进到目录下:
cd /usr/local/src/nginx-1.16.0
编译安装:
./configure --prefix=/data/server/nginx #(编译安装的路径,将服务都放在/data/server下)
make && make install
Nginx配置文件目录:/data/server/nginx/conf
进到编译好的Nginx下,启动Nginx:
cd /data/server/nginx/sbin
./nginx
检测:./nginx -t
查看进程
ps aux | grep nginx
打开浏览器输入本机IP
搭建Mysql:
源码安装mysql下载源码包:
cd /usr/local/src
解压:
unzip AliSQL-AliSQL-5.6.32-9.zip
下载依赖环境包:
yum -y install cmake bison git ncurses-devel gcc gcc-c++
添加用户:
groupadd mysql
useradd -g mysql mysql
安装perl然后解压:
Wget http://repo.openfusion.net/centos7-x86_64//perl-Data-Dumper-2.154-1.of.el7.x86_64.rpm
rpm -ivh
http://repo.openfusion.net/centos7-x86_64//perl-Data-Dumper-2.154-1