Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Implementing IP/Name-based Virtual Servers etc.

Posted on 2000-04-17
2
Medium Priority
?
171 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
ID: 2739397
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 200 total points
ID: 2739956
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

783 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