Mobile app version of vmapp.org
Login or Join
Kaufman445

: Specify or omit IP addresses for Apache virtual hosts? I have a few virtual machines with apache 2.4 installed, and the base setup made by the hosting provider. They specify the IP address

@Kaufman445

Posted in: #Apache #Apache2

I have a few virtual machines with apache 2.4 installed, and the base setup made by the hosting provider. They specify the IP address in every virtual host configuration:

<VirtualHost 123.234.56.89:80>
ServerName ...
</VirtualHost>


For the web application I develop, I have virtual host configurations which are managed by an SCM system and symlinked into the Apache configuration. It would be very useful if I could use the same configuration on both my development machine and the production servers, and rather have:

<VirtualHost *:80>
ServerName ...
ServerAlias development.host.local
...
</VirtualHost>


However, it doesn't really work to mix virtual hosts with fixed and wildcard (*) IP specifications.

So, my question is: Is there a performance reason to nail virtual hosts to fixed IP specifications?

Is this needed for SSL setups (which applies to some but not all of my sites)?

I use Debian and CentOS Linux, and Apache 2.2 and 2.4; my servers have 1 to 4 IP4 addresses.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini213

So, my question is: Is there a performance reason to nail virtual
hosts to fixed IP specifications?


The only performance related reasons for using name based vs ip based is if you've got a limited pool. Name based virtual hosting will not occupy precious IP addresses. The server will be parsing/processing the http headers whether or not you use name based hosting. It's also easier to manage named DNS records than it is config files full of IPs. These things considered, in certain situations IP based virtual hosting could be weaker.


Is this needed for SSL setups (which applies to some but not all of my sites)?


I can't think of a reason you'd only set up SSL on a fixed IP. The cert will be for a specific domain - name based virtual hosting would be easiest way to configure/manage it.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme