linuix 下 nginx安裝和配置

2021-10-19 18:13:27 字數 884 閱讀 8492

linux版本:centos7 64位

在安裝nginx前首先要確認系統中安裝了gcc、pcre-devel、zlib-devel、openssl-devel。

linux下檢查是否安裝過某軟體包:

安裝命令:

tar -zxvf nginx-1.19.7.tar.gz
##進入nginx目錄

cd nginx-1.19.7
.

/configure --prefix=/usr/local/soft/nginx

ok,現在可以執行make 了。

make

make install

測試是否安裝成功

cd到剛才配置的安裝目錄/usr/loca/nginx/

.

/sbin/nginx -t

正常情況的資訊輸出:

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

啟動nginx

成功!

windows下安裝和配置nginx

2.解壓到e nginx 3.在e nginx 開啟命令列視窗執行 start nginx 4.瀏覽器開啟http localhost,可以看到歡迎介面,表示安裝成功 5.開啟e nginx conf nginx.conf進行配置 如下所示 當出現404頁面的時候,開啟e nginx logs下的錯...

Mac下nginx安裝和配置

nginx安裝 brew search nginx brew install nginx 安裝完以後,可以在終端輸出的資訊裡看到一些配置路徑 usr local etc nginx nginx.conf 配置檔案路徑 usr local var www 伺服器預設路徑 usr local cella...

docker下安裝nginx和php

我使用的是centos7.0系統,具體安裝要求,大家可以去官網上查詢 sudo yum config manager add repo 新增源資訊 sudo yum makecache fast 更新yum快取 sudo yum y install docker ce 安裝ce版本 sudo sys...