我有一个与以下设置的Apache。
192.168.0.105:8080/site1 192.168.0.105:8080/site2 and, 192.168.0.103/blog
我的networking中有3台电脑。 2个台式机和一台笔记本电脑。
在每台电脑上,在浏览器上我想input一些东西,
example.com/site --> resolve to 192.168.0.105:8080/site1 example.com/site --> resolve to 192.168.0.105:8080/site2
和,
sample.com/blog --> resolve to 192.168.0.103/blog
我想要2个名字…… example.com和sample.com,我只是希望它为networking上的每台计算机parsing这些地址。 我不希望它caching本地使用的公共域名,也没有外部互联网访问这些网站。 上面的apache运行在ubuntu 9.04虚拟机上,我分配了IPS。
我在那里遵循这个指南。 http://ubuntuforums.org/showthread.php?t=236093
我遇到区域定义和反向区域定义文件的问题。 我真的不明白的选项。 有人可以告诉我哪些选项要改变,以适应我的具体情况….
// replace example.com with your domain name. do not forget the . after the domain name! // Also, replace ns1 with the name of your DNS server example.com. IN SOA ns1.example.com. admin.example.com. ( // Do not modify the following lines! 2006081401 28800 3600 604800 38400 ) // Replace the following line as necessary: // ns1 = DNS Server name // mta = mail server name // example.com = domain name example.com. IN NS ns1.example.com. example.com. IN MX 10 mta.example.com. // Replace the IP address with the right IP addresses. www IN A 192.168.0.2 mta IN A 192.168.0.3 ns1 IN A 192.168.0.1
和反向区域定义文件,
//replace example.com with yoour domain name, ns1 with your DNS server name. // The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 1, as my IP address is 192.168.0.1. @ IN SOA ns1.example.com. admin.example.com. ( 20060; 28800; 604800; 604800; 86400 ) IN NS ns1.example.com. 1 IN PTR example.com
我只是困惑,我宁愿更清楚地了解我在做什么,而不是尝试一堆事情。 任何帮助将是伟大的….另外,请让我知道如果我没有做一些正确的事情。 谢谢你的时间。
在你的情况下,这听起来像是一个局域网开发案例,我会走一趟轻松的路,只需在你的三台本地机器上编辑/etc/hosts文件,以parsing你的局域网开发服务器,而不是经历configurationbind你的局域网。
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost 192.168.0.103 sample.com 192.168.0.105 example.com
您仍将获得example.com/site1和/ site2,因为它们是由Apache处理的。
唯一需要注意的是你必须让用户把端口添加到请求中,因为你不能在/etc/hosts指定目标端口,或者你可以通过iptables和vhosts.conf使用一些简单的选项vhosts.conf 。
我也假设这将是一个可接受的解决scheme,因为你说:“我只是想要它解决这些地址为[三|电脑]在networking上”,而不是我想学习如何正确configuration绑定 。