首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >两个域,一个服务器

两个域,一个服务器
EN

Server Fault用户
提问于 2012-07-24 16:54:52
回答 1查看 340关注 0票数 0

/etc/apache2/conf.d/virtul.conf

NameVirtualHost *

sites-enabled/website1.org的第一个文件中,您将看到一个组,如:

代码语言:javascript
复制
<VirtualHost *>
    ServerName website1.org
</VirtualHost>

website2.org也是如此。

位于website1.org中的域(和子域)应该如何工作。但是,website2.org不起作用。在浏览器中访问website2.org时,我得到一个500 Internal Server Error

两个注意事项: 1)当运行# /etc/init.d/apache2 restart时,我得到:

代码语言:javascript
复制
 * Restarting web server apache2                                                [Tue Jul 24 09:31:59 2012] [warn] NameVirtualHost 72.10.54.89:80 has no VirtualHosts
 ... waiting [Tue Jul 24 09:32:00 2012] [warn] NameVirtualHost 1.23.456.769:80 has no VirtualHosts

2) website2.org有一个ssl证书,并将ssl设置为sites-enabled/website2.org-ssl

是的,我为每个域运行了a2ensite,然后运行了一个Apachereload,并且在安装之后,我做了一个Apacherestart

我怎样才能让我的第二个网站现场直播?我不知道下一步该查什么..。寻求帮助。

编辑@RedFoxy **

代码语言:javascript
复制
 * Restarting web server apache2                                                   [Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:57 2012] [warn] NameVirtualHost 72.10.54.89:80 has no VirtualHosts
[Tue Jul 24 10:56:57 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
 ... waiting [Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Jul 24 10:56:58 2012] [warn] NameVirtualHost 72.10.54.89:80 has no VirtualHosts
[Tue Jul 24 10:56:58 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
EN

回答 1

Server Fault用户

发布于 2012-07-24 17:19:06

这很简单,只是您必须将端口指定为:

代码语言:javascript
复制
NameVirtualHost *:80

代码语言:javascript
复制
<VirtualHost *:80>
    ServerName website1.org
</VirtualHost>

记住要更改:80使用您需要的web端口。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/410733

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档