標籤:style blog http color strong 檔案
Nginx 伺服器就不贅述了,此軟體在大流量、高並發的情況下,效能非常優越,而且佔用的CPU和記憶體資源非常之低!
請確認有 PCRE 庫,如果沒有,請安裝之,因為Nginx 的 Rewrite 模組需要它。
[plain] view plaincopyprint?
- yum -y install pcre pcre-devel
yum -y install pcre pcre-devel
下面開始安裝Nginx:
[plain] view plaincopyprint?
- wget http://nginx.org/download/nginx-1.0.2.tar.gz
- tar zxvf nginx-1.0.2.tar.gz
- cd nginx-1.0.2
- ./configure --prefix=/usr/local/nginx
- make
- make install
wget http://nginx.org/download/nginx-1.0.2.tar.gztar zxvf nginx-1.0.2.tar.gzcd nginx-1.0.2./configure --prefix=/usr/local/nginxmakemake install
當然,也可以選擇更為簡單的安裝方式:
[plain] view plaincopyprint?
- yum install nginx
yum install nginx
安裝完成後,操作Nginx :
[plain] view plaincopyprint?
- /usr/local/nginx/sbin/nginx 啟動 Nginx
- /usr/local/nginx/sbin/nginx -s stop 停止 Nginx
- /usr/local/nginx/sbin/nginx -s reload 重啟 Nginx
/usr/local/nginx/sbin/nginx 啟動 Nginx/usr/local/nginx/sbin/nginx -s stop 停止 Nginx/usr/local/nginx/sbin/nginx -s reload 重啟 Nginx
在瀏覽器中輸入:
[plain] view plaincopyprint?
- http://127.0.0.1 或 http://localhost
http://127.0.0.1 或 http://localhost
頁面顯示" OK ",表明安裝成功!
關於Nginx 的設定檔,就不多說了,可以參考Nginx 官網文檔,自行配置!