close
環境
Ubuntu apache+php+mysql
在/etc/apache2/sites-available新增一個檔案vhost
#vi vhost
<VirtualHost *:80>
ServerAdmin slinbody@blog2.tmu.edu.tw
DocumentRoot /var/www/blog3/
ServerName blog3.tmu.edu.tw
ServerAlias blog5.tmu.edu.tw
RewriteEngine On
RewriteOptions inherit
</VirtualHost>
<VirtualHost *:80>
ServerAdmin slinbody@blog2.tmu.edu.tw
DocumentRoot /var/www/blog4/
ServerName blog4.tmu.edu.tw
#ServerAlias [if you want to support www.example1.com and example1.com]
RewriteEngine On
RewriteOptions inherit
</VirtualHost>
這樣http://blog3.tmu.edu.tw http://blgo5.tmu.edu.tw都是連到同一站 同一內容
http://blog4.tmu.edu.tw連到同一台,不同內容
PS.ubuntu下,sites-available下所新建的virtual host檔案,要ln -s到sites-enable,這樣設定才算完成
全站熱搜