Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Jan 08, 2010 11:22 pm 
Offline
Newbie

Joined: Mon Oct 12, 2009 11:04 pm
Posts: 4
I'm definitely a Linux newb so forgive me if this is a silly question ;)

My Linode is running Ubuntu 9.04.

A few months ago I installed sendmail and in order for it to work I modified my /etc/hosts to be like this:

127.0.0.1 localhost.localdomain localhost [hostname]
127.0.0.1 [hostname].localdomain
[IP] [external hostname].members.linode.com


I don't understand why I did that, I just read it somewhere and it seemed to work.

Then about a month ago I realized many of the emails coming from my primary domain were being marked as spam because the headers had:

Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])

So I edited the /etc/hosts again and modified the first line to be:

127.0.0.1 [domain] localhost.localdomain localhost [hostname]
(I added the domain name that the emails were coming from to the first line)

This seemed to help. The email headers looked better and I was getting a lot less bounces.

However, today I rebooted my server and that latest /etc/hosts change took down my domain so a browser just showed "It Works!" (I guess I hadn't restarted Apache since then).

So it seems I have two choices:
(1) Be able to send emails that actually arrive at their destination
(2) Have a website that's actually live

I'm hoping there's a 3rd option that lets me have both :)


Top
   
 Post subject:
PostPosted: Sat Jan 09, 2010 4:21 am 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
It's certainly possible that there's something about Apache that I don't know, but I can't think of any way that change would lead to what you're describing. Is it possible there was some other change to the Apache config since the last reboot? You could find out for sure, of course, by switch /etc/hosts back, rebooting, and seeing what your Web page looks like.


Top
   
 Post subject:
PostPosted: Sat Jan 09, 2010 4:46 am 
Offline
Newbie

Joined: Mon Oct 12, 2009 11:04 pm
Posts: 4
Oh sorry, I didn't explain myself properly.

It definitely was that change because I've already removed my domain from the first line in /etc/hosts, restarted Apache and my site is up again.

I'm also totally confused why that would cause the "It Works!" problem :(


Top
   
 Post subject:
PostPosted: Tue Jan 26, 2010 9:10 am 
Offline
Newbie

Joined: Tue Jan 26, 2010 8:57 am
Posts: 2
I'm having a similar problem.

Email sent by do-not-answer@mydomain.com are being rewrited in something like do-not-answer@yyxxx-x.members.linode.com

My hosts.conf is as follow:

Code:
127.0.0.1 localhost

xxx.xx.xxx.x    yyxxx-x.members.linode.com      mydomain.com


If I delete yyxxx-x.members.linode.com in my hosts.conf, then when trying to reach mydomain.com with a broswer, I obtain "It works". With www.mydomain.com, it still work.

The Apache virtual host in charge of this domain looks like that:
Code:
  <VirtualHost *:80>
     ServerName mydomain.com
     ServerAlias www.mydomain.com


Any ideas ?


Top
   
 Post subject:
PostPosted: Thu Jan 28, 2010 3:49 am 
Offline
Senior Member

Joined: Wed Oct 20, 2004 8:55 am
Posts: 120
Edit /etc/hosts

127.0.0.1 localhost.localdomain localhost
10.10.10.10 server.example.com server

Where:
10.10.10.10 is replaced by the real IP address assigned to your Linode.
server is replaced by the name of your host in /etc/hostname (can be anything you want)
example.com is replaced by your real domain name.

This is what I have in my /etc/hosts. Start with that and move forward.


Top
   
 Post subject:
PostPosted: Thu Jan 28, 2010 4:00 am 
Offline
Senior Member

Joined: Wed Oct 20, 2004 8:55 am
Posts: 120
vincemd wrote:
I'm having a similar problem.
Any ideas ?


Edit /etc/apache2/sites-available/default

# Default virtual host - replaces main server
<VirtualHost 10.10.10.10:80>

Setup other virtual hosts pointing to the users home directory
Edit /etc/apache2/sites-available/example.net

<VirtualHost 10.10.10.10:80>
ServerName example.net
ServerAlias www.example.net
DocumentRoot "/home/girlie/public_html"
ScriptAlias /cgi-bin/ /home/girlie/cgi-bin/
</VirtualHost>

Replace domains and users to match yours.
Then run a2ensite with the domain file name.


Top
   
 Post subject:
PostPosted: Thu Jan 28, 2010 6:17 am 
Offline
Newbie

Joined: Tue Jan 26, 2010 8:57 am
Posts: 2
thank you, problem solved :)


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


Who is online

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