日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Linux的Nginx六:源码|安装

發(fā)布時間:2024/9/19 linux 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux的Nginx六:源码|安装 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

源碼

概述

可以使用yum install tree來安裝tree命令,就可以顯示出文件的樹結構

可以看出共有10 directories, 265 files,Nginx的主要模塊是Core、event、http、mail、misc(雜項,包含多種功能)、os這幾個部分,并且根據源代碼的命名也可以大致的猜測出其所代表的功能。?

[root@iZ94sni08orZ nginx-1.8.0]# tree src/ src/ ├── core │ ├── nginx.c │ ├── nginx.h │ ├── ngx_array.c │ ├── ngx_array.h │ ├── ngx_buf.c │ ├── ngx_buf.h │ ├── ngx_conf_file.c │ ├── ngx_conf_file.h │ ├── ngx_config.h │ ├── ngx_connection.c │ ├── ngx_connection.h │ ├── ngx_core.h │ ├── (省略部分) │ ├── ngx_times.c │ └── ngx_times.h ├── event │ ├── modules │ │ ├── ngx_aio_module.c │ │ ├── ngx_devpoll_module.c │ │ ├── ngx_epoll_module.c │ │ ├── ngx_eventport_module.c │ │ ├── ngx_kqueue_module.c │ │ ├── ngx_poll_module.c │ │ ├── ngx_rtsig_module.c │ │ ├── ngx_select_module.c │ │ └── ngx_win32_select_module.c │ ├── ngx_event_accept.c │ ├── ngx_event.c │ ├── ngx_event_connect.c │ ├── ngx_event_connect.h │ ├── (省略部分) │ └── ngx_event_timer.h ├── http │ ├── modules │ │ ├── ngx_http_access_module.c │ │ ├── ngx_http_addition_filter_module.c │ │ ├── ngx_http_auth_basic_module.c │ │ ├── ngx_http_auth_request_module.c │ │ ├── ngx_http_autoindex_module.c │ │ ├── ngx_http_browser_module.c │ │ ├── ngx_http_charset_filter_module.c │ │ ├── ngx_http_chunked_filter_module.c │ ├── (省略部分) │ │ ├── ngx_http_uwsgi_module.c │ │ ├── ngx_http_xslt_filter_module.c │ │ └── perl │ │ ├── Makefile.PL │ │ ├── nginx.pm │ │ ├── nginx.xs │ │ ├── ngx_http_perl_module.c │ │ ├── ngx_http_perl_module.h │ │ └── typemap │ ├── ngx_http.c │ ├── ngx_http_cache.h │ ├── ngx_http_config.h │ ├── ngx_http_header_filter_module.c │ ├── (省略部分) │ ├── ngx_http_variables.h │ └── ngx_http_write_filter_module.c ├── mail │ ├── ngx_mail_auth_http_module.c │ ├── ngx_mail.c │ ├── (省略部分) │ ├── ngx_mail_ssl_module.c │ └── ngx_mail_ssl_module.h ├── misc │ ├── ngx_cpp_test_module.cpp │ └── ngx_google_perftools_module.c └── os└── unix├── ngx_aio_read.c├── ngx_aio_read_chain.c├── ngx_aio_write.c├── (省略部分)├── ngx_udp_recv.c├── ngx_user.c├── ngx_user.h└── ngx_writev_chain.c10 directories, 265 files

編譯

1、為了支持rewrite功能,我們需要安裝pcre # yum install pcre* //如過你已經裝了,請?zhí)^這一步2.安裝openssl 需要ssl的支持,如果不需要ssl支持,請?zhí)^這一步# yum install openssl*3.gzip 類庫安裝 yum install zlib zlib-devel (注:如果是Ubuntu的話,直接使用命令sudo apt-get install nginx 進行下載即可)4、準備好源碼,進行解壓tar -zxvf nginx-1.8.0.tar.gz 5、編譯和安裝,執(zhí)行如下命令: # cd nginx-1.8.0 # ./configure --prefix=/usr/local/nginx-1.7.0 \ --with-http_ssl_module --with-http_spdy_module \ --with-http_stub_status_module --with-pcre–with-http_stub_status_module:支持nginx狀態(tài)查詢 –with-http_ssl_module:支持https –with-http_spdy_module:支持google的spdy,想了解請百度spdy,這個必須有ssl的支持 –with-pcre:為了支持rewrite重寫功能,必須制定pcre(如果這里有提示還需要安裝其他的包,安裝即可)設置之后,執(zhí)行make 結束之后執(zhí)行 make install啟動命令在/usr/local/nginx-1.8.0/sbin文件下 啟動:./nginx 關閉:./nginx -s stop 重啟:./nginx -s reload

?

總結

以上是生活随笔為你收集整理的Linux的Nginx六:源码|安装的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。