标签:style   http   使用   os   io   strong   文件   for   
当今nginx的 劲头越来越猛,记得2011年版本才1.0.6,现在已经更新到了1.5.1,nginx的更新速度越来越快。一直想记录一系列的nginx教程,处于各 种原因没去做.今年抽出时间完成平时工作上用到的nginx.后续将会以视频教程的方式来做。当然,还是文章先出,下一篇文章将会讲nginx虚拟主机配 置。有什么建议,望大家留言。
1、必要软件准备
为了支持rewrite功能,我们需要安装pcre
需要ssl的支持,如果不需要ssl支持,请跳过这一步
2、安装nginx
执行如下命令:
| --with-http_ssl_module --with-http_spdy_module \ | 
 
| --with-http_stub_status_module --with-pcre | 
 
 
 
–with-http_stub_status_module:支持nginx状态查询
–with-http_ssl_module:支持https
–with-http_spdy_module:支持google的spdy,想了解请百度spdy,这个必须有ssl的支持
–with-pcre:为了支持rewrite重写功能,必须制定pcre
最后输出如下内容,表示configure OK了。
…..
| checking forzlib library ... found | 
 
|  + using system PCRE library | 
 
|  + using system OpenSSL library | 
 
|  + md5: using OpenSSL library | 
 
|  + sha1: using OpenSSL library | 
 
|  + using system zlib library | 
 
| nginx path prefix: "/usr/local/nginx-1.5.1" | 
 
|  nginx binary file: "/usr/local/nginx-1.5.1/sbin/nginx" | 
 
|  nginx configuration prefix: "/usr/local/nginx-1.5.1/conf" | 
 
|  nginx configuration file: "/usr/local/nginx-1.5.1/conf/nginx.conf" | 
 
|  nginx pid file: "/usr/local/nginx-1.5.1/logs/nginx.pid" | 
 
|  nginx error log file: "/usr/local/nginx-1.5.1/logs/error.log" | 
 
|  nginx http access log file: "/usr/local/nginx-1.5.1/logs/access.log" | 
 
|  nginx http client request body temporary files: "client_body_temp" | 
 
|  nginx http proxy temporary files: "proxy_temp" | 
 
|  nginx http fastcgi temporary files: "fastcgi_temp" | 
 
|  nginx http uwsgi temporary files: "uwsgi_temp" | 
 
|  nginx http scgi temporary files: "scgi_temp" | 
 
 
 
3、启动、关闭、重置nginx
启动:直接执行以下命令,nginx就启动了,不需要改任何配置文件,nginx配置多域名虚拟主机请参考后续文章.
| /usr/local/nginx-1.5.1/sbin/nginx | 
 
 
 
试试访问:我这边不贴图,直接使用curl命令来读取web信息
关闭:
| /usr/local/nginx-1.5.1/sbin/nginx -s stop | 
 
 
 
重置:当你有修改配置文件的时候,只需要reload以下即可
| /usr/local/nginx-1.5.1/sbin/nginx -s reload | 
 
 
 
整个nginx的安装就到这里结束了。
转载请注明出处:http://www.ttlsa.com/html/1548.html
nginx安装(1) – ttlsa教程系列之nginx,布布扣,bubuko.com
nginx安装(1) – ttlsa教程系列之nginx
标签:style   http   使用   os   io   strong   文件   for   
原文地址:http://www.cnblogs.com/swordxia/p/3897307.html