購物車中還沒有商品,趕緊選購吧!

Linux apache 域名綁定方法

發布日期:2017-10-18 閱讀:5898

以下配置的路徑以阿里云提供的標準環境路徑為準,如果您另行安裝,請根據實際安裝路徑去找到您的配置文件進行配置。

       假如我們需要在我們的網站www.test.com上增加綁定一個m.test.com和一個test.com的域名,請進行如下類似的操作:

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

 

2.vim www.test.com.conf  修改這個配置文件,您應該會看到如下類似的配置內容:

<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.點擊字母“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 綁定的網站域名

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

DirectoryIndex index.html index.php index.htm 設置默認首頁

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

 

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

 

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

 

5.測試網站。請在瀏覽器中輸入域名,測試設置。


以上內容是否對您有幫助? 您的反饋信息提交成功,謝謝您的反饋!

會員評論

在線客服
微信咨詢
微信咨詢
現在咨詢,獲取演示賬號
企業logo小米
立即掃碼加我微信
電話咨詢
咨詢電話
028-61558715
預約演示
主站蜘蛛池模板: 国产资源在线看| 日本黄色影院在线观看| 午夜影视在线免费观看| 91精品国产免费久久久久久青草| 在线观看国产小视频| 三级免费黄录像| 日本强不卡在线观看| 亚洲AV日韩精品久久久久久| 欧美激情一区二区三区蜜桃视频 | 小兔子好大从衣服里跳出来| 久久久免费精品re6| 最新国产精品亚洲| 亚洲国产精品美女| 毛片网站免费观看| 人妻少妇无码精品视频区| 精品无码一区二区三区| 国产一级二级在线| 麻豆久久婷婷综合五月国产| 国产精品jvid在线观看| 亚洲小说区图片区另类春色| 男女爱爱视频网站| 半甜欲水兄妹np| 老鸭窝视频在线观看| 国产午夜视频在线观看第四页| 天天影视综合网色综合国产| 国产综合精品在线| 99久久人妻无码精品系列| 女人被男人桶爽| 一级毛片a免费播放王色| 无码av无码天堂资源网| 久久午夜福利电影| 日韩欧美三级视频| 乱人伦人妻中文字幕无码| 欧美三级视频在线| 亚洲国产香蕉碰碰人人| 欧美精品亚洲精品日韩专区va | 久久精品一品道久久精品9| 最近日本中文字幕免费完整| 亚洲国产成人九九综合| 欧美日韩国产精品综合| 亚洲欧美国产国产综合一区|