`

安装Nginx

 
阅读更多

首先是依赖关系

1. gzip module requires zlib library 是提供数据压缩用的函式库

  下载地址http://zlib.net/

  或者直接http://zlib.net/zlib-1.2.7.tar.gz

2. rewrite module requires pcre library

   pcre (Perl Compatible Regular Expressions) 包括 perl 兼容的正规表达式库

  下载地址http://pcre.org/ 可以查看相关现在地址。或者直接        ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.gz
3. ssl support requires openssl library 一个基于密码学的安全开发包,提供了主要的密码算法、常用的密钥和证书封装管理功能以及SSL协议,并提供了丰富的应用程序供测试或其它目的使用

  下载地址http://www.openssl.org/source/

  或者直接http://www.openssl.org/source/openssl-1.0.1c.tar.gz

 

以上依赖的安装基本上都是先上传到服务器上,例如scp /Users/zt/Develop/zlib-1.2.7.tar.gz root@10.211.55.10:/software/zlib-1.2.7.tar.gz

然后 tar zxf zlib-1.2.7.tar.gz或者直接在服务器上用wget下载,也可以根据操作系统直接使用yum或者apt-get命令下载安装。如果下载的是zip就用unzip解压

然后./configure,有的是config(openssl)

make

make install

 

Nginx ./configure可能会显示如下信息。如果相应的说没有找到的组件可以先下载安装 。

Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using builtin md5 code
  + sha1 library is not found
  + using system zlib library

 

openssl是解压出来的,cnfigure的时候可以制定目录,使用如下命令

./configure  --with-http_ssl_module --with-openssl=/software/openssl-1.0.1c
其他默认安装的一般不用指定路径,其他configure参数参见http://nginx.org/en/docs/install.html

 

make

make install 之后执行/usr/local/nginx/sbin/nginx(根据自己的安装路径)看是否可以启动成功

如果出现nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use),则使用netstat -tunlp(相关参数参考http://www.cnblogs.com/ggjucheng/archive/2012/01/08/2316661.html)查看端口使用,停止占用端口的服务。然后启动再。

 



  


  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics