LinuxSir.cn,穿越时空的Linuxsir!

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

我现在访问虚拟机是输入内部地址,我现在想改成如www.fnaps.com访问怎么改httpd.conf?

[复制链接]
发表于 2005-4-18 21:10:21 | 显示全部楼层 |阅读模式
如题,怎么修改才能达到那样的效果?
发表于 2005-4-18 21:39:44 | 显示全部楼层
NameVirtualHost yourIP
<VirtualHost www.fnaps.com>

</VirtualHost>
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-19 23:36:08 | 显示全部楼层
这好像不行呀。我设了,但就是还不行,是不是要设DNS。。
回复 支持 反对

使用道具 举报

发表于 2005-4-19 23:59:36 | 显示全部楼层
你没dns解析,你机器怎么找到ip啊
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-20 08:16:58 | 显示全部楼层
因为我很菜.所以才问的.不过谢谢了..现在能告诉我工作原理吗?
回复 支持 反对

使用道具 举报

发表于 2005-4-20 11:15:07 | 显示全部楼层
你得修改DNS指向。

或是直接在hosts中修改


C:\Documents and Settings\dzj>ping xx.com

Pinging xx.com [192.168.0.2] with 32 bytes of data:

Reply from 192.168.0.2: bytes=32 time<1ms TTL=64
Reply from 192.168.0.2: bytes=32 time<1ms TTL=64
Reply from 192.168.0.2: bytes=32 time<1ms TTL=64
Reply from 192.168.0.2: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.0.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
回复 支持 反对

使用道具 举报

发表于 2005-4-20 14:00:06 | 显示全部楼层
不设置dns ,同样可以解析。进行如下操作:
修改etc/host.conf,变成以下内容:
order bind,hosts
在networkr configuration 的dns栏设置hostname为:www.fnaps.com
你在浏览器里输入www.fnaps.com和输入ip是一样的效果。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-29 07:41:43 | 显示全部楼层
很久前的贴子了。感谢大家的回复
回复 支持 反对

使用道具 举报

发表于 2006-8-10 15:17:02 | 显示全部楼层
我想多问一句:在linux下有没有类似windows下hosts的设置文件?
回复 支持 反对

使用道具 举报

发表于 2006-8-10 15:24:43 | 显示全部楼层
Post by wangflove
我想多问一句:在linux下有没有类似windows下hosts的设置文件?


当然有.

/etc/hosts
回复 支持 反对

使用道具 举报

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

本版积分规则

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