国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Nginx > 正文

nginx安裝(1) ttlsa教程系列之nginx

2024-08-30 12:27:05
字體:
來源:轉載
供稿:網友

當今nginx的勁頭越來越猛,記得2011年版本才1.0.6,現在已經更新到了1.5.1,nginx的更新速度越來越快。一直想記錄一系列的nginx教程,處于各種原因沒去做.今年抽出時間完成平時工作上用到的nginx.后續將會以視頻教程的方式來做。當然,還是文章先出,下一篇文章將會講nginx虛擬主機配置。有什么建議,望大家留言。

1、必要軟件準備

•安裝pcre
為了支持rewrite功能,我們需要安裝pcre

view sourceprint?
# yum install pcre* //如過你已經裝了,請跳過這一步
•安裝openssl
需要ssl的支持,如果不需要ssl支持,請跳過這一步

代碼如下:
# yum install openssl*

2、安裝nginx
執行如下命令:

代碼如下:
# ./configure --prefix=/usr/local/nginx-1.5.1 / 
--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 for zlib library ... found
 creating objs/Makefile
Configuration summary
 + 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"
# make //確定你的服務器有安裝make,如果沒有安裝請執行yum install make
 # make install

3、啟動、關閉、重置nginx
啟動:直接執行以下命令,nginx就啟動了,不需要改任何配置文件,nginx配置多域名虛擬主機請參考后續文章.

代碼如下:
/usr/local/nginx-1.5.1/sbin/nginx

試試訪問:我這邊不貼圖,直接使用curl命令來讀取web信息

代碼如下:
[root@ns conf]# curl -s http://localhost | grep nginx.com 

nginx.com.
關閉:

代碼如下:
/usr/local/nginx-1.5.1/sbin/nginx -s stop

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 和龙市| 毕节市| 岫岩| 潮安县| 吴江市| 扶风县| 偃师市| 康平县| 淳化县| 景谷| 利辛县| 乐山市| 麻栗坡县| 承德市| 辽源市| 洪泽县| 宣汉县| 来安县| 铜陵市| 高清| 冕宁县| 新民市| 太仓市| 平湖市| 普兰店市| 云安县| 碌曲县| 闻喜县| 海宁市| 大冶市| 彭州市| 乡城县| 温泉县| 西青区| 长汀县| 雅江县| 左贡县| 个旧市| 三台县| 普格县| 淮阳县|