The FreeBSD Diary

The FreeBSD Diary (TM) Remember
I remember
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 VirtualHost assignments
Author: James A. Peltier 
Date:   10-09-02 00:15

Why wouldn't you just use something like

NameVirtualHost *

<VirtualHost *>
ServerName www.site-fx.net
</VirtualHost>

for all your vhosts on the system instead. Unless of course they needed SSL which would require an IP Address be set. Or am I missing something?

Reply To This Message
 
 Re: VirtualHost assignments
Author: Dan Langille 
Date:   10-09-02 15:46

James A. Peltier wrote:
>
> Why wouldn't you just use something like
>
> NameVirtualHost *

Ignorance.

A good point. Thanks. For those going this route, if * is used instead of an IP address, you must modify all VirtualHost declarations.

Reply To This Message
 
 Re: VirtualHost assignments
Author: Dan Langille 
Date:   10-09-02 16:34

I've also updated the article (http://www.freebsddiary.org/ip-address-change.php) to reflect this. I'll also update the Virtual Hosts article (http://www.freebsddiary.org/virtualhosts.php).

Reply To This Message
 
 Re: VirtualHost assignments
Author: Amit Chakradeo 
Date:   12-09-02 23:33

Another neat apache trick is to use module vhost_alias_module
and then you can add new hosts on the fly (without changing config file or restarting apache)

Another directives needed if you go this way are:
VirtualDocumentRoot /home/vhosts/%0/
ScriptAlias /cgi-bin/ /home/cgi-bin/


Then as long as your DNS names point to the right (changed) IP address, you are good to go.

site1.com files go under /home/vhosts/site1.com
site2.com files go under /home/vhosts/site2.com

New sites get picked automatically.

HTH
Amit

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