已備案的主域名,例如:http://www.test.com/擁有自己的服務(wù)器服務(wù)器環(huán)境 LNMP 目標(biāo): 配置一個(gè)二級(jí)域名: http://bbs.test.com

1 登錄域名后臺(tái)(阿里為例)

記錄類型: A

主機(jī)記錄: bbs(二級(jí)域名的名字)

記錄值:服務(wù)器IP" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

18143453325 在線咨詢 在線咨詢
18143453325 在線咨詢
所在位置: 首頁(yè) > 營(yíng)銷資訊 > 建站知識(shí) > 【LNMP】配置二級(jí)域名

【LNMP】配置二級(jí)域名

時(shí)間:2023-02-07 22:08:01 | 來(lái)源:建站知識(shí)

時(shí)間:2023-02-07 22:08:01 來(lái)源:建站知識(shí)

準(zhǔn)備:

目標(biāo): 配置一個(gè)二級(jí)域名: http://bbs.test.com

1 登錄域名后臺(tái)(阿里為例)

記錄類型: A

主機(jī)記錄: bbs(二級(jí)域名的名字)

記錄值:服務(wù)器IP地址

2 添加域名文件夾:

登錄你的服務(wù)器,

在路徑 /home/wwwroot/ 目錄下新建文件夾 http://bbs.test.com ,并賦權(quán)限777

(個(gè)人服務(wù)器。便于管理??梢灾苯?77,其他商用的或者公司的服務(wù)器要參看權(quán)限模塊。自行網(wǎng)上查吧)

在路徑 /home/wwwlogs/ 目錄下新建文件 bbs.test.com.log

3 添加配置文件

進(jìn)入路徑:/usr/local/nginx/conf/vhost 新建文件:bbs.test.com.conf

復(fù)制主域名的配置文件內(nèi)容到 二級(jí)域名配置中。修改如下

server { listen 80; #listen [::]:80; server_name bbs.test.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/bbs.test.com/; include other.conf; #error_page 404 /404.html; include enable-php.conf; location ~ .*/.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*/.(js|css)?$ { expires 12h; } location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } location ~ //. { deny all; } access_log /home/wwwlogs/bbs.test.com.log; }完成之后。重啟nginx


#nginx命令 start: /usr/local/nginx/sbin/nginx stop: /usr/local/nginx/sbin/nginx -s stop reload: /usr/local/nginx/sbin/nginx -s reload 4 測(cè)試: 在你二級(jí)域名文件夾。添加一個(gè)文件,訪問(wèn),就可以了。。

PS: 其他二級(jí)域名也是這樣。??梢蕴砑佣鄠€(gè),都是這個(gè)步驟

關(guān)鍵詞:配置

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點(diǎn)擊下載Chrome瀏覽器
關(guān)閉