LNMP配置 Nginx配置 使用者認證

2022-06-25 05:36:10 字數 1179 閱讀 7615

一、配置

再來建立乙個新的虛擬主機

#cd /usr/local/nginx/conf/vhost

#vi test.com.conf

寫入:server

//安裝httpd,也可以使用之前編譯安裝的apache2.4

下面建立和更新用於基本認證的使用者認證密碼檔案

二、測試

狀態碼401

# curl -udongying:dongying -x127.0.0.1:80 test.com

[root@localhost vhost]# systemctl stop firewalld 

[root@localhost vhost]# setenforce 0

關閉防火牆

編輯c:\windows\system32\drivers\etc\hosts檔案,新增對映

終端的ip test.com  ifconfig 檢視

開啟瀏覽器訪問test.com

搭建LNMP架構 Nginx 配置

lnmp平台就是linux ngnix mysql php的組合架構,需要linux伺服器 mysql資料庫 php解析環境。1 安裝編譯工具 準備好相關的壓縮檔案,並共享出來,然後進行掛載,再進行壓縮。root localhost systemctl stop firwalld.service 關...

LNMP之nginx的基本配置

注 nginx 的nginx.conf檔案中 listen監控的埠要和 php fpm listen的監控埠一致,這樣就沒有502的問題。1.nginx使用者認證 location admin php 2.網域名稱跳轉301 302重定向 server name www.test.com www.a...

LNMP安裝與配置之Nginx

nginx engine x 是乙個高效能的http和反向 web伺服器,同時也提供了imap pop3 smtp服務。nginx是由伊戈爾 賽索耶夫為俄羅斯訪問量第二的rambler.ru站點 俄文 開發的,第乙個公開版本0.1.0發布於2004年10月4日。特點是占有記憶體少,併發能力強,事實上...