Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: create default VirtualHost #2

Open
ivanoats opened this issue Nov 12, 2010 · 4 comments
Open

Enhancement: create default VirtualHost #2

ivanoats opened this issue Nov 12, 2010 · 4 comments

Comments

@ivanoats
Copy link
Contributor

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

@chrisroos
Copy link
Collaborator

Just so that I understand, does this deal with the situation where you've got Apache configured but without any virtual hosts enabled?

@ivanoats
Copy link
Contributor Author

Yes, that's it. Thanks!

@chrisroos
Copy link
Collaborator

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.

@nathos
Copy link

nathos commented Jul 6, 2011

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants