Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've setup a LAMP server on Ubuntu 10.04 (lucid) and have also installed Virtualmin. This is my first attempt at setting up a server of any sort.

I set up one virtual host using Virtualmin and so far so good. Some odd things are happening though, such as when I type in my primary domain into a browser, I see the contents of the virtual server instead of what should be in the default directory.

I'm going to use 123.345.789 and example.co.uk instead of my actual ip and domain name's if thats ok.

I checked my hostname by using

hostname -f

and got

production1 

as my response

The contents of my /etc/hosts file is (ip's and domain changed to something generic for this post):

127.0.0.1     localhost localhost.localdomain
123.456.789     production1.example.co.uk
123.456.789     production1

shouldn't my FQD be production1.example.co.uk? How can I go about changing this?, a simple step by step instruction would be great! thanks in advance.

share|improve this question
    
via blueben, my hosts file has a mistake, IP's shouldn't be listed on multiple rows. –  Demwunz Jan 12 '11 at 9:23
add comment

2 Answers

up vote 1 down vote accepted

The /etc/hosts file contains some last ditch effort at name resolution, but isn't the full story with what you're trying to do. Do the following and you should be good to go:

  1. Edit /etc/hostname such that it contains only 'production1.example.co.uk'
  2. Run hostname -F /etc/hostname

The hostname file contains your fqdn for system use, and the hostname command re-reads that file for the system. At this point you can restart your services and everything should work fine, worst case a reboot might be necessary.

share|improve this answer
add comment

Your hosts file has a mistake; You shouldn't list an IP on multiple rows.

127.0.0.1     localhost localhost.localdomain
123.456.789     production1.example.co.uk production1
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.