记录下自己阿里云服务器下Nginx的安装过程,方便后续查阅。
环境说明:CentOs7.2
1.先安装相关依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
1
1
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2.创建文件夹,下载nginx
cd /usr
mkdir nginx
cd nginx
wget http://nginx.org/download/nginx-1.14.0.tar.gz
tar -zxvf nginx-1.14.0.tar.gz
mv nginx-1.14.0 nginx-1.14 #改个名
6
1
cd /usr
2
mkdir nginx
3
cd nginx
4
wget http://nginx.org/download/nginx-1.14.0.tar.gz
5
tar -zxvf nginx-1.14.0.tar.gz
6
mv nginx-1.14.0 nginx-1.14 #改个名
3.安装nginx
cd /usr/nginx/nginx-1.14
./configure
make
make install
4
1
cd /usr/nginx/nginx-1.14
2
./configure
3
make
4
make install
4.启动
# 安装完成后,nginx被默认安装在了在/usr/loacl/nginx这个文件夹下
/usr/local/nginx/sbin/nginx
# nginx配置文件在/usr/local/nginx/conf下面
3
1
# 安装完成后,nginx被默认安装在了在/usr/loacl/nginx这个文件夹下
2
/usr/local/nginx/sbin/nginx
3
# nginx配置文件在/usr/local/nginx/conf下面
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/6551.html