Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name Virtual Hosting with one IP address

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm a novice, so please bear with me.
I bought a domain name, installed Apache 1.3.2 under Windows 98 and set up my domain successfully thru register.com (cable modem connection). It worked fine, along with Serv-U FTP server and ArgoMail Server - email and remote file transfer all worked. However, Win98 is not rugged and almost daily required rebooting to continue serving.
I just installed Windows 2000 Professional, re-installed Apache 1.3.2 and set up a 2nd domain name, just as described in apache.org online directions. However, the server does not recognize either domain name. I can access the proper index files and directories by using the IP address/ for one, and the IP address/domain2/ for the 2nd one.
Several things are not made clear in the setup of NameVirtualHost. Hope someone can help.

1) Do I make BindAddress active and set it to my specific IP address? Do I also do it for Listen?
2) Do I set default ServerName to or domain.com? I have the DNS info set to forward domain1.com to so it may not matter.
3) Do I set UseCanonicalName On to Off, and if so, do I do that in each VirtualHost section? Or do I set each instance to DNS, as one person described?

Has anyone else found a problem with Windows 2000 and Apache 1.3.2 not resolving named hosts?
Thanks in advance for all help.
 
If both domains are using the same ip address then yes, you use name based addressing. Both domains must be defined as virtual hosts, each in their own container. I'd put these at the very bottom of httpd.conf for easy editing. Your main server will never be served from now on and the first vhost defined will become the default. To get it to work like this, use the following as a template:

NameVirtualHost *

<VirtualHost *>

ServerAdmin webmaster@domain1.com
ServerName UseCanonicalName Off
DocumentRoot /home/vhost1/html/

<Directory &quot;/home/vhost1/html&quot;>
Options All MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ &quot;/home/vhost1/cgi-bin/&quot;

<Directory &quot;/home/vhost1/cgi-bin&quot;>
AllowOverride None
Options All
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

Cut and paste this to the bottom of your httpd.conf twice and edit as needed for correct server names and directory paths etc. Using &quot;*&quot; instead of an IP:port, you are telling each virtual host to listen to al addresses on all ports but only answer to ServerName.
 
I did exactly what is described above, but the domain names are still not resolved. I checked their registry and the PC's IP address, and they do match. Yet I can't get the server to respond to the domain names - they're not being resolved. Only by using the IP address can I get to the pages, which are served instantly. Any suggestions?
 
Hi,

A couple of things to add :

Don't use BindAddress (its deprecated) - use Listen instead if you want to limit the interfaces on your box that Apache monitors. Otherwise just leave it with port numbers only, e.g. :

Listen 80
Listen 443

You can add a 'ServerAlias' within the virtual host to allow for variations on the name in the http header :

ServerName ServerAlias *.domain1.com

For name based vhosts, use ' UseCanonicalName Off'. See --> .


Regards
 
Thanks, I really appreciate your taking the time to help, but I still can't get the server to resolve the domain names. It does serve the index pages instantly when I use the IP address (for first domain) and IP address/domain2 (for physical location of 2nd domain). Here are the pertinent extracts from my httpd.conf file (yes, I did reboot several times and restart Apache since editing):

#SECTION 1:
ServerType standalone
ServerRoot &quot;D:/Apache Group/Apache&quot;
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_runtime_status
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MaxRequestsPerChild 0
ThreadsPerChild 50
#Listen 3000 (remmed out)
#Listen 12.34.56.78:80 (remmed out)
#BindAddress 66.30.128.190 (remmed out)

SECTION 2:
Port 80
ServerAdmin ralincoln@mediaone.net
ServerName cohannetweb.com
DocumentRoot &quot;D:/Apache Group/Apache/htdocs&quot;
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory &quot;D:/Apache Group/Apache/htdocs&quot;>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
UseCanonicalName Off
HostnameLookups Off
ServerSignature On

SECTION 3:
NameVirtualHost *
<VirtualHost *>

ServerAdmin webmaster@cohannetweb.com
ServerName ServerAlias cohannetweb.com
UseCanonicalName Off
DocumentRoot &quot;D:/Apache Group/Apache/htdocs&quot;

<Directory &quot;D:/Apache Group/Apache/htdocs&quot;>
Options All MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ &quot;D:/Apache Group/Apache/cgi-bin/&quot;

<Directory &quot;D:/Apache Group/Apache/cgi-bin&quot;>
AllowOverride None
Options All
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

<VirtualHost *>

ServerAdmin webmaster@boblincoln.com
ServerName ServerAlias boblincoln.com
UseCanonicalName Off
DocumentRoot &quot;D:/Apache Group/Apache/htdocs/boblincoln&quot;

<Directory &quot;D:/Apache Group/Apache/htdocs/boblincoln&quot;>
Options All MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ &quot;D:/Apache Group/Apache/cgi-bin/&quot;

<Directory &quot;D:/Apache Group/Apache/cgi-bin&quot;>
AllowOverride None
Options All
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

Neither domain name works, but serving by IP address does. Can it be some problem at register.com? Or because I'm using Win2K Pro and not Win2K server? I was able to resolve one domain name when I ran this on Win98 with the same version of Apache. I checked again, and both domain names still point to the correct, active IP address.
I'm hoping to do small web design and hosting for friends, but can't get going until this issue is settled. Thanks.
 
I wouldn't use Forwarding in this case. Have each domain's DNS &quot;A&quot; record point to your ip. Here is what I think is happening. Domain2 is being forwarded to domain1. Domain1 is pointing to your ip. The request is coming to your ip and apache is looking for the domain requested which is now domain1. This would only work where you want for example, yourdomain.com and yourdomain.net to have the same web space. I don't think this is what you want. :eek:)

 
No, that's not what's happening. Both domain2.com and domain1.com DO point to my IP address in their DNS records, and both domain names fail by returning the message,&quot;The page cannot be found&quot;. Makes no difference if I use ServerAlias or not - cohannetweb.com, boblincoln.com all fail to find a page. And the permissions in Apache are set correctly, since I can see the pages (only) by typing the IP address.
The two domains don't have the same web space. The server default is the top directory and the other one is under it. Future domains would also be the level under the default, in their respective directory names.
The problem here is that I can't get either domain name to resolve to the IP at all, even though the DNS registry points to the correct IP.
 
Newposter,

I just did some poking around and found for &quot;boblincoln.com&quot; that register.com says it's on hold. Also and nslookup can't find an &quot;A&quot; record for that domain. Looks like the domain name isn't actually assigned to an IP address yet. Probably the same for the other domain you mention.

Brian
 
I'm somewhat new to this, but I don't understand what you mean by saying the domain name boblincoln is &quot;on hold&quot;. Where on their site do you find that? Do you mean it's taken? It was taken by me. I registered it with register.com on 30 Nov 2001, and it *was* active (within 24 hours) for over a month when I was using Win98 and Apache 1.3.2. The name did resolve to my machine, and in fact I set up FTP and e-mail servers using the domain name. When I found that Win98 wasn't rugged enough to stay running as a server, I reformatted, changed C: drive to NTFS partitioning, and loaded Win2000 and same Apache 1.3.2 version. Now it doesn't work with this combination of software. I also registered the domain name cohannetweb.com and tried to set up name virtual hosting. Neither works, and I can't seem to revert to using either name as the default servername. Both point to my IP address, and I just verified that the server does respond to that. It just doesn't resolve the names.
What is an &quot;A&quot; record?
 
Hi,





Neither domain resolve to an IP address for me either - including querying the authoritative servers. So, looks like there is nothing in the zone file for either domain. An 'A' record is just an address record found in a DNS zone file, i.e. the record that maps the canonical name to a dotted decimal address. Heres an example 'dig' for :





; <<>> DiG 9.1.3 <<>>

;; global options: printcmd


;; Got answer:


;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54355


;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 3, ADDITIONAL: 3





;; QUESTION SECTION:


; IN A





;; ANSWER SECTION:


10256 IN A 216.148.218.197


10256 IN A 216.148.218.195





;; AUTHORITY SECTION:


redhat.com. 3408 IN NS NS2.redhat.com.


redhat.com. 3408 IN NS NS3.redhat.com.


redhat.com. 3408 IN NS NS1.redhat.com.





;; ADDITIONAL SECTION:


NS2.redhat.com. 103266 IN A 216.148.218.250


NS3.redhat.com. 103266 IN A 63.240.14.66


NS1.redhat.com. 103266 IN A 66.187.233.210





;; Query time: 82 msec


;; SERVER: 213.1.119.100#53(213.1.119.100)


;; WHEN: Tue Jan 29 21:13:48 2002


;; MSG SIZE rcvd: 166





compare that to :





; <<>> DiG 9.1.3 <<>>

;; global options: printcmd


;; Got answer:


;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 50775


;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0





;; QUESTION SECTION:


; IN A





;; Query time: 5353 msec


;; SERVER: 213.1.119.100#53(213.1.119.100)


;; WHEN: Tue Jan 29 21:18:15 2002


;; MSG SIZE rcvd: 36





(Note ANSWER : 0 and SERVFAIL)





You need to sort your dns records out with register.com ....





Regards
 
Thanks, I emailed them and received an automated reply receipt, but no solution yet. I was beginning to wonder if they'd screwed something up.
The odd thing is that when I log into the Domain Manager, it shows that and boblincoln.com both point to my active IP address. It shows the same for and cohannetweb.com. The info has been there every time I checked for the last few weeks. Also, the first name was working for over a month, so something changed.
How do you retrieve the detailed info that you displayed, on a Windows machine?
 
Hi,

That was done with 'dig' but I don't think its available on windows. However, you can use nslookup to get some of the same stuff :

c:\>nslookup
> set verb
> > server ns39.register.com << talk to a different dns server
> > exit
c:\>

You'd be better off getting the samspade for windows tool which has a version of 'dig' included -->
That's very good imho - you can also run queries via their web interface -->
Regards
 
Okay, I use register.com and I use my apache for VH under linux. I haven't really looked at your httpd config file. but I had the same problem, my problem was that if I went to one of my websites it would resolve to the main. how to get around this was UseCanonical DNS I think thats what I had to do. Its been a while
 
This problem may be solved soon, and it wasn't my fault. I sent a ticket to register.com, which generated an autoreceipt promising a &quot;prompt&quot; reply. Sent a 2nd one. Called and was on hold 40 minutes til I gave up. Sent a 3rd ticket. Added pleas to my first 2 tickets. Finally after 7 days I called again and got a human after only 10 minutes! He claimed I had corrupted my records by using a wildcard in the alias (*.boblincoln.com points to Well, it was already written in there when I bought the name - they created it. I had rewritten it to &quot;boblincoln.com points to So to fix it, he deleted that alias from both my domain names, claims in 12 to 24 hours it will be active. We'll see. It certainly doesn't give me much confidence in register.com.
The good thing is that I was validated by the experts here, in that I did set up the httpd.conf file correctly. Ifincham was correct - the nslookup showed that my IP address was missing from the records, despite what the Domain Manager indicated.
 
Both domains working now on PC with one IP address. It was the zone file corrupted by register.com. They never responded to me after 7 days - I had to stay on hold to get them by phone. Very disappointing response time from them, but tech help was good once I chased them down.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top