
January 23rd, 2012, 05:25 PM
|
|
|
|
Using Both Name-Based Virtual Host and IP Based
Hey all,
Just a quick question to verify if I am doing this correctly. I have a server that I want to host a few domains, although one of them will need an SSL cert. For that reason, that domain will be given it's own IP but the remainder of the domains can share. My understanding is kind of a mix between IP and Name Based Virtual Hosts.
My structure is kind of as follows - it seems to work alright thus far in development but just wanted to check here in case I'm going about it the wrong way or if this will introduce some issues I'm unaware of.
Code:
// first set up for the shared space
NamedVirtualHost *:80
<VirtualHost *:80>
ServerName blah
blah blah
</VirtualHost>
// everything above here is just as in examples for setting up named virtual host - even includes a default site for when specified by IP only. Now do IP specific stuff
NamedVirtualHost #.#.#.#:80
<VirtualHost #.#.#.#:80>
Specifics for the domain that needs SSL cert
</VirtualHost>
Seem right? I couldn't find any examples that did both as they either go one way or another. It seems to work and seems as if the #.#.#.#:80 overrides the previous *:80 being used. I still wanted to use * and not have to manually specify the public shared IP every time, but just don't want it to apply to the IP specific stuff.
|