Linux lnmp 配置虛擬網域名稱 vhost

2022-08-24 05:54:11 字數 1013 閱讀 2462

1、首先假設我們的專案在/home/wwwroot/default/bathroom  (bathroom 就是我們的框架專案)

具體過程如下:

1、cd /usr/local/nginx/conf/vhost 目錄下

2、vim example1.com.conf 建立乙個檔案並把以下內容拷貝進去 ↓:

server 

error_page

500502

503504 /50x.html;

location = /50x.html

# pass the php scripts to fastcgi server listening on

127.0.0.1:9000

location ~\.php$

location ~ /\.ht

}

注意:可能你會想虛擬網域名稱不是配置在nginx檔案中嗎。為什麼會配置vhost下面

你可以  vim /user/local/nginx/conf/nginx.conf   配置檔案

找到:

,這裡預設引入 vhost 下所有的檔案,所以更方便管理

我的案例:

server 

error_page

500502

503504 /50x.html;

location = /50x.html

# pass the php scripts to fastcgi server listening on

127.0.0.1:9000

# location ~\.php$

location ~ /\.ht

}

Apache配置虛擬網域名稱

apache配置檔案的修改。apache httpd.conf,開啟httpd.conf檔案。1 找到 loadmodule rewrite module modules mod rewrite.so 把前面的 去掉。2 打到以下 斷 options followsymlinks allowover...

Xampp Apache 配置虛擬網域名稱

1.找到 c盤 window system32 drivers etc hosts檔案用記事本開啟,往裡面新增 2.找到在c盤xampp目錄進入apache conf extra httpd vhosts.conf檔案,記事本開啟在最後新增 serveradmin admin xiaoq.com d...

window apache配置虛擬網域名稱

1.c windows system32 drivers etc 網域名稱不要帶有下劃線例如 www.test domain.com 這個配置是錯誤的,但可以用中橫線 裡 www.test domain.com 更改下面的hosts檔案 有些需要移到桌面更改 格式為 ip 網域名稱 127.0.0....