Solved

Implementing IP/Name-based Virtual Servers etc.

Posted on 2000-04-17
2
162 Views
Last Modified: 2010-03-18
I am trying to implement mixed IP/Name-based virtual servers on my RedHat 6.0 linux machine but I can't seem to make it work. I tried the examples in the apache documentation but it did not work.  Other than placing VirtualHost declarations in the httpd.conf file, are there other config files that i need to modify for the virtual servers to work?

The linux box i am working on is connected to a LAN whose domain name i do not want to use. I just need to be connected so that i could have access to the internet. Other than that, i don't need to be connected to this LAN and given the choice, I wouldn't. I am having problems because of this connection to the LAN. Whenever I try to access my local web server (localhost.localdomain), i need to type the IP address to access it. If I type the localhost name, it first searches in the DNS located in the LAN server. How could I fix this so that it would need to check the LAN server DNS first if the host i type is the local host?

To summarize, my questions are:
- what are the config files that i need to modify and how should they be modified in order to implement virtual servers?
- how can i make my server check the local machine first before going to the LAN server DNS?

Thanks.
0
Comment
Question by:wsanchez
2 Comments
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
I believe that there's a /etc/nsswitch.con file on your system that contains a "hosts" entry which specifies the order in which hostnames will be resolved. On RH 6.1/6.2 the default entry looks like:

hosts:      files nisplus nis dns

Which says that the system should look in the local hosts file before consulting the DNS. So if you have the entry:

127.0.0.1      localhost.localdomain localhost

in your /etc/hosts file you won't use dns to resolve that name. There also needs to be a separate entry for the official name of the system, perhaps something like:

111.222.333.444      my-offical.name.com my-official

where the IP is that assiged to your system (assuming a static IP) and the FQDN is that as returned by an nslookup of your IP. If you have a dynamically assigned IP, the DHCP process should take care of the hostname for you.

As to creating virtual servers. You can create any named virtual servers that you like in Apache. If you make aliases in your hosts file for those names, like:

111.222.333.444      my-offical.name.com my-official virt1.srv.com virt2.srvit.com

then from your system, and your system only, you'll be able to access URLs that use those FQDNs. If you wish to access virtual servers from other than the local system, records must be added to the DNS server(s) that host those virtual domains to point to your system.
0
 
LVL 1

Accepted Solution

by:
Sokka earned 100 total points
Comment Utility
1. /usr/local/apache/conf/httpd.conf
     is the config file

2. /etc/resolv.conf - first entry local lan IP
                      Second entry remote IP
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now