購(gòu)物車中還沒(méi)有商品,趕緊選購(gòu)吧!

Linux apache 域名綁定方法

發(fā)布日期:2017-10-18 閱讀:6181

以下配置的路徑以阿里云提供的標(biāo)準(zhǔn)環(huán)境路徑為準(zhǔn),如果您另行安裝,請(qǐng)根據(jù)實(shí)際安裝路徑去找到您的配置文件進(jìn)行配置。

       假如我們需要在我們的網(wǎng)站www.test.com上增加綁定一個(gè)m.test.com和一個(gè)test.com的域名,請(qǐng)進(jìn)行如下類似的操作:

1.cd /alidata/server/httpd/conf/vhosts/ 找到您的網(wǎng)站配置文件,一般是您的域名.conf,例如域名是:www.test.com,那就應(yīng)該是www.test.com.conf。

 

2.vim www.test.com.conf  修改這個(gè)配置文件,您應(yīng)該會(huì)看到如下類似的配置內(nèi)容:

<VirtualHost *:80>

DocumentRoot /www/web/www_test_com/public_html

ServerName www.test.com

ServerAlias

DirectoryIndex index.php

ErrorDocument 400 /errpage/400.html

ErrorDocument 403 /errpage/403.html

ErrorDocument 404 /errpage/404.html

CustomLog "/www/web_logs/www.test.com_access_log" common

ErrorLog "/www/web_logs/www.test.com_error_log"

php_admin_value open_basedir /www/web/www_test_com:/tmp

<IfModule mod_deflate.c>

DeflateCompressionLevel 7

AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php

AddOutputFilter DEFLATE css js html htm gif jpg png bmp php

</IfModule>

</VirtualHost>

<Directory /www/web/www_test_com>

    Options FollowSymLinks

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

 

3.點(diǎn)擊字母“i”開(kāi)始編輯文件,輸入內(nèi)容:

<VirtualHost *:80>

DocumentRoot /www/web/www_test_com/public_html

ServerName www.test.com

ServerAlias test.com m.test.com

DirectoryIndex index.php

ErrorDocument 400 /errpage/400.html

ErrorDocument 403 /errpage/403.html

ErrorDocument 404 /errpage/404.html

CustomLog "/www/web_logs/www.test.com_access_log" common

ErrorLog "/www/web_logs/www.test.com_error_log"

php_admin_value open_basedir /www/web/www_test_com:/tmp

<IfModule mod_deflate.c>

DeflateCompressionLevel 7

AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php

AddOutputFilter DEFLATE css js html htm gif jpg png bmp php

</IfModule>

</VirtualHost>

<Directory /www/web/www_test_com>

    Options FollowSymLinks

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

 

其中:

ServerName www.test.com 綁定的網(wǎng)站域名

ServerAlias test.com m.test.com 綁定的網(wǎng)站別名(您如果有多個(gè)域名添加在這里)

DirectoryIndex index.html index.php index.htm 設(shè)置默認(rèn)首頁(yè)

DocumentRoot /www/web/www_test_com/public_html 和 Directory "/www/web/www_test_com/public_html " 都是指定網(wǎng)站的目錄,需要一致。

 

按“esc”退出編輯模式,輸入“:wq”保存退出。

 

4.輸入命令:/alidata/server/httpd/bin/apachectl restart 重啟apache測(cè)試。

 

5.測(cè)試網(wǎng)站。請(qǐng)?jiān)跒g覽器中輸入域名,測(cè)試設(shè)置。


以上內(nèi)容是否對(duì)您有幫助? 您的反饋信息提交成功,謝謝您的反饋!

會(huì)員評(píng)論

在線客服
微信咨詢
微信咨詢
現(xiàn)在咨詢,獲取演示賬號(hào)
企業(yè)logo小米
立即掃碼加我微信
電話咨詢
咨詢電話
028-61558715
預(yù)約演示
主站蜘蛛池模板: 日韩国产成人精品视频人| 精品女同一区二区三区免费站| 在线播放国产一区二区三区| 中文精品字幕电影在线播放视频| 欧美xxxxbbb| 天天干在线播放| 丰满少妇人妻久久久久久| 最近中文字幕无| 亚洲成人www| 色婷婷综合激情| 国产成人综合久久精品免费| 69av免费观看| 处女的诱惑在线观看| 一级做a爰片欧美aaaa| 日本一道综合久久aⅴ免费| 亚洲AV综合AV一区二区三区| 欧美视频在线网站| 国产东北老头老太露脸| 国美女福利视频午夜精品| 国产精品美女www爽爽爽视频| free性中国熟女hd| 年轻的嫂子在线线观免费观看| 久久久久久亚洲精品无码| 日韩特黄特色大片免费视频| 亚洲另类春色国产精品| 欧美精品亚洲精品日韩专区| 免费a级毛片无码专区| 五月天亚洲色图| 国产精品精品自在线拍| 99久久国产综合精品女图图等你 | 色综合热无码热国产| 国产成人A亚洲精V品无码| 欧美xxxxbbb| 国产精品久久久久国产精品| 7878成人国产在线观看| 无码精品A∨在线观看无广告| 久草手机在线播放| 激情偷乱人伦小说视频在线| 免费无码又爽又刺激网站| 精品无码成人片一区二区98| 国产精品免费电影|