- A+
所属分类:Basic
在apache服务器中如何建立多个网站,并且绑定不同的目录呢?
其实是非常简单的事情在服务器中找到httpd.conf,这个是apache的配置文件。
假设我的域名www.selmy.org我绑定的目录是/var/www/docs/selmys/
查找:httpd.conf
[root@Byrd www]# find / -name httpd.conf
然后编辑httpd.conf,增加如下内容:
0 1 2 3 4 5 6 |
<VirtualHost *:80> ServerAdmin webmaster@t4x.org DocumentRoot /var/www/docs/selmy.org ServerName www.selmy.org ErrorLog logs/www.selmy.org_log CustomLog logs/selmy.org-access_log common </VirtualHost> |
我的另外一个网站假设是www.baidu.com
那么
0 1 2 3 4 5 6 |
<VirtualHost *:80> ServerAdmin webmaster@baidu.com DocumentRoot /var/www/docs/badiu.com ServerName www.baidu.com ErrorLog logs/www.baidu.com_log CustomLog logs/badiu.com-access_log common </VirtualHost> |
申明:转载于网络,版权归原作者所有!