技術員聯(lián)盟提供win764位系統(tǒng)下載,win10,win7,xp,裝機純凈版,64位旗艦版,綠色軟件,免費軟件下載基地!

當前位置:主頁 > 教程 > 服務器類 >

如何添加網(wǎng)站for linux(綁定域名)

來源:技術員聯(lián)盟┆發(fā)布時間:2019-03-09 00:41┆點擊:

以下配置的路徑以阿里云提供的標準環(huán)境路徑為準,如果您另行安裝,請根據(jù)實際安裝路徑配置。

 

1.cd /alidata/server/httpd/conf/vhosts/ 進入綁定域名所在目錄,

 

2.vim test.conf  建立一個配置文件,test可以自己命名;

 

3.點擊字母“i”開始編輯文件,輸入內(nè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 綁定的網(wǎng)站域名

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

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

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