You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ld...@ulysium.net on 2003/03/22 21:44:13 UTC

[users@httpd] apache 2 & bind 9

Is anyone using apache 2 with bind 9 yet?

I think it's possible that there can be some kind of problem maybe with
apache when it's coupled with bind 9 on a system.

I know I have bind 9 running properly and it's answering queries correctly,
but when certain incorrect queries are made to bind 9 that used to cause
only an empty answer on bind 8, bind 9 doesn't answer after a long time out,
with an empty record anyway.

The problem is that when a query to bind 9 is made, which is a query on an
IP but the query isn't explicitly made as being a reverse lookup, such as
dig -x x.x.x.x but without the -x switch, bind 9 waits while bind 8 doesn't.
This is what apache 2 is doing and is causing extra long delays making such
queries to bind 9.
For example, putting only one single Listen directive in the apache 2 config
putting it on one single IP, such as listen x.x.x.x:80 (x.x.x.x being an
actual IP of course), then apache makes a query to the dns for that IP but
not specifying a reverse lookup, so the query is something like x.x.x.x IN
AAAA without calling for a reverse lookup on that.
This type of query is made by apache whenever it is started, stopped or even
when doing a config check, and this wouldn't be much of a problem and
wouldn't be noticed with bind 8, because there would be no extra delay like
bind 9 is causing.
Once apache is started after all that delay, it seems to function properly,
answering and serving web pages as expected.

Why is apache 2 behaving that way? Is it possible that something was
overlooked in the apache development about the queries it makes at starup?

Shouldn't apache specify that the query on the IPs it makes are meant to be
reverse lookups and not forward??

btw: I did put in a servername directive there, and it makes absolutely no
difference. I've been running apache 1 with bind 8 for 6 years now and I'm
used to it. It just doesn't seem to work right so far with apache 2 and bind
9 because there seems to have been some changes made and something may have
been broken in the process, but what????

-- 
Didier Godefroy
mailto:dg@ulysium.net


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RewriteCond but...

Posted by Jurgen <ap...@squarehosting.com>.
Hi,

how about something like

RewriteCond %{QUERY_STRING} !^secret_code$

Jurgen


On Sun, 23 Mar 2003 12:01:56 +0100
Furesz Peter <th...@freemail.hu> wrote:

> Hi!
> 
> I want to rewrite all incoming URLs, like:
> username1.mydomain.com
> username2.mydomain.com 
> etc
> 
> EXCEPT:
> www.mydomain.com
> and IMPORTANT EXCEPTION:
> username1.mydomain.com?secret_code
> 
> 
> I have the following lines in httpd.conf
> 
>  RewriteCond %{HTTP_HOST} [^w{3}]\.mydomain\.com 
>  RewriteCond %{HTTP_HOST} (.*)\.mydomain\.com$ 
>  RewriteRule .* /foo/bar/site.php?redir=%1
> 
> This lines works, but not filter the SECRET CODE, I have to put one line
> but I don't know what. Can you help me? My first idea was this:
> 
>  RewriteCond %{HTTP_HOST} .*\.mydomain\.com\/.*\?secret_code
> 
> but I think it is not good
> 
> Thank you
> Peter
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RewriteCond but...

Posted by Garth Winter Webb <ga...@perijove.com>.
On Sun, 2003-03-23 at 03:01, Furesz Peter wrote:

> I have the following lines in httpd.conf
> 
>  RewriteCond %{HTTP_HOST} [^w{3}]\.mydomain\.com 
>  RewriteCond %{HTTP_HOST} (.*)\.mydomain\.com$ 
>  RewriteRule .* /foo/bar/site.php?redir=%1

Your first condition does not do what you think.  It stops
www.mydomain.com from being rewritten, but it would also stop
warsaw.mydomain.com and skippy3.mydomain.com among other possible
usernames.  This is because the '[' syntax defines a character class
which is meant to match a certain subset of single characters, not a
string of characters.  Your negated character class matches any
character that is not one of 'w', '{', '3' or '}'.

If you have a literal string you know you don't want, why not use that
literal string in the match?

    RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$

It will make life easier for you and the regex engine ;)

> This lines works, but not filter the SECRET CODE, I have to put one line
> but I don't know what. Can you help me? My first idea was this:
> 
>  RewriteCond %{HTTP_HOST} .*\.mydomain\.com\/.*\?secret_code

This wont work because HTTP_HOST doesn't contain path information. 
Jurgen's post on this has what you want.

-- 
Garth Winter Webb <ga...@perijove.com>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] RewriteCond but...

Posted by Furesz Peter <th...@freemail.hu>.
Hi!

I want to rewrite all incoming URLs, like:
username1.mydomain.com
username2.mydomain.com 
etc

EXCEPT:
www.mydomain.com
and IMPORTANT EXCEPTION:
username1.mydomain.com?secret_code


I have the following lines in httpd.conf

 RewriteCond %{HTTP_HOST} [^w{3}]\.mydomain\.com 
 RewriteCond %{HTTP_HOST} (.*)\.mydomain\.com$ 
 RewriteRule .* /foo/bar/site.php?redir=%1

This lines works, but not filter the SECRET CODE, I have to put one line
but I don't know what. Can you help me? My first idea was this:

 RewriteCond %{HTTP_HOST} .*\.mydomain\.com\/.*\?secret_code

but I think it is not good

Thank you
Peter


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2 & bind 9

Posted by ld...@ulysium.net.
on 3/22/03 9:08 PM, Chris Meadors at clubneon@hereintown.net uttered the
following:

> I run Apache 2.x and Bind 9.x on all of my machines.  But also my Listen
> directive is just "Listen 80", no IP address.  I don't notice any delays
> on start up or any other time.

I tried that too, and that causes the queries to be for:

:: IN A

how about that? looking up an ipv6 address with an A record, but specifying
a listen on 127.0.0.1:80 causes the query to be made for an AAAA record, on
an ipv4 address, what's going on here?

anyway, since that machine I'm working on right now isn't yet networked,
it's making those "createfetch" for each of those queries, I'm assuming this
is to query outside servers, obviously the root servers, which don't answer
because that machine isn't hooked up yet, and that's causing the long
timeout delays.

In your case, I think it's quite possible that you may be experiencing the
same thing without knowing it, simply because your machines are hooked up to
the net and are able to reach the root servers and that causes the delays to
be short and you don't notice that.

Perhaps if you watch your bind logs as you're doing for example a config
test on apache, maybe (just maybe) you will see similar queries being made
to the dns.... Actually, I'd be very curious to know what queries you see
being made in those conditions, if you don't get the same as I do, then I
must have something badly wrong with this apache, maybe a compile issue, but
if you get the same queries, then I think it calls for some investigating on
apache 2....

I'm about ready to hook that machine up, within a few days probably. I may
end up seeing those long delays disappear because then the queries to the
root servers will happen and the timeouts won't cause this problem.

BUT!!! I think regardless of the fact that a hooked up machine won't have
the problem during normal operation, that if this type of queries are made
by all apache 2 setups, queries that never can get a valid answer from any
name server (a sane one that is), something must be wrong with apache 2.
isn't it??

-- 
Didier Godefroy
mailto:dg@ulysium.net


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2 & bind 9

Posted by Chris Meadors <cl...@hereintown.net>.
ldg@ulysium.net wrote:
> Is anyone using apache 2 with bind 9 yet?
> 
> I think it's possible that there can be some kind of problem maybe with
> apache when it's coupled with bind 9 on a system.
> 
> I know I have bind 9 running properly and it's answering queries correctly,
> but when certain incorrect queries are made to bind 9 that used to cause
> only an empty answer on bind 8, bind 9 doesn't answer after a long time out,
> with an empty record anyway.
> 
> The problem is that when a query to bind 9 is made, which is a query on an
> IP but the query isn't explicitly made as being a reverse lookup, such as
> dig -x x.x.x.x but without the -x switch, bind 9 waits while bind 8 doesn't.
> This is what apache 2 is doing and is causing extra long delays making such
> queries to bind 9.
> For example, putting only one single Listen directive in the apache 2 config
> putting it on one single IP, such as listen x.x.x.x:80 (x.x.x.x being an
> actual IP of course), then apache makes a query to the dns for that IP but
> not specifying a reverse lookup, so the query is something like x.x.x.x IN
> AAAA without calling for a reverse lookup on that.
> This type of query is made by apache whenever it is started, stopped or even
> when doing a config check, and this wouldn't be much of a problem and
> wouldn't be noticed with bind 8, because there would be no extra delay like
> bind 9 is causing.
> Once apache is started after all that delay, it seems to function properly,
> answering and serving web pages as expected.
> 
> Why is apache 2 behaving that way? Is it possible that something was
> overlooked in the apache development about the queries it makes at starup?
> 
> Shouldn't apache specify that the query on the IPs it makes are meant to be
> reverse lookups and not forward??
> 
> btw: I did put in a servername directive there, and it makes absolutely no
> difference. I've been running apache 1 with bind 8 for 6 years now and I'm
> used to it. It just doesn't seem to work right so far with apache 2 and bind
> 9 because there seems to have been some changes made and something may have
> been broken in the process, but what????
> 

I run Apache 2.x and Bind 9.x on all of my machines.  But also my Listen 
directive is just "Listen 80", no IP address.  I don't notice any delays 
on start up or any other time.

-- 
Chris


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org