继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

nginx完全离线部署

2018-05-31 11:59:157734浏览

Allen

4实战 · 10手记 · 9推荐
TA的实战

有一些参与实际项目部署的童鞋都知道,在一个完全离线的过程中进行中间件部署是一件很痛苦的事,这里就记录一下再Readhat中独立部署一个Nginx的过程。
1、创建nginx专属用户

用户/用户组 www/www

创建用户组 groupadd www

创建用户 useradd www -g www -p neusoft

2、安装必要依赖

2.1 gcc安装

       进入Packages包内

执行以下安装命令

       rpm -ivh kernel-headers-2.6.32-573.el6.x86_64.rpm

       rpm -ivh glibc-headers-2.12-1.166.e16.x86_64.rpm

       rpm -ivh glibc-devel-2.12-1.166.e16.x86_64.rpm

       rpm -ivh mpfr-2.4.1-6.e16.x86_64.rpm

       rpm -ivh ppl-0.10.2-11.e16.x86_64.rpm

       rpm -ivh cloog-ppl-0.15.7-1.2.e16.x86_64.rpm

       rpm -ivh cpp-4.4.7-16.e16.x86_64.rpm

       rpm -ivh libgomp-4.4.7-16.e16.x86_64.rpm

       rpm -ivh gcc-4.4.7-16.e16.x86_64.rpm

       rpm -ivh libstdc++-devel-4.4.7-16.e16.x86_64.rpm

       rpm -ivh gcc-c++-4.4.7-16.e16.x86_64.rpm

2.2 安装zlib

       rpm -ivh zlib-1.2.3-29.e16.x86_64.rpm

       rpm -ivh zlib-devel-1.2.3-29.e16.x86_64.rpm

2.3 安装openssl

rpm -ivh openssl-1.0.1e-42.e16.x86_64.rpm

       rpm -ivh libcom_err-devel-1.41.12-22.e16.x86_64.rpm

       rpm -ivh libsepol-devel-2.0.41-4.e16.x64_64.rpm

       rpm -ivh libselinux-devel-2.0.94-5.8.e16.x86_64.rpm

       rpm -ivh keyutils-libs-devel-1.4-5.e16.x86_64.rpm

       rpm -ivh krb5-devel-1.10.3-42.e16.x86_64.rpm

rpm -ivh openssl-devel-1.0.1e-42.e16.x86_64.rpm

2.4 安装pcre

找到/opt/software/pcre-8.40.zip

解压

执行如下命令:

./configure

            make

            make install

3、安装nginx

找到/opt/software/nginx-1.12.0.tar.gz

解压至相应目录

执行以下命令:

./configure \

--prefix=/usr/local/nginx \

--with-http_stub_status_module \

--with-http_ssl_module \

--with-http_realip_module

make & make install

4、将相应的配置文件拷贝至/usr/local/nginx/conf目录下

/opt/conf/nginx.conf

/opt/conf/nginx_9093.conf

5、启动nginx

创建软连接: ln -s /usr/local/lib/libpcre.so.1 /lib64/

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx_9093.conf

6、关闭防火墙

service iptables stop

chkconfig iptables off

打开App,阅读手记
5人推荐
发表评论
随时随地看视频慕课网APP