Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Oct 26, 2010 12:49 am 
Offline
Senior Newbie

Joined: Tue Oct 26, 2010 12:41 am
Posts: 5
I set up my LAMP server with Exim and now after it is all setup I can only access my site with www and not without it.

Without the "www" I see...

Code:
It works!
This is the default web page for this server.

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


I have uploaded a simple index.html file into my public_html folder and with the "www" I see file loads.

Anyone have any insight on what may be causing this?

Thank you in advance from a rookie Linode user.

Additional info...
It had been working fine for me with Drupal installed and then this issue occured. I could not figure out my issue and reinstalled my linux distrobution to see if that fixed it and I also removed my DNS settings and started fresh there as well. Neither seemed to have worked.


Last edited by Slate on Tue Oct 26, 2010 9:35 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Tue Oct 26, 2010 1:10 am 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
Link?


Top
   
 Post subject:
PostPosted: Tue Oct 26, 2010 1:22 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Oooo I love guessing games.

1st guess - did you check to see if both domain.com and www.domain.com resolve correctly?


Top
   
 Post subject:
PostPosted: Tue Oct 26, 2010 7:03 pm 
Offline
Senior Newbie

Joined: Tue Oct 26, 2010 12:41 am
Posts: 5
I have narrowed it down to my exim install. I reinstalled everything again and once I installed exim it caused the issue of not allowing me to visit my site without the www.

I followed this step by step.

http://library.linode.com/email/exim/se ... 0.04-lucid

Any ideas? My test emails do work.

Also I installed my LAMP server off of the Linode guide.

Thanks.


Top
   
 Post subject:
PostPosted: Tue Oct 26, 2010 9:34 pm 
Offline
Senior Newbie

Joined: Tue Oct 26, 2010 12:41 am
Posts: 5
I am narrowing this down. This is the specific spot where my error is....

Code:
Before proceeding, make sure your /etc/hosts file has valid entries. For reference, your file should resemble the following:

File: /etc/hosts

127.0.0.1     localhost.localdomain     localhost
12.34.56.78   hostname.yourdomain.com   hostname
Be sure to replace "12.34.56.78" with your Linode's IP address. Replace "hostname.yourdomain.com" with your Linode's fully qualified domain name. Next, make sure your hostname is set in /etc/hostname by issuing the following commands (insert your one-word hostname in place of "hostname").

echo "hostname" > /etc/hostname
hostname -F /etc/hostname
Issue the following commands to check your setup:

hostname
hostname -f
The first command should return only the one-word hostname for your system, while the second command should return the system's FQDN.


If I add...

Code:
12.34.56.78   hostname.yourdomain.com   hostname


with my server ip, domain.com domain

It is causing my issue. Any thoughts? If I remove the second line it does not.


Top
   
 Post subject:
PostPosted: Tue Oct 26, 2010 9:56 pm 
Offline
Senior Newbie

Joined: Tue Oct 26, 2010 12:41 am
Posts: 5
Code:
[b]127.0.0.1     localhost.localdomain     localhost [/b]
12.34.56.78   hostname.yourdomain.com   hostname


I just kept the first line and did not include the second and all is well. Everything is working as it should. Any issues I may see from it?


Top
   
 Post subject:
PostPosted: Tue Oct 26, 2010 11:13 pm 
Offline
Junior Member

Joined: Mon Apr 26, 2010 12:20 am
Posts: 22
Website: http://www.halloforigin.com
Alright, just throwing this out there. Would sticking a .htaccess file in the website root (/srv/www/yourdomain.com/) with mod_rewrite enabled in Apache work? If you haven't tried the .htaccess route, make a .htaccess file and put this as the contents (and make sure mod_rewrite is enabed):


Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]


Top
   
 Post subject:
PostPosted: Wed Oct 27, 2010 8:04 pm 
Offline
Senior Newbie

Joined: Tue Oct 26, 2010 12:41 am
Posts: 5
I do have mod_rewrite enabled so I can have clean urls in drupal. Overall it works now so I am content.

Thanks for the help.

I will say one thing... the extra work it took to learn how to set all of this up was well worth it. I have never had a site run this fast. Very pleased.


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