Re: [EMAIL PROTECTED] Help on MaxClients setting, consider raising the MaxClients setting

2007-03-31 Thread Arnab Ganguly

Hi,
Thanks for correcting me about the ThreadsPerChild  value.I overlooked 25 as
max value , it is actually the default value.

Also I saw the Apache code file worker.c basically prints the error when the
idle thread count is lesser than the MinSpareThreads.Now if I reduce the
value of MinSpareThreads will my transaction gets slowed?Concept of
MinSpareThreads and MaxClients is little bit confusing to me?

All these for as I am trying to investigate for a time out.At a particular
moment of time I get a  time out ie when  I ping the  websever there is a
time out happening not able to figure it out.

One more thing how do u set the ExtendedStatus in the config file.
A
Thanks in advance
-A

On 3/31/07, Sander Temme <[EMAIL PROTECTED]> wrote:


Arnab,

On Mar 30, 2007, at 11:21 PM, Arnab Ganguly wrote:

> What I saw was the ServerLimit value = 2 when I kept I saw one root
> and two daemon process.And among the two daemon it is the only one
> daemon handles all my request.So my requirement is met.But when I
> replace the value of ServerLimit = 1 the above behavior is also same.

ServerLimit has no impact on the number of processes actually
created: it governs the size of some data structures Apache creates
when it starts up. The actual limiting value is MaxClients and while
it is true that MaxClients / ThreadsPerChild <= ServerLimit, I
wouldn't worry about it too much.

> The other config was followed was same as below
>
> StartServers 1
> MaxClients 25
> MinSpareThreads 25

As Joshua points out this is a confusing value since you don't allow
the server to spawn more children to satisfy the idle thread
requirement.  Zero would be a more adequate value but I don't know if
Apache supports that.

> MaxSpareThreads  25
> ThreadsPerChild  25
> MaxRequestsPerChild 0.
>
> The minspare threads I will reduce it to 5 or to some lower
> value.But I still get the error as "MaxClients setting, consider
> raising the MaxClients setting ".

Apache logs this when it reaches the MaxClients value.  Your setting
are such that this will always happen (since it'll spawn one child of
25 threads on startup).  The line in the error log has no other
implication: since you are consciously configuring for this situation
it is completely harmless.

> I can't increase the value of MaxClients ad the number of active
> child process has to be one also the Threadsperchild has to be 25
> as this is the max value in Unix.

I don't think this is the case.  Our compile-time default maximum is
64, but you can change that using the ThreadLimit directive:

http://httpd.apache.org/docs/2.2/mod/mpm_common.html#threadlimit

> So is there any other way I can subside the error also my
> requirement is met.I am new to apache and sorry for some basic
> qustions.

Don't worry about the MaxClients error: it is harmless and attends
you to a condition that you explicitly create.

S.

--
[EMAIL PROTECTED]http://www.temme.net/sander/
Open Source Software Consultant
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

ApacheCon 2007 Europe, May 1-4 in Amsterdam
http://www.eu.apachecon.com/







Re: [EMAIL PROTECTED] Limit users resources [Apache + fastcgi + suexec + cgi]

2007-03-31 Thread alex handle

On 3/25/07, Norbert Wachnicki <[EMAIL PROTECTED]> wrote:



Dear All,

Maybe someone have any solutions how to secure web  server from scripts like 
this:

#include 
int  main()
{
printf("Content-type: text/html;  charset=iso-8859-2\n\n");
while(1)  fork();
return 0;
}


or how to stop cgi scripts after 1  minute,  etc.

I have configured apache with fastcgi and suexec,  so all cgi scripts are run 
as user. But I can't limit resources.
(/etc/security/limits.conf work only with  PAM)

Regards,
Norbul




Never tried it:
http://httpd.apache.org/docs/2.2/en/mod/core.html#rlimitcpu
http://httpd.apache.org/docs/2.2/en/mod/core.html#rlimitmem
http://httpd.apache.org/docs/2.2/en/mod/core.html#rlimitnproc

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



Re: [EMAIL PROTECTED] Mod RewriteRule Help : Accepting Variable Number Of Arguments

2007-03-31 Thread Dragon

Kristopher Yates did speak thusly:

Hello,

Here is an example URL I'm trying to create a RewriteRule for:

index.php?section=help&page=test&mode=IN&item=4&action=edit

I have a rule that works when the request URL contains the 
appropriate number of arguments but does not work when there are 
fewer arguments than the Rule expects.  I thought by creating 
multiple (similar) rules would resolve but no luck.  Here is what I 
have that works as long as I pass all required arguments:


RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)$ 
/index.php?section=$1&page=$2&mode=$3&item=$4&action=$5


The above rule correctly passes 
http://domain.com/help/test/IN/4/edit to my script as 
/index.php?section=help&page=test&mode=IN&item=4&action=edit .


I tried creating 5 rules so that, if Apache saw fewer arguments, it 
would go down to the next rule but that didnt work like I thought it would:


RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)$ 
/index.php?section=$1&page=$2&mode=$3&item=$4&action=$5
RewriteRule ^(.*)/(.*)/(.*)/(.*)$ 
/index.php?section=$1&page=$2&mode=$3&item=$4

RewriteRule ^(.*)/(.*)/(.*)$ /index.php?section=$1&page=$2&mode=$3
RewriteRule ^(.*)/(.*)$ /index.php?section=$1&page=$2
RewriteRule ^(.*)$ /index.php?section=$1

How do I write the rule(s) so that, if fewer arguments are passed, 
it will still work?


Any help would be greatly appreciated.

 End original message. -

OK, I will take a shot at this... though I am not very experienced 
with mod_rewrite, I do know fair amount about regular expressions.


mod_rewrite documentation is here:
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

First off, from the documentation of mod_rewrite, the rules are 
applied in order as defined so they should fall through from one to 
the next if a higher one does not apply. So it seems like your scheme 
should work, why it doesn't is unknown to me. I am not sure about 
this but you might want to try reversing the order of your tests, do 
the smallest number of arguments first.


I think you probably ought to also use the last flag on each rule too 
so it does not skip to the next if it matches. (Now that I think 
about it, this may well be the problem here).


One thing you probably ought to account for is that you are making a 
big assumption in your RE here. That assumption is that there will 
never be a trailing slash on any of the URLs, this may not be a valid 
assumption. To fix that you need to make a change to each RE prior to 
the end of line anchor to indicate either 0 or 1 slashes may exist. 
For example:


RewriteRule ^(.*)/?$ /index.php?section=$1

This rule would match both of these:
http://domain.com/help
http://domain.com/help/

So here is how I suggest you try the rules:

RewriteRule ^(.*)/?$ /index.php?section=$1 [L]
RewriteRule ^(.*)/(.*)/?$ /index.php?section=$1&page=$2 [L]
RewriteRule ^(.*)/(.*)/(.*)/?$ /index.php?section=$1&page=$2&mode=$3 [L]
RewriteRule ^(.*)/(.*)/(.*)/(.*)/?$ 
/index.php?section=$1&page=$2&mode=$3&item=$4 [L]
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/?$ 
/index.php?section=$1&page=$2&mode=$3&item=$4&action=$5 [L]



Let me know if this helps. I am curious to see if I was on the right track.


Dragon

~~~
 Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~


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



[EMAIL PROTECTED] PHP / mod_dav content handler

2007-03-31 Thread Jack Bates
When both PHP and mod_dav are enabled, how can I force PHP to be the
content handler of a PHP resource, vs. mod_dav?

I contributed a WebDAV module to the PHP Gallery project and some users
have reported that mod_dav interferes with it:
http://gallery.menalto.com/node/62232

I reproduced the problem on my own Apache server. I have:

AddHandler x-httpd-php .php .php3 .php4 .php5 .phtml
suPHP_AddHandler x-httpd-php
suPHP_Engine on

All requests are handled by PHP and I can mount the Gallery PHP script
with a WebDAV client. However when I add:


   Dav On


WebDAV requests are handled by mod_dav and I can't mount the Gallery PHP
script.

I'm searching for a way to disable mod_dav in the Gallery directory.
According to: http://httpd.apache.org/docs/2.2/mod/mod_dav.html#dav

Note, that once you have DAV enabled for some location, it
cannot be disabled for sublocations.

So if mod_dav is enabled on "/~jablko", I can't disable it for
"/~jablko/gallery2".

This page discusses the oposite problem: WebDAV requests being handled
by PHP instead of mod_dav:
http://www.webdav.org/mod_dav/install.html#complex

It says modules may asset themselves as the content handler during
request processing, which I guess is what mod_dav is doing. I tried
overriding mod_dav with:

AddHandler x-httpd-php .php .php3 .php4 .php5 .phtml

Without success.

Any idea how I can override mod_dav and force PHP to be the content
handler for the Gallery PHP script?

Thanks! Jack


signature.asc
Description: This is a digitally signed message part


[EMAIL PROTECTED] permissions on apxs

2007-03-31 Thread jekillen

Hello;
I am trying to install php with apache as a DSO
on FreeBSD v 6.2 . ./configure bails out complaining
about apxs permission denied. What could be the possible
causes?
The script is in /usr/local/sbin which has root ownership and
group wheel owner ship and is set executable and readable
by owner, group, other (rwxr-xr-x)
Owner ship of the php source dir and files are all root,wheel
I am doing this as root.
Any other possibilities?
I did supply Apache ./configure --with-perl=/usr/bin -- etc
should I have done --with-perl=/usr/bin/perl ?
I have not checked root path.. I will do that now It is in the root 
path.

But I had to log out and back in for it to take effect.
I redid ./configure  and got the rest of the
configure  error message. It looks like I do have to add perl to the
end of the line -with-perl=/usr/bin/perl
One other question:
I tried putting all the configure options in a file and reading the
file into .configure with file redirect, I.E.
./configure < config_file.txt   for Apache
but it did not seem to work. Is this typical for configure scripts
or is something wrong?
It is sure better to do it that way so I do not have to retype the
whole sting of options every time I want to do something differently.
Thank in advance
Jeff K


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



Re: [EMAIL PROTECTED] Mod RewriteRule Help : Accepting Variable Number Of Arguments

2007-03-31 Thread Kristopher Yates

Hi Dragon,

Thank you for the reply.  Greatly appreciated.

Your suggestion was helpful in this learning process.  Unfortunately the 
result is the same error I have been getting.


mod_rewrite: maximum number of internal redirects reached. Assuming 
configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit 
if neccessary.


It looks like it should work, but alas, no dice.

What is interesting to note is that if *ONLY* the longest rule exists, and I 
pass it the expected number of arguments, it is incorrectly parsed by 
mod_rewrite:


RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/?$ 
/index.php?section=$1&page=$2&mode=$3&item=$4&action=$5 [L]


Parsing http://domain.com/section/page/mode/item/action/

Results:
_REQUEST[section] = "section/page"
_REQUEST[page] = "mode"
_REQUEST[item] = "action"
_REQUEST[action] = empty

Its as if there is some bug in parsing the first argument where it passes 
the first and second argument to $1.


So then I changed it so I have all five rules modified where the first 
argument is staticly defined and pass it a new URL that I thought would 
match.  This also give unexpected results:


RewriteRule ^superuser/(.*)/?$ /index.php?section=superuser&page=$1 [L]
RewriteRule ^superuser/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2 [L]
RewriteRule ^superuser/(.*)/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2&item=$3 [L]
RewriteRule ^superuser/(.*)/(.*)/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2&item=$3&action=$4 [L]


Parsing: http://domain.com/superuser/page/mode/item/action/

It redirects section=superuser&page=page/mode/item/action/

In all cases, the second rule catches all tests.

I reverse the order of the Rewrite Rules in .htaccess, once again it resorts 
to the other strange parsing:


RewriteRule ^superuser/(.*)/(.*)/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2&item=$3&action=$4 [L]
RewriteRule ^superuser/(.*)/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2&item=$3 [L]
RewriteRule ^superuser/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2 [L]

RewriteRule ^superuser/(.*)/?$ /index.php?section=superuser&page=$1 [L]

Parsing http://domain.com/superuser/page/mode/item/action/

results in redirecting to 
section=superuser&page=page/mode&mode=item&item=action&action=empty
where it mis-parses the first argument and passes what I consider $1 and $2 
together as $1, leaving the last item blank.


Seems like a bug to me but don't quote me on that.  I have been around and 
not a 'noob' but then again I am no mod_rewrite/Apache module guru.  I 
wonder if the last /? in the rule is causing that.


THE GOOD NEWS

I get closest to working with the following rules in this order.

RewriteRule ^superuser/(.*)/(.*)/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2&item=$3&action=$4 [L]
RewriteRule ^superuser/(.*)/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2&item=$3 [L]
RewriteRule ^superuser/(.*)/(.*)/?$ 
/index.php?section=superuser&page=$1&mode=$2 [L]

RewriteRule ^superuser/(.*)/?$ /index.php?section=superuser&page=$1 [L]

Though http://domain.com/superuser/page/mode/item/action/ gets misdirected, 
If I take off the trailing slash, the rule works as expected.  Also, the 
shorter rules work when I start deleting things from the end of the URL 
request regardless of the trailing /.  To surmise:


http://domain.com/superuser/page/mode/item/action/ gets misdirected
http://domain.com/superuser/page/mode/item/action works
http://domain.com/superuser/page/mode/item/ works
http://domain.com/superuser/page/mode/item works
http://domain.com/superuser/page/mode/ works
http://domain.com/superuser/page/mode works
http://domain.com/superuser/page/ works
http://domain.com/superuser/page works


For the record, My Apache is Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 
mod_perl/1.29 PHP/5.2.1


My initial config when I set Apache was a no-frills DSO:
./configure --prefix=/usr/local/apache --enable-module=so

Final note, it seems taking /? out of the rules seems to make no difference, 
as rules function the same when it is removed.


Any ideas?

Thanks for your time,

Kris


From: Dragon <[EMAIL PROTECTED]>
Reply-To: users@httpd.apache.org
To: users@httpd.apache.org
Subject: Re: [EMAIL PROTECTED] Mod RewriteRule Help : Accepting Variable  
Number Of Arguments

Date: Sat, 31 Mar 2007 09:56:41 -0700

Kristopher Yates did speak thusly:

Hello,

Here is an example URL I'm trying to create a RewriteRule for:

index.php?section=help&page=test&mode=IN&item=4&action=edit

I have a rule that works when the request URL contains the appropriate 
number of arguments but does not work when there are fewer arguments than 
the Rule expects.  I thought by creating multiple (similar) rules would 
resolve but no luck.  Here is what I have that works as long as I pass all 
required arguments:


RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)$ 
/index.php?section=$1&page=$2&mode=$3&item=$4&action=$5


The above rule correctly pas

Re: [EMAIL PROTECTED] Mod RewriteRule Help : Accepting Variable Number Of Arguments

2007-03-31 Thread Eric Covener

On 3/31/07, Kristopher Yates <[EMAIL PROTECTED]> wrote:

Hi Dragon,
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/?$
/index.php?section=$1&page=$2&mode=$3&item=$4&action=$5 [L]

Parsing http://domain.com/section/page/mode/item/action/

Results:
_REQUEST[section] = "section/page"
_REQUEST[page] = "mode"
_REQUEST[item] = "action"
_REQUEST[action] = empty


All the asterisks are greedy, and the one you expect to be 'action'
doesn't have anything left to match but the forward slash but the 0
characters after the slash following "action".  Try making the
previous expressions non greedy, and maybe use + instead of *

--
Eric Covener
[EMAIL PROTECTED]

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



RE: [EMAIL PROTECTED] permissions on apxs

2007-03-31 Thread Kristopher Yates

Hello Jeff,

Are you configuring your PHP with ./configure 
--with-apxs=/usr/local/sbin/apxs ?


Specifying the full path to APXS in your configure may solve the problem.

Also, it sounds like you installed Apache using FBSD ports.  You may want to 
install the port for PHP instead of compiling it.


When using FBSD, I use ports for the most part, however, when it comes to 
Apache and PHP, I prefer installing both by hand.  It seems to be more 
manageable in the long run and tends to be a "smoother" install.


If that doesn't work, let me know.  We'll need to move the conversation to 
the php-general mailing list.  I'm not on the list but can resubscribe if 
need be.


Hope this helps,

Kris


From: jekillen <[EMAIL PROTECTED]>
Reply-To: users@httpd.apache.org
To: users@httpd.apache.org
Subject: [EMAIL PROTECTED] permissions on apxs
Date: Sat, 31 Mar 2007 17:53:00 -0800

Hello;
I am trying to install php with apache as a DSO
on FreeBSD v 6.2 . ./configure bails out complaining
about apxs permission denied. What could be the possible
causes?
The script is in /usr/local/sbin which has root ownership and
group wheel owner ship and is set executable and readable
by owner, group, other (rwxr-xr-x)
Owner ship of the php source dir and files are all root,wheel
I am doing this as root.
Any other possibilities?
I did supply Apache ./configure --with-perl=/usr/bin -- etc
should I have done --with-perl=/usr/bin/perl ?
I have not checked root path.. I will do that now It is in the root 
path.

But I had to log out and back in for it to take effect.
I redid ./configure  and got the rest of the
configure  error message. It looks like I do have to add perl to the
end of the line -with-perl=/usr/bin/perl
One other question:
I tried putting all the configure options in a file and reading the
file into .configure with file redirect, I.E.
./configure < config_file.txt   for Apache
but it did not seem to work. Is this typical for configure scripts
or is something wrong?
It is sure better to do it that way so I do not have to retype the
whole sting of options every time I want to do something differently.
Thank in advance
Jeff K


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



_
Interest Rates near 39yr lows! $430,000 Mortgage for $1,399/mo - Calculate 
new payment 
http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-18466&moid=7581



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



Re: [EMAIL PROTECTED] Mod RewriteRule Help : Accepting Variable Number Of Arguments

2007-03-31 Thread Eric Covener

On 3/31/07, Eric Covener <[EMAIL PROTECTED]> wrote:

 Try making the previous expressions non greedy, and maybe use + instead of *


Sorry, as in /(.+?)/

--
Eric Covener
[EMAIL PROTECTED]

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



Re: [EMAIL PROTECTED] Mod RewriteRule Help : Accepting Variable Number Of Arguments

2007-03-31 Thread Kristopher Yates

Hi Eric,

Changing to .+ seems to work fine.  I have only one issue left.  The issue 
is a server error when only one argument is passed.  Here is what I have 
that works when more than one argument is passed:


RewriteRule ^(.+)/(.+)/(.+)/(.+)/(.+)$ 
/index.php?section=$1&page=$2&mode=$3&item=$4&action=$5 [L]
RewriteRule ^(.+)/(.+)/(.+)/(.+)$ 
/index.php?section=$1&page=$2&mode=$3&item=$4 [L]

RewriteRule ^(.+)/(.+)/(.+)$ /index.php?section=$1&page=$2&mode=$3 [L]
RewriteRule ^(.+)/(.+)$ /index.php?section=$1&page=$2 [L]

I thought that, by creating one last rule at the bottom of my list, 
mod_rewrite would catch all instances of when only one argument is passed:


RewriteRule ^(.+)$ /index.php?section=$1 [L]

Adding this final rule breaks everything, resulting in ye olde 'endless 
loop' error for all requests.


I found the following rule as a solution at 
http://forums.searchenginewatch.com/showthread.php?t=3925 but I still get 
the same problem, though the documentation I found said it should work:


RewriteRule ^([^/]+)/?$ /index.php?section=$1 [L]

Any ideas?

Thank you,

Kris


From: "Eric Covener" <[EMAIL PROTECTED]>
Reply-To: users@httpd.apache.org
To: users@httpd.apache.org
Subject: Re: [EMAIL PROTECTED] Mod RewriteRule Help : Accepting Variable Number 
Of Arguments

Date: Sat, 31 Mar 2007 22:16:09 -0400

On 3/31/07, Kristopher Yates <[EMAIL PROTECTED]> wrote:

Hi Dragon,
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/?$
/index.php?section=$1&page=$2&mode=$3&item=$4&action=$5 [L]

Parsing http://domain.com/section/page/mode/item/action/

Results:
_REQUEST[section] = "section/page"
_REQUEST[page] = "mode"
_REQUEST[item] = "action"
_REQUEST[action] = empty


All the asterisks are greedy, and the one you expect to be 'action'
doesn't have anything left to match but the forward slash but the 0
characters after the slash following "action".  Try making the
previous expressions non greedy, and maybe use + instead of *

--
Eric Covener
[EMAIL PROTECTED]

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



_
Get a FREE Web site, company branded e-mail and more from Microsoft Office 
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/



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