How do I properly set up and secure a production LAMP Server?

Solution 1:

You need to tell Apache that it should use name-based virtual hosting instead of IP based. So append the following to your /etc/apache2/apache2.conf to define:

NameVirtualHost ip.address:port

And each virtual host should define a port:

<VirtualHost example.com:80>