2

I have a server with a number of virtual hosts. Over the last couple of years I have continually been improving on most parts of serving these sites, everything from how and where to do logging, how virtual host configuration is made and contains to where I store these virtual hosts on the server.

Lately I have been scripting some tools to add virtual hosts on my system so that there is less manual work and so I started looking for best practices in general for serving sites with Apache2. When googling the subject there is no lack of answers on best practices for specific subjects (vertically), but there is a lack of answers for best practices on more generic situations and subjects (horisontal).

My questions is: Are there any official best practices for serving sites with Apache2? If such a thing does not exist, are there any good texts that can be read on the subject to better understand consequences of the choices done in configuration of the virtual hosts?

3

Apache does provide best practice advice in the documentation.

Apache Virtual Host documentation

Apache > HTTP Server > Documentation > Version 2.4

On this link youll find a list of documentation pages which explain all details of virtual host support in Apache HTTP Server.

https://httpd.apache.org/docs/2.4/vhosts/

-->

VirtualHost Examples

This document attempts to answer the commonly-asked questions about setting up virtual hosts. These scenarios are those involving multiple web sites running on a single server, via name-based or IP-based virtual hosts.

https://httpd.apache.org/docs/2.4/vhosts/examples.html

Not the answer you're looking for? Browse other questions tagged or ask your own question.