如何添加網站for linux(綁定網域名稱)

來源:互聯網
上載者:User

 以下配置的路徑以阿里雲提供的標準環境路徑為準,如果您另行安裝,請根據實際安裝路徑配置。

 1.cd /alidata/server/httpd/conf/vhosts/ 進入綁定網域名稱所在目錄, 2.vim test.conf  建立一個設定檔,test可以自己命名; 3.點擊字母“i”開始編輯檔案,輸入內容:<VirtualHost *:80>        DocumentRoot /alidata/www/phpwind        ServerName localhost        ServerAlias localhost        <Directory "/alidata/www/phpwind">            Options -Indexes FollowSymLinks            AllowOverride all            Order allow,deny            Allow from all        </Directory>        <IfModule mod_rewrite.c>                RewriteEngine On                RewriteRule ^(.*)-htm-(.*)$ $1.php?$2                RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2        </IfModule>        ErrorLog "/alidata/log/httpd/phpwind-error.log"        CustomLog "/alidata/log/httpd/access/phpwind.log" common</VirtualHost> 其中:ServerName www.test.com 綁定的網站網域名稱ServerAlias test.com 綁定的網站別名(您如果有多個網域名稱添加在這裡)DirectoryIndex index.html index.php index.htm 設定預設首頁DocumentRoot /alidata/www/test 和 Directory "/alidata/www/test" 都是指定網站的目錄,需要一致。 按“esc”退出編輯模式,輸入“:wq”儲存退出。 4.輸入命令:/alidata/server/httpd/bin/apachectl restart 重啟apache測試。 5.測試網站。請在瀏覽器中輸入欄位名,測試設定。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.