搞定了FreeBSD下apache的虚拟主机配置
(2009-06-15 09:14:13)
标签:
杂谈 |
最近换了台服务器,把原来的老爷机陶淘汰了,这就需要把多个网站都迁移到一个机器上,经过研究,搞定了apache下的虚拟主机的配置方法:
NameVirtualHost ip:80
<VirtualHost ip:80>
ServerName 域名
DocumentRoot
/www/domain
ErrorLog
"/var/log/httpd/域名/error_log"
TransferLog
"/var/log/httpd/域名/access_log"
</VirtualHost>
<VirtualHost ip:80>
ServerName 域名
DocumentRoot /www/otherdomain
</VirtualHost>
<VirtualHost ip:80>
ServerName 域名
DocumentRoot /www/otherdomain
ErrorLog
"/var/log/httpd/域名/error_log"
TransferLog
"/var/log/httpd/域名/access_log"
</VirtualHost>
</VirtualHost>
<Directory "/path/name">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/path/name">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
然后,把你的域名解析设置正确就可以了!