LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1188|回复: 14

一台机器2个域名该怎么设置?

[复制链接]
发表于 2006-12-26 17:11:05 | 显示全部楼层 |阅读模式
一台机器2个域名该怎么设置?
每个域名下都还有二级的子域名
不是apache的虚拟主机
 楼主| 发表于 2006-12-26 18:38:24 | 显示全部楼层
如果不管二级域名,该怎么实现一台机器2个域名?除了bind还有方法吗?
回复 支持 反对

使用道具 举报

发表于 2006-12-26 19:06:53 | 显示全部楼层
/etc/hosts
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-12-26 19:47:16 | 显示全部楼层
给个例子吧
谢谢
回复 支持 反对

使用道具 举报

发表于 2006-12-26 20:05:38 | 显示全部楼层
理解错误...
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-12-28 14:17:13 | 显示全部楼层
Post by kissingwolf
/etc/hosts

给个例子吧
谢谢
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-12-28 20:03:41 | 显示全部楼层
主机没设域名。就在apache里做的2个虚拟主机
结果
debian:~# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)...apache2: Could not reliably determine the server's fully qualified domain name, using 194.168.0.9 for ServerName
[Wed Dec 27 23:07:42 2006] [warn] NameVirtualHost *:0 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 194.168.0.9 for ServerName
[Wed Dec 27 23:07:52 2006] [warn] NameVirtualHost *:0 has no VirtualHosts

怎么去掉这玩意?
回复 支持 反对

使用道具 举报

发表于 2006-12-28 21:53:51 | 显示全部楼层
把你的配置文件贴上来.
每个虚拟主机都设置
       ServerName  www.sss.com
       ServerAlias sss.com *.sss.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-12-28 22:47:09 | 显示全部楼层
<VirtualHost *>
ServerAdmin master@111.org
ServerName www.111.org
ServerAlias 111.org

# Indexes + Directory Root
DirectoryIndex index.html index.htm index.php
DocumentRoot /srv/111.org/www/

# CGI Directory
ScriptAlias /cgi-bin/ /srv/111.org/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>

# Logfiles
ErrorLog /srv/111.org/logs/error.log
CustomLog /srv/111.org/logs/access.log combined
</VirtualHost>



<VirtualHost *>
ServerAdmin master@222.org
ServerName www.222.org
ServerAlias 222.org

# Indexes + Directory Root
DirectoryIndex index.html index.htm index.php
DocumentRoot /srv/222.org/www/

# CGI Directory
ScriptAlias /cgi-bin/ /srv/222.org/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>

# Logfiles
ErrorLog /srv/222.org/logs/error.log
CustomLog /srv/222.org/logs/access.log combined
</VirtualHost>


多谢。。。。。。。。。。。。。。。。。。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-12-29 22:54:11 | 显示全部楼层
不知道那里错了。楼上能给点意见不?
谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表