Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Apr 11, 2010 8:57 pm 
Offline
Junior Member

Joined: Tue Apr 06, 2010 8:08 pm
Posts: 22
Location: U.S.
Hi ---

Feeling a wee bit foolish asking this question but after days of research I keep coming up with a headache and conflicting information, which is hard on a perfectionist! :-)

Situation:

  1. me: server admin noob & only days old here
  2. OS: Hardy Heron/Ubuntu 8.04 LTS
  3. CMS: Drupal 6.16 -- to be installed using multisite configuration, which enables Drupal to run multiple sites from one install with each (dev & prod) site using its own mysql database
  4. Goal:To have test sites and live sites on one linode, although this may change later



Problem
I am trying to figure out the correct entries for the /etc/hosts file. On my Win XP box locally and a Win 2003 server I was able to work on remotely for awhile, it was simple. I just added the registered domain names and unregistered names to the windows hosts file, associating them with the IP...and then I set up virtual hosts in the httpd file of apache, each pointing to the drupal index.php file used for install.

When I read the various how to's for /etc/hosts in ubuntu, I read what seems to me conflicting information. In one instance, I read that one just does this entry (x=numbers)

127.0.0.1 localhost
69.164.XXX.XXX registered domain name, sans www but with extension .com or .org


Elsewhere I read that one must use a three column entry and machine name and domain name:

127.0.0.1 localhost.localdomain localhost #localdomain??
69.164.xxx.xxx magdalen.test magdalen #magdalen is machine name; test is name of dev site
69.164.xxx.xxx magdalen.learn.uidaho.edu magdalen


1. So what's the scoop with the three column versus two column entries? When do I use which?

2. Do I use the machine (host name) or not?

3. What's with the localhost.localdomain entry??

4. In my current set up on Win boxes, I have fake.domain.local (example) associated with localhost IP on winxp local PC (dev. server). And, I have real.domain.com associated with public IP on the live server. I solved file path problems that occur when loading dev files to live site by adding a patch with an array in it to Drupal 6x core that causes http://fake.domain.local to call the drupal/sites/water folder and http://real.domain.com to do the same. Is it possible to do this same set-up on my linode?

THANK YOU in advance!!


Top
   
 Post subject:
PostPosted: Sun Apr 11, 2010 10:18 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
There isn't really a two-column vs. three-column format. The format is
Code:
IP-address   canonical-hostname   [aliases...]

Suppose your primary name for your Linode at 12.34.56.78 is foo.example.com, and you also want to refer to it as example.com as well as just foo. You would add the following line to /etc/hosts:
Code:
12.34.56.78   foo.example.com   example.com   foo

You should leave the line for localhost as it was originally provided (actually, you can add stuff onto the end of the line, but you shouldn't change the canonical hostname for 127.0.0.1). My Ubuntu 8.04 server simply has
Code:
127.0.0.1   localhost

See man 5 hosts for more.
Keep in mind that the entries in /etc/hosts will not affect IP address resolution by other hosts - you need to modify your DNS entries for that.


Top
   
 Post subject:
PostPosted: Sun Apr 11, 2010 11:31 pm 
Offline
Junior Member

Joined: Tue Apr 06, 2010 8:08 pm
Posts: 22
Location: U.S.
Hey, thanks Vance. Appreciate the help. Question re what you wrote here:

"You should leave the line for localhost as it was originally provided (actually, you can add stuff onto the end of the line, but you shouldn't change the canonical hostname for 127.0.0.1)."


Those instructions contrast with the ones from the Getting Started section here at linode. It reads:

"You'll also want to make sure proper entries for your Linode's fully qualified domain name (FQDN) and localhost are set up in your /etc/hosts file. You can use the following example file, modifying the entries to suit your setup (12.34.56.78 should be replaced with your Linode's IP address). File: /etc/hosts
127.0.0.1 localhost.localdomain localhost
12.34.56.78 something.yourdomain.com something"

My hosts file simply has the 127.0.0.1 localhost

So the Linode instructions are to set localhost as the alias and localhost.localdomain as canonical domain name???? What the? And is that to be typed verbatim???

I like your way best.


Top
   
 Post subject:
PostPosted: Tue Apr 13, 2010 3:22 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
You'll have to ask Phil why the Linode library recommends localhost.localdomain. As noted earlier, Ubuntu 8.04 does not use this by default. Note that Red Hat/CentOS does:
Code:
127.0.0.1   localhost.localdomain   localhost


If you're really determined, try reading this whole thread:
http://lists.debian.org/debian-devel/20 ... html#01063
http://lists.debian.org/debian-devel/20 ... html#00194

Can't say I have the patience or mental capacity to understand all the issues involved, so my approach remains the same as my earlier suggestion: keep the default canonical name provided by the distro. If you need to, you can add aliases to the end of the line.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group