Using internal servers for website hosting
Posted: Fri Mar 20, 2009 8:59 am
I have successfully managed to configure several servers for our in-house farm to deliver web pages for our PHP site. It is actually a pretty simple setup, only the basic LAMP (no MTA, etc).
The trickiest part has been modifying the hosts files, adding a computer to the switch and updating 'interfaces' file.
I followed a few articles and all is well, although I have a concern that I may have done more than nessecary.
The server /etc/hosts file in particular. As it stands I have something along these lines:
Actually quite a few sub-domains but this is the gist of it.
I then have a apache virtual hosts setup like:
Even without the mods to /etc/hosts the domains and sub-domains seemed to resolve but with the /etc/hosts on the Linux modified the sub-domains resolved faster and more consistently.
The trickiest part has been modifying the hosts files, adding a computer to the switch and updating 'interfaces' file.
I followed a few articles and all is well, although I have a concern that I may have done more than nessecary.
The server /etc/hosts file in particular. As it stands I have something along these lines:
Code: Select all
192.168.1.109 debian.COmpany debian http://www.domain.com blog.domain.com register.domain.comI then have a apache virtual hosts setup like:
Code: Select all
#
# Website Home (Document root)
#
<VirtualHost *>
ServerName http://www.domain.com
DocumentRoot /var/www.domain.com/
</VirtualHost>
#
# Registration (sub-domain)
#
<VirtualHost *>
ServerName registration.domain.com
DocumentRoot /var/www.domain.com/registration.domain.com/
</VirtualHost>
#
# Members (sub-domain)
#
<VirtualHost *>
ServerName members.domain.com
DocumentRoot /var/www.domain.com/members.domain.com/
</VirtualHost>