Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Oct 13, 2011 12:42 pm 
Offline
Senior Member

Joined: Tue Mar 09, 2004 3:52 am
Posts: 106
Hi there.

I have a domain on a linode example.com, that is one of many domains I host via Apache 2.2.16 using virtual hosts.

For this particular domain, I was having issues with emails that were being sent out by the site bouncing due to the sending domain not being resolved (mx.example.com).

So, I went in and set the reverse DNS for the linode to be example.com in an attempt to resolve this. However, since that change took affect, any time I access example.com, I get a forbidden error with Apache complaining 'client denied by server configuration'. If I access https://example.com, I have no issues as the site comes up fine (due to the different port #, which leads me to believe this is a networking issue rather than an Apache issue, as the sites Apache config file has not changed in months). Removing example.com from the Linode reverse-dns seems to resolve the issue, but then I am left with the mail issue...

Any suggestions on how to tackle this?


Top
   
 Post subject:
PostPosted: Thu Oct 13, 2011 1:10 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Does anything show up in Apache's log file? Are you sure you're hitting the right server? (curl -I http://example.com/ and curl -I https://example.com/ should look roughly the same.)

Also, what does the output of "apache2ctl -S" look like?

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Oct 13, 2011 1:20 pm 
Offline
Senior Member

Joined: Tue Mar 09, 2004 3:52 am
Posts: 106
The apache error log is showing the 'client denied by server configuration' errors.

Yes, definitely hitting the right server, nothing has changed about IP addresses, etc and in some cases these sites were working for years without any IP/DNS/Apache changes - the only thing I've changed is changing the reverse DNS.

apache2ctl -S returns:

Code:
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443                  is a NameVirtualHost
         default server example.com (/etc/apache2/sites-enabled/example.com:52)
         port 443 namevhost example.com (/etc/apache2/sites-enabled/example.com:52)
*:80                   is a NameVirtualHost
         default server example.com (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost example.com (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost example.com (/etc/apache2/sites-enabled/example.com:1)
Syntax OK


Top
   
 Post subject:
PostPosted: Fri Oct 14, 2011 1:03 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
It looks like the default server on *:80 is in 000-default, and it is using example.com as its ServerName. So, it's the first thing matching (since sites-enabled/000-default comes before sites-enabled/example.com).

The best all-around solution would be to set your hostname to something other than example.com. Something like "bob.example.com". This will require you to explicitly configure everything involving "example.com", especially with e-mail. That's a good thing: letting the system assume things is often a bad idea.

You can also disable the 000-default configuration, although it's often nice to have an unrelated "catch-all" to ensure you've configured your "real" sites correctly. If you add more VirtualHosts in the future, it helps with troubleshooting and keeps things predictable.

So I think solving the mail problem is probably what you're going to want to do. If you have working forward and reverse DNS on whatever.example.com, it should work OK; you can also tell your application to send mail out as something@example.com instead of something@whatever.example.com, which will also ensure that bounces and replies go to somewhere useful.

_________________
Code:
/* TODO: need to add signature to posts */


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


Who is online

Users browsing this forum: No registered users and 1 guest


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