hostess
hostess copied to clipboard
Enhancement: create default VirtualHost
In order to keep the host that is originally defined in the main httpd.conf alive, you have to define a VirtualHost with the same values for it first. (see http://httpd.apache.org/docs/2.0/vhosts/name-based.html - Main Host Goes Away box )
I'm feeling too lazy to write something that parses the original httpd.conf right now and creates it automatically, sorry. But perhaps worth mentioning in the README
Just so that I understand, does this deal with the situation where you've got Apache configured but without any virtual hosts enabled?
Yes, that's it. Thanks!
Ah, OK. Given that this doesn't affect my use of the gem, and no-one else complains, I'm going to leave this for now. You should absolutely feel free to add support if you'd like it :-) I'll leave this issue open in case anyone else comes across it/requests it.
Just to chime in here, this is also useful when you do have virtual hosts configured, but still want to access http://localhost/ directly.
changing the hostess httpd.conf block to the following would do the trick:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName _default_
</VirtualHost>
Include /etc/apache2/hostess_vhosts/*.conf
Without the default server name, requests to http://localhost/ would be forwarded to the first configured virtual host. This is probably not the behavior people want or expect.
(FYI, setting a default virtual host is what the Phusion Passenger prefpane does. I'd consider it a best practice)