Page 1 of 1

Using internal servers for website hosting

Posted: Fri Mar 20, 2009 8:59 am
by alex.barylski
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:

Code: Select all

192.168.1.109 debian.COmpany debian http://www.domain.com blog.domain.com register.domain.com
Actually quite a few sub-domains but this is the gist of it.

I 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>
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.

Re: Using internal servers for website hosting

Posted: Fri Mar 20, 2009 6:19 pm
by Chris Corbyn
What's the question?

By the way, modifying /etc/hosts only affects the local machine... the public don't get the benefit of those changes. You also can only map hostnames to IP addresses in /etc/hosts... you can't adding a full URL like http://site.tld