nginx的安装

  1. nginx依赖于zlib,pcre和openssl库
    安装方法:1. 通过源代码安装 zlib的下载地址 http://www.zlib.net/
    pcre的下载地址 http://www.pcre.org/
    openssl的下载地址 https://www.openssl.org
    安装方法既是普通的configure & make & make install
    2. 通过apt安装 apt-get install zlib1g-dev
    apt-get install libpcre3-dev
    apt-get install libssl-dev

  2. 下载nginx的源代码 wget http://nginx.org/download/nginx-1.4.2.tar.gz

    nginx的配置 ./configure –prefix=/usr/local/nginx,如果通过源码安装
    则还需要指定依赖库的路径

  3. 启动nginx

    1. 执行/usr/local/nginx/sbin/nginx
    2. 验证nginx执行: ps -ef | grep nginx
  4. 验证nginx

    1. ubuntu内网安装 web查看 http://localhost

    2. cloud服务器安装 查询得到公网ip
      web查看 http://xxx.xxx.xxx.xxx

ubuntu12.04部署nginx服务器

相关文章: