LINUX下负载均衡NGINX安装

1、安装GCC编译环境,若是有则不须要html

      1)安装mpc库nginx

      2)安装gmp库浏览器

      3)安装mpfr库tcp

      4) 安装GCC.net

     以上GCC的安装不缀述,可参考各类大神步骤;htm

2、安装pcre库blog

     https://sourceforge.net/projects/pcre/files/pcre/进程

     下载后解压并在解压文件夹目录内ssl

      ./configureopenssl

      make

      make install

      若是须要安装的库都安装了在执行./configure时还报错,则可用如下参数从新执行;      ./configure --disable-shared --with-pic

3、安装zlib库

      http://zlib.net/zlib-1.2.8.tar.gz

      ./configure

      make

      make install

4、安装openssl库

      https://www.openssl.org/

      ./configure

      make

      make install

以上不安装的话,在编译会各类报错;另外,安装完以上后须要将其bin目录添加到PATH中,不然编译会因找不到全命令报错;

5、NGINX安装

     http://nginx.org/en/download.html

     一样在解压后进入文件夹执行三步

     ./configure

     make

     make install

 

如下,完成了安装,经过 /usr/local/nginx/sbin/nginx 完成启动;查看进程是否已经启动:

ps -ef | grep nginx

root     19476     1  0 08:34 ?        00:00:00 nginx: master process ./nginx
nobody   19477 19476  0 08:34 ?        00:00:00 nginx: worker process
有一个主进程,有一个处理进程;

查看是否监听80端口

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN

浏览器输入 http://安装机器的IP/ ,如 http://localhost/

显示进入到了nginx的欢迎页面,即安装成功。

相关文章
相关标签/搜索