以下配置的路徑以阿里雲提供的標準環境路徑為準,如果您另行安裝,請根據實際安裝路徑配置。
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.測試網站。請在瀏覽器中輸入欄位名,測試設定。