1. 程式人生 > >nginx之一:nginx安裝

nginx之一:nginx安裝

round -h style 百度 編譯安裝 yum module rewrite spa

1、必要軟件準備

安裝pcre

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

#yum install pcre-devel//如果你已經安裝了,請跳過這一步

安裝openssl

如果需要ssl的支持安裝,如果不需要ssl支持請跳過這一步

#yum install openssl-devel

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 了。 .....

編譯安裝

#make

#make install

3、啟動、重啟、重新加載nginx

啟動:

/usr/local/nginx-1.5.1/sbin/nginx

關閉:

/usr/local/nginx-1.5.1/sbin/nginx -s stop

重新加載配置文件

/usr/local/nginx-1.5.1/sbin/nginx -s reload

nginx之一:nginx安裝