nginx開發環境配置步驟:
1. 檢視nginx配置檔案位置:ps -ef |grep nginx
-c 是指用的 /etc/nginx/nginx.conf 這個的配置檔案。
2. 檢視配置檔案: cat /etc/nginx/nginx.conf,最後幾行中
nginx的虛擬網域名稱配置都放這個裡面了。 載入是以.conf 結尾的,在include conf.d/*.conf 下新增一條你自己的開發配置位址。如:include test/*.conf
3. 建立自己的目錄:cd /etc/nginx 進入到這個目錄後,mkdir yourlist建立自己的開發配置目錄(yourlist即conf.d)
vim www.mysite.com.conf,編輯配置檔案
server
}
4. 建立開發目錄:
mkdir workplace 建立開發目錄
cd workplace 進入到目錄中
mkdir -p www 建立多個目錄
cd www
vim index.php
<?php
phpinfo();
?>
給資料夾增加可執行許可權:
chmod +x /home
chmod +x /home/workplace
chmod +x /home/www
5. 監測 nginx的配置檔案是否有異常: /usr/sbin/nginx -t
如圖所示就ok說明沒問題;
6. /usr/sbin/nginx -s reload 載入你最新的配置
7. 繫結host網域名稱
然後在瀏覽器上訪問就好了。出來phpinfo()的內容了。
Nginx 開發環境配置
2.啟動指令碼 set path path c webserver nginx 監聽埠 listen 9999 server name localhost 工作目錄 root d workspace server www nginx nginx 內部採用相對路徑配置執行,單純將 nginx 命令加入...
nginx 環境配置
1。nginx 安裝 2.配置nginx支援php fpm模組 2.2 安裝命令 tar xvzf php 7.0.5.tar.gz cd php 7.0.5 yum y install libxml2 yum y install libxml2 develyum y install openssl...
nginx 環境配置
近來,nginx以其高效能吸引大批web開發者,各大門戶 大多都採用nginx作為web伺服器,關於nginx的介紹,網上已有大量文 章,筆者就不在此贅述,關於linux上nginx的搭建網上也有大量文章,但在windows上卻為數不多,今天就為大家簡單介紹windows7環境 下nginx php...