| Linode Forum https://forum.linode.com/ |
|
| Confusion about sendmail and /etc/hosts https://forum.linode.com/viewtopic.php?f=11&t=5028 |
Page 1 of 1 |
| Author: | kane [ Fri Jan 08, 2010 11:22 pm ] |
| Post subject: | Confusion about sendmail and /etc/hosts |
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 |
|
| Author: | Xan [ Sat Jan 09, 2010 4:21 am ] |
| Post subject: | |
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. |
|
| Author: | kane [ Sat Jan 09, 2010 4:46 am ] |
| Post subject: | |
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 |
|
| Author: | vincemd [ Tue Jan 26, 2010 9:10 am ] |
| Post subject: | |
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 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> Any ideas ? |
|
| Author: | kangaby [ Thu Jan 28, 2010 3:49 am ] |
| Post subject: | |
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. |
|
| Author: | kangaby [ Thu Jan 28, 2010 4:00 am ] |
| Post subject: | |
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. |
|
| Author: | vincemd [ Thu Jan 28, 2010 6:17 am ] |
| Post subject: | |
thank you, problem solved |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|