LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-04-2013, 07:33 AM   #1
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Rep: Reputation: 6
domains work with www but not without


Hi all,

On my Ubuntu 12.04 VPS my two domains load correctly when I do http://www.example.com but when I do http://example.com the browser loads the default IP Apache index page ie

It works!

This is the default web page for this server.

The web server software is running but no content has been added


Any ideas please what I am doing wrong?

Thank you...
 
Old 05-04-2013, 08:47 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,762

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
Hi,

You can add a ServerAlias with the hostname you want for each virtual hosts, like this
Code:
ServerAlias example.com
Regards
 
Old 05-05-2013, 12:15 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,489

Rep: Reputation: 2412Reputation: 2412Reputation: 2412Reputation: 2412Reputation: 2412Reputation: 2412Reputation: 2412Reputation: 2412Reputation: 2412Reputation: 2412Reputation: 2412
Could check dig or nslookup for what is going on.

Usually DNS entrys are not correct but could be some hosts file issue or proxy or such.
 
Old 05-05-2013, 05:27 PM   #4
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Thanks for replies...

Quote:
Originally Posted by jefro View Post

Usually DNS entrys are not correct....
Can anyone please tell me do these DNS records look ok?
 
Old 05-06-2013, 02:20 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,762

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
Quote:
Can anyone please tell me do these DNS records look ok?
They look ok. Both domain.com and www. domain.com resolve to the same IP (I guess this is your webserver IP)
So did you try to use the ServerAlias directive as in my previous post?
 
Old 05-06-2013, 06:04 AM   #6
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by bathory View Post
They look ok. Both domain.com and www. domain.com resolve to the same IP (I guess this is your webserver IP)
So did you try to use the ServerAlias directive as in my previous post?
Ok thanks, do you mean this (attached)?
Attached Thumbnails
Click image for larger version

Name:	serveralias.jpg
Views:	13
Size:	25.4 KB
ID:	12469  

Last edited by Juc1; 05-06-2013 at 06:09 AM.
 
Old 05-06-2013, 08:06 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,762

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
Quote:
Originally Posted by Juc1 View Post
Ok thanks, do you mean this (attached)?
Yup.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make my server work with all domains pointed at it? tibberous Linux - Server 8 01-26-2009 12:28 AM
Multiple domains routing to their own /var/www/html/domaindir danieltoner Linux - Server 14 03-17-2008 05:19 PM
Awstats how to work with virtual domains? stormrider_may Linux - Networking 2 08-01-2006 05:19 PM
Can't Get Sub-domains to Work John_Saunders Linux - Networking 1 07-20-2002 01:53 PM
who does Linux work with NT Domains yogotie Linux - Networking 7 03-19-2001 10:32 AM


All times are GMT -5. The time now is 06:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration