SUSE Linux Enterprise Server 15 Install nginx 1.15

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hanzheng260561728/article/details/81457196

下载nginx需要的依赖包到/usr/local/src/
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz
wget https://www.openssl.org/source/openssl-1.1.0h.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
wget http://nginx.org/download/nginx-1.15.2.tar.gz

赋予目录权限
chmod -R 777 /usr/local/src/

依赖环境
zypper -n install gcc gcc-c++ make

解压编译pcre
tar -zxvf pcre-8.42.tar.gz
cd pcre-8.38
./configure
make && make install

解压编译zlib
tar -xvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make && make install

解压openssl即可(注意不要编译安装)
tar -zxvf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c

创建nginx用户
useradd -s /sbin/nologin -M www

解压编译nginx
tar -zxvf nginx-1.15.2.tar.gz

./configure --user=www --group=www --prefix=/usr/local/nginx  --with-pcre=/usr/local/src/pcre-8.42 --with-zlib=/usr/local/src/zlib-1.2.8 --with-openssl=/usr/local/src/openssl-1.1.0h --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_realip_module --with-stream --with-stream_ssl_module --with-http_flv_module --with-http_mp4_module --with-http_dav_module --with-http_sub_module  --with-http_gunzip_module --with-pcre --with-debug

make && make install

检查语法
 /usr/local/nginx/sbin/nginx -t

创建nginx软连接
ln -s /usr/local/nginx/sbin/* /usr/local/sbin/

查找安装路径
whereis nginx

猜你喜欢

转载自blog.csdn.net/hanzheng260561728/article/details/81457196