nginx部署

卡子火發表於2018-04-12
  • 依賴解決

安裝pcre庫(Perl Compatible Regular Expressions;perl相容正規表示式),為了使nginx支援具備URL重寫功能的Rewrite模組。

# yum -y install pcre pcre-devel

# yum -y install openssl openssl-devel gcc

  • 依賴檢查

# rpm -qa pcre pcre-devel

  • 服務安裝

# wget http://nginx.org/download/nginx-1.12.1.tar.gz

# tar axvf nginx-1.12.1.tar.gz

# useradd nginx -s /sbin/nologin -M

# cd nginx-1.12.1

# ./configure –help

# ./configure –user=nginx –group=nginx –with-http_ssl_module –with-http_stub_status_module –prefix=/usr/local/nginx-1.12.1/

# make

# make install

  • 連結完善

# ln -sv /usr/local/nginx-1.12.1 /usr/local/nginx

  • 服務啟動

# /usr/local/nginx/sbin/nginx -t

# /usr/local/nginx/sbin/nginx

  • 功能檢測

WINDOS:瀏覽器直接輸入ip,即可出現nginx頁面;

LINUX:# curl -I 127.0.0.1

HTTP/1.1 200 OK

Server: nginx/1.12.1

Date: Sun, 03 Sep 2017 12:53:41 GMT

Content-Type: text/html

Content-Length: 612

Last-Modified: Sun, 03 Sep 2017 12:35:56 GMT

Connection: keep-alive

ETag: “59abf72c-264”

Accept-Ranges: bytes

————————————————————-

作者:羅穆瑞

轉載請保留此段宣告,且在文章頁面明顯位置給出原文連結,謝謝!

——————————————————————————

如果覺得這篇文章對你有小小的幫助的話,記得在右下角點個“推薦”哦,博主在此感謝!

——————————————————————————


相關文章