Solved

Implementing IP/Name-based Virtual Servers etc.

Posted on 2000-04-17
2
163 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 100 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

Save on storage to protect fatherhood memories

You're the dad who has everything. This Father's Day, make sure your family memories are protected. My Passport Ultra has automatic backup and password protection to keep your cherished photos and videos safe. With up to 3TB, you have plenty of room to hold the adventures ahead.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reaching outside NTP servers from within a domain? 12 96
Multicast - Linux 4 25
What are recommended OS for exim mail server? 10 101
OpenVPN Speed limitation to only 10 mbps 7 95
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…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

14 Experts available now in Live!

Get 1:1 Help Now