Using internal servers for website hosting

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Using internal servers for website hosting

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Using internal servers for website hosting

Post 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
Post Reply