Linux下安装nginx

        记录下自己阿里云服务器下Nginx的安装过程,方便后续查阅。环境说明:CentOs7.2

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	#改个名

3.安装nginx

cd /usr/nginx/nginx-1.14
./configure
make
make install

4.启动

# 安装完成后,nginx被默认安装在了在/usr/loacl/nginx这个文件夹下
/usr/local/nginx/sbin/nginx
# nginx配置文件在/usr/local/nginx/conf下面
posted @ 2018-08-06 16:26  zeng1994  阅读(242)  评论(0编辑  收藏  举报