以下配置的路徑以阿里云提供的標準環(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)站的目錄,需要一致。