主机2网站1 IP

时间:2016-02-13 13:50:52

标签: dns centos ip virtualhost host

我有一台没有控制面板的1 ip服务器

我安装了php / mysql / postfix ...

我跟着这个tutoriel来设置虚拟主机因为我有2个域

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-6

现在我想在注册商中配置我的2个域名,以访问我在服务器中的2个不同的网站

1 个答案:

答案 0 :(得分:0)

尝试类似的东西:

<VirtualHost *:80>
     DocumentRoot /var/www/example.com/public_html
     ServerName www.example.com
     ServerAlias example.com
     ErrorLog /etc/var/www/example.com/error.log
     CustomLog /var/www/example.com/requests.log
</VirtualHost>
<VirtualHost *:80>
     DocumentRoot /var/www/different.org/public_html
     ServerName www.different.org
     ServerAlias different.org
     ErrorLog /var/www/different.org/error.log
     CustomLog /var/www/different.org/requests.log
</VirtualHost>