Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Feb 12, 2010 1:28 pm 
Offline
Senior Newbie

Joined: Tue Dec 22, 2009 3:57 am
Posts: 5
Hi,

I have a domain that is working ok, but if I remove the www, it shows the page "It Works!". I can't make it point to the same location as with www.

I have the following configuration in /etc/apache2/sites-available/postalote.com:

Code:
<VirtualHost *:80>
   ServerAdmin mail@postalote.com
   ServerName postalote.com
   ServerAlias www.postalote.com
   DocumentRoot /srv/www/postalote.com/public_html/
   ErrorLog /srv/www/postalote.com/logs/error.log
   CustomLog /srv/www/postalote.com/logs/access.log combined
</VirtualHost>


and in /etc/hosts:

Code:
127.0.0.1 localhost.localdomain localhost
109.74.196.124 postalote.com postalote
109.74.196.124 otherdomain.com otherdomain

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


The strange thing is that I have another domain with the same configuration (but pointing to another location) and it works ok, with and without www.

Thank you!


Last edited by dbeja on Sat Feb 13, 2010 1:09 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Sat Feb 13, 2010 11:28 am 
Offline
Junior Member
User avatar

Joined: Sun Oct 02, 2005 11:54 am
Posts: 43
Website: http://www.garyscott.net
Location: Goleta, CA
I can't see what is wrong off the bat.

Your DNS is correct, they both resolve to your IP.

Code:
#nslookup postalote.com
Name:    postalote.com
Address:  109.74.196.124

#nslookup www.postalote.com
Name:    www.postalote.com
Address:  109.74.196.124


I am not too familiar with what the /etc/hosts file is used for. But I looked in mine and the domain was not in there by itself.

Mine looks like this, with the xx masking my real IP, and example.com taking the place of my real primary domain.

Code:
127.0.0.1 localhost
xx.xx.xxx.xx leroy.example.com leroy



So it has hostname.domain and then hostname, but not just domain. Since your domain name by itself is being the culprit and it is in your hosts file, to me it might be the problem.

So maybe give that a try. Also it is along the lines of "is your computer plugged in" but did you reload or restart Apache after your configuration change. It has happened to me on more then one occasion.

I am really just guessing here, just helping you troubleshoot so please make backups and don't get mad if my suggestions screw things up.


Top
   
 Post subject:
PostPosted: Sat Feb 13, 2010 1:09 pm 
Offline
Senior Newbie

Joined: Tue Dec 22, 2009 3:57 am
Posts: 5
I did your modifications in hosts file (ip hostname.domain hostname), reloaded apache and now it works!

Thanks kali25!


Top
   
 Post subject:
PostPosted: Sat Feb 13, 2010 2:11 pm 
Offline
Junior Member
User avatar

Joined: Sun Oct 02, 2005 11:54 am
Posts: 43
Website: http://www.garyscott.net
Location: Goleta, CA
OMG, I can't believed that worked. But it is the ol' "what does yours look like?", that did the trick. Awesome! Thanks for letting me know!


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


Who is online

Users browsing this forum: No registered users and 3 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