When Apache doesn’t have a proper name to use to decide what web site to serve, it uses the first VHost as default. I’d like a feature to change that. Yes, I can go in and do this myself (and I will) but I think it would be nice to have an option in NodeWorx to set a “default” account.
I agree, this would be great. Unfortunately I don’t know how to go about doing this - do you know how to change the default vhost for an IP?
Well, whatever Apache processes first should be the defaut, so I symlinked a domain.conf to 0.conf. Didn’t restart Apache yet to see if it works though
The other solution is to just stick it in httpd.conf, and that would make sure its first, but then I would have to copy the info twice and I don’t like doing that
I don’t think those solutions will work, but let me know if they do. The reason I say that is I believe that Apache chooses the vhost with the servername that comes first alphabetically, regardless of the order the vhost is in the httpd.conf.
Actually it is sequential (at least in the monolithic httpd.conf setup). I would assume this translates to the Include *.conf method as well but CMI let us know if it works.
I stand corrected, the question is just then what’s the easiest way to guarantee one vhost comes before all the others.
I suppose this also extends to all the shared IPs on a server as well, each shared IP will need a “default” vhost set up.
Well, the only 2 ways to ensure this are to put it at the end of httpd.conf like Chris says, or make it a seperate include before the others. It seems when you include * in a directory its alphabetical, but that could change…
Going to try it
The 0.conf symlink doesn’t seem to work. 1.conf doesn’t either. So what I’m going to do for now is change
Include conf.d/default.conf Include conf.d/*.conf
and copy instead of symlink a config file to default.conf.