QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3371|回复: 15

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

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

使用道具 举报

发表于 2006-12-26 20:14:28 | 显示全部楼层
    
不知道3n要干什么
回复

使用道具 举报

 楼主| 发表于 2006-12-26 20:24:16 | 显示全部楼层
如果在hosts里设置2个域名的话,要怎么做?
回复

使用道具 举报

发表于 2006-12-27 14:00:39 | 显示全部楼层
[quote:79a8c299ad="cnhnln"]如果在hosts里设置2个域名的话,要怎么做?[/quote]
只能自己访问?
有什么意义吗?
回复

使用道具 举报

 楼主| 发表于 2006-12-27 22:16:36 | 显示全部楼层
你倒是先告诉我啊
回复

使用道具 举报

发表于 2006-12-27 22:42:10 | 显示全部楼层
打开/etc/hosts
加个
*.*.*.*         www.ceshi.com
*.*.*.*         www.ceshi.net
回复

使用道具 举报

 楼主| 发表于 2006-12-27 22:47:58 | 显示全部楼层
应该写在一行里吧
回复

使用道具 举报

发表于 2006-12-27 22:54:54 | 显示全部楼层
感觉还是两行好
回复

使用道具 举报

 楼主| 发表于 2006-12-28 19:51:45 | 显示全部楼层
就一个IP写2行干啥?
回复

使用道具 举报

 楼主| 发表于 2006-12-28 20:11:06 | 显示全部楼层
主机没设域名。就在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 20:49:15 | 显示全部楼层
感情一个人调戏apache呀

虚拟主机名称设置为
NameVirtualHost *:80

配置虚拟机用<VirtualHost *:80>开头
回复

使用道具 举报

 楼主| 发表于 2006-12-28 23:07:34 | 显示全部楼层
<VirtualHost *>
ServerAdmin [email protected]
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 [email protected]
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 11:55:21 | 显示全部楼层
最好加上80
回复

使用道具 举报

发表于 2007-1-12 12:32:36 | 显示全部楼层
[code:1]<VirtualHost *>
ServerAdmin [email protected]
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> [/code:1]


这个就对 没有问题的








----------------------------------------
沈阳网站制作
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-4-19 12:11 , Processed in 0.090854 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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