The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Virtual Hosts & Server Alias
Author: Kevin G 
Date:   13-07-00 10:27

Hi Hi,

UNIX rookie here with a FreeBSD/Apache(Frontpage) box

Apache is set up with ip based virtual hosts, 12 ips at this time.

After much reading here in the FreeBSDdiary, and the Apache man, I understand ServerAlias will not work with the ip based virtual hosts, so I activated NameVirtualHost two different ways (after adding ServerAlias in the target VirtualHost Container) :

1. Igoring the instructions in httpd.conf to include a port number at the end of the NameVirtualHost ip string

2. Following instructions in httpd.conf to include a port number (80) at the end of the NameVirtualHost ip string

No other changes were made to httpd.conf

After each attempt I restarted Apache using /usr/local/sbin/apachectl graceful

Each attempt was unsuccesful. Suggestions are appreciated. I am a bit reluctant to go wholesale Name-based virtual hosts, as the box is a good workhorse (it ain't broke... etc). But I DO need to get ServerAlias working.

Thanks,
Kevin


Reply To This Message
 
 RE: Virtual Hosts & Server Alias
Author: Philip Hallstrom 
Date:   14-07-00 03:28

Why do you need to use ServerAlias? The Apache man specificly says that ServerAlias can only be used for name based virtual hosting... what's your end goal?

Reply To This Message
 
 RE: Virtual Hosts & Server Alias
Author: Kevin G 
Date:   14-07-00 07:32

The end goal is for the sites to come up when the surfer types foo.com instead of www.foo.com, etc.

I must admit, beyond NameVirtualServer being uncommented and proper ip entered in that string, the differences between name-based vs ip-based don't jump out at me.

One thought I had though after I tried it, I uncommented NameVirtualServer and filled in the proper ip for the target/experiment VirtualHost container, and the two were spearated by several lines (a commented out VirtualHost container example).

With 12 VirtualHost containers must NameVirtualServer be entered just above above each one in httpd.conf? (We are talking a separate ip for each)

Or am I just making this more difficult than need be?

Thanks,
Kevin


Reply To This Message
 
 RE: Virtual Hosts & Server Alias
Author: Philip Hallstrom 
Date:   14-07-00 17:38

Hmmm... what you're trying to do (foo.com and www.foo.com to same server) is really a function of your DNS (regardless of what IP/Name based hosting).

You need to make sure that the IP address of foo.com and the IP address of www.foo.com both point to the same IP address. Then using IP based hosting it should all work just fine...

for example, both adhesivemedia.com and www.adhesivemedia.com will get you to our website... DNS says:

philip@illiad:~% nslookup adhesivemedia.com
Server: illiad.i.adhesivemedia.com
Address: 10.1.0.8

Name: adhesivemedia.com
Address: 207.202.159.74

philip@illiad:~% nslookup www.adhesivemedia.com
Server: illiad.i.adhesivemedia.com
Address: 10.1.0.8

Name: illiad.adhesivemedia.com
Address: 207.202.159.74
Aliases: www.adhesivemedia.com

You then might need to redirect the mail (MX records) somewhere else if you don't want mail coming to the webserver as well, but again that's all DNS...

-philip



Reply To This Message
 
 RE: Virtual Hosts & Server Alias
Author: Kevin G 
Date:   16-07-00 07:14

Well, thanks for that bit of info! (DNS issue). I have asked a couple of supposed gurus and they told me it has nothing to do with pulling off this trick.

Thanks much!
Kevin

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org