Re: [users@httpd] RewriteCond: backreferences in TestString

2016-08-31 Thread Alexey Vlasov
On Fri, Aug 19, 2016 at 10:54:51AM -0400, Eric Covener wrote:
> > something like this:
> > RewriteCond /patch/ver(70) -f
> > RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:100%1%{REQUEST_URI} [NC,L,P]
> 
> That's valid, but it doesn't exactly match the subject of the email
> (which would not work)

It doesn't work indeed. I wrote it as an example of how I would like to
do it, in order not to write a big list of those rules that I cited at
first.
I mean for example to make the figure "70" from here:
/patch/ver(70)
move to %1 to the port number http://127.0.0.1:100%1%

Is it possible to put into practice on mod_rewrite?Or may be it is
possible using some other modules in Apache?

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] RewriteCond: backreferences in TestString

2016-08-19 Thread Alexey Vlasov
Hi,

I oo dynamically switch PHP versions but it turns out too many rules.
Can it somehow easier?

## PHP 5.2
RewriteCond /patch/ver52 -f
RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:10052%{REQUEST_URI} [NC,L,P]
...
## PHP 5.6
RewriteCond /patch/ver56 -f
RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:10056%{REQUEST_URI} [NC,L,P]

## PHP 7.0
RewriteCond /patch/ver70 -f
RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:10070%{REQUEST_URI} [NC,L,P]

For example, to PHP version of the flag file are substituted in the port
number?

something like this:
RewriteCond /patch/ver(70) -f
RewriteRule ^([^?]*)\.php(.*)$ http://127.0.0.1:100%1%{REQUEST_URI} [NC,L,P]

thanks

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [EMAIL PROTECTED] High CPU usage with MPM Worker/Event

2008-11-10 Thread Alexey Vlasov
Frankly speaking I don't know how many processes should be and how many
I need. I want to learn  - why is CPU worker usage so high?

Constantly ~300-500 ESTAB
connections. My server-status you have seen. The number of processes is
~20-25.

On other server I have tried to use the following settings:
ServerLimit   5
ThreadLimit 125
StartServers  4
MaxClients  500
MinSpareThreads  25
MaxSpareThreads 125
ThreadsPerChild 100
MaxRequestsPerChild   0
The number of processes: ~10-15.
But the situation with CPU is the same.

On Mon, Nov 10, 2008 at 01:01:49PM +0530, Arnab Ganguly wrote:
 Hi ,
 Can you please tell me about your requirements like for example how many
 processes do you want to create for handling the request, it seems to me the
 number of processes are very high, you can try out increasing the number of
 threads per process that way you can reduce the number of processes, also
 introduce ThreadLimit param in order to increase the ThreadsPerChild.Let me
 know if I can help you.
 Thanks
 -A
 
 On Sun, Nov 9, 2008 at 10:31 PM, Alexey Vlasov [EMAIL PROTECTED] wrote:
 
  Hi.
 
  I set MaxRequestPerChild = 400 (400 is average quantity of ESTABLISHED
  connections), but it was only worse.
 
  On Thu, Nov 06, 2008 at 12:01:00PM +0530, Arnab Ganguly wrote:
   Hi,
   Can you try with Non-zero MaxRequestPerChild value.Keep a value which is
   equal to number of request are particular process you want to handle.Once
  it
   is done the process will be killed and a new process is going to be
   started.I guess your CPU usage should come down.
   Thanks
   -A
  
   On Thu, Nov 6, 2008 at 2:49 AM, Alexey Vlasov [EMAIL PROTECTED]
  wrote:
  
Hi.
   
Working with Apache I noticed one strange thing such as high
  consumption
of CPU.
   
It looks like this.
server status:
Parent Server Generation: 2
Server uptime: 27 minutes 54 seconds
Total accesses: 137589 - Total Traffic: 6.1 GB
CPU Usage: u80.91 s52.19 cu0 cs0 - 7.95% CPU load
82.2 requests/sec - 3.7 MB/second - 46.2 kB/request
62 requests currently being processed, 38 idle workers
   
Especially remarkable is that Top gives - %
 PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
 11978 www   20   0  458m 111m 2000 S   0.7   0:01.66
 /opt/apache/2.2.9/sbin/httpd -k start
 18151 www   20   0  453m 106m 1996 S4  0.7   0:00.30
 /opt/apache/2.2.9/sbin/httpd -k start
 18911 www   20   0  333m 100m 1984 S3  0.6   0:00.09
 /opt/apache/2.2.9/sbin/httpd -k start
 18942 www   20   0  421m 101m 1996 S2  0.6   0:00.07
 /opt/apache/2.2.9/sbin/httpd -k start
   
Accounting also shows high consumption of CPU.
   
I don't know how it really should be, but I think it's not quite
  normal.
Can it be peculiarity or feature of my configuration? Well I really
  need
some advice from those who use worker/event. Thanks in advance.
   
Configuration of my box:
2 x Quad-core CPUs Intel Xeon E5345 linux-2.6.25, gcc-4.1.2, libc-2.6.1
   
Apache-2.2.9 make options:
CFLAGS=-O3 -march=nocona -pipe -fPIC -fomit-frame-pointer -ftracer
-mfpmath=sse
   
mpm config:
IfModule mpm_event_module
   ServerLimit  48
   StartServers  4
   MaxClients 1200
   MinSpareThreads  25
   MaxSpareThreads  75
   ThreadsPerChild  25
   MaxRequestsPerChild   0
/IfModule
   
Example of my virtualhost:
VirtualHost *
   IfModule fcgid_module
   FCGIWrapper /path_to_phpwrapper
   /IfModule
   CustomLog path_to_log combined
   ErrorLog path_to_log
   DocumentRoot /path_to_docroot
   SetEnv PHPRC /path_to_php.ini
   IfModule php5_module
   php_admin_value *** ***
   /IfModule
   ServerName example.com
   ServerAlias www.example.com
   ServerAlias www1.example.com
   AddHandler server-parsed .htm
   AddHandler server-parsed .html
   AddHandler server-parsed .shtm
   AddHandler server-parsed .shtml
   RewriteEngine On
   RewriteCond *** ***
   # some rules for backend
   RewriteRule *** *** [NC,L,P]
   SuexecUserGroup user group
/VirtualHost
   
Total number of virtual hosts is about 2000.
   
--
BRGDS. Alexey Vlasov.
   
-
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: [EMAIL PROTECTED]
 from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 
  --
  BRGDS. Alexey Vlasov.
 

-- 
BRGDS. Alexey Vlasov.

-
The official User-To-User support forum of the Apache HTTP Server Project

Re: [EMAIL PROTECTED] High CPU usage with MPM Worker/Event

2008-11-09 Thread Alexey Vlasov
Hi.

I set MaxRequestPerChild = 400 (400 is average quantity of ESTABLISHED
connections), but it was only worse.

On Thu, Nov 06, 2008 at 12:01:00PM +0530, Arnab Ganguly wrote:
 Hi,
 Can you try with Non-zero MaxRequestPerChild value.Keep a value which is
 equal to number of request are particular process you want to handle.Once it
 is done the process will be killed and a new process is going to be
 started.I guess your CPU usage should come down.
 Thanks
 -A
 
 On Thu, Nov 6, 2008 at 2:49 AM, Alexey Vlasov [EMAIL PROTECTED] wrote:
 
  Hi.
 
  Working with Apache I noticed one strange thing such as high consumption
  of CPU.
 
  It looks like this.
  server status:
  Parent Server Generation: 2
  Server uptime: 27 minutes 54 seconds
  Total accesses: 137589 - Total Traffic: 6.1 GB
  CPU Usage: u80.91 s52.19 cu0 cs0 - 7.95% CPU load
  82.2 requests/sec - 3.7 MB/second - 46.2 kB/request
  62 requests currently being processed, 38 idle workers
 
  Especially remarkable is that Top gives - %
   PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
   11978 www   20   0  458m 111m 2000 S   0.7   0:01.66
   /opt/apache/2.2.9/sbin/httpd -k start
   18151 www   20   0  453m 106m 1996 S4  0.7   0:00.30
   /opt/apache/2.2.9/sbin/httpd -k start
   18911 www   20   0  333m 100m 1984 S3  0.6   0:00.09
   /opt/apache/2.2.9/sbin/httpd -k start
   18942 www   20   0  421m 101m 1996 S2  0.6   0:00.07
   /opt/apache/2.2.9/sbin/httpd -k start
 
  Accounting also shows high consumption of CPU.
 
  I don't know how it really should be, but I think it's not quite normal.
  Can it be peculiarity or feature of my configuration? Well I really need
  some advice from those who use worker/event. Thanks in advance.
 
  Configuration of my box:
  2 x Quad-core CPUs Intel Xeon E5345 linux-2.6.25, gcc-4.1.2, libc-2.6.1
 
  Apache-2.2.9 make options:
  CFLAGS=-O3 -march=nocona -pipe -fPIC -fomit-frame-pointer -ftracer
  -mfpmath=sse
 
  mpm config:
  IfModule mpm_event_module
 ServerLimit  48
 StartServers  4
 MaxClients 1200
 MinSpareThreads  25
 MaxSpareThreads  75
 ThreadsPerChild  25
 MaxRequestsPerChild   0
  /IfModule
 
  Example of my virtualhost:
  VirtualHost *
 IfModule fcgid_module
 FCGIWrapper /path_to_phpwrapper
 /IfModule
 CustomLog path_to_log combined
 ErrorLog path_to_log
 DocumentRoot /path_to_docroot
 SetEnv PHPRC /path_to_php.ini
 IfModule php5_module
 php_admin_value *** ***
 /IfModule
 ServerName example.com
 ServerAlias www.example.com
 ServerAlias www1.example.com
 AddHandler server-parsed .htm
 AddHandler server-parsed .html
 AddHandler server-parsed .shtm
 AddHandler server-parsed .shtml
 RewriteEngine On
 RewriteCond *** ***
 # some rules for backend
 RewriteRule *** *** [NC,L,P]
 SuexecUserGroup user group
  /VirtualHost
 
  Total number of virtual hosts is about 2000.
 
  --
  BRGDS. Alexey Vlasov.
 
  -
  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: [EMAIL PROTECTED]
   from the digest: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
BRGDS. Alexey Vlasov.

-
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: [EMAIL PROTECTED]
  from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[EMAIL PROTECTED] High CPU usage with MPM Worker/Event

2008-11-05 Thread Alexey Vlasov
Hi.

Working with Apache I noticed one strange thing such as high consumption
of CPU.

It looks like this.
server status:
Parent Server Generation: 2
Server uptime: 27 minutes 54 seconds
Total accesses: 137589 - Total Traffic: 6.1 GB
CPU Usage: u80.91 s52.19 cu0 cs0 - 7.95% CPU load
82.2 requests/sec - 3.7 MB/second - 46.2 kB/request
62 requests currently being processed, 38 idle workers

Especially remarkable is that Top gives - %
  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
  11978 www   20   0  458m 111m 2000 S   0.7   0:01.66
  /opt/apache/2.2.9/sbin/httpd -k start
  18151 www   20   0  453m 106m 1996 S4  0.7   0:00.30
  /opt/apache/2.2.9/sbin/httpd -k start
  18911 www   20   0  333m 100m 1984 S3  0.6   0:00.09
  /opt/apache/2.2.9/sbin/httpd -k start
  18942 www   20   0  421m 101m 1996 S2  0.6   0:00.07
  /opt/apache/2.2.9/sbin/httpd -k start

Accounting also shows high consumption of CPU.

I don't know how it really should be, but I think it's not quite normal.
Can it be peculiarity or feature of my configuration? Well I really need
some advice from those who use worker/event. Thanks in advance.

Configuration of my box:
2 x Quad-core CPUs Intel Xeon E5345 linux-2.6.25, gcc-4.1.2, libc-2.6.1

Apache-2.2.9 make options:
CFLAGS=-O3 -march=nocona -pipe -fPIC -fomit-frame-pointer -ftracer
-mfpmath=sse

mpm config:
IfModule mpm_event_module
ServerLimit  48
StartServers  4
MaxClients 1200
MinSpareThreads  25
MaxSpareThreads  75
ThreadsPerChild  25
MaxRequestsPerChild   0
/IfModule

Example of my virtualhost:
VirtualHost *
IfModule fcgid_module
FCGIWrapper /path_to_phpwrapper
/IfModule
CustomLog path_to_log combined
ErrorLog path_to_log
DocumentRoot /path_to_docroot
SetEnv PHPRC /path_to_php.ini
IfModule php5_module
php_admin_value *** ***
/IfModule
ServerName example.com
ServerAlias www.example.com
ServerAlias www1.example.com
AddHandler server-parsed .htm
AddHandler server-parsed .html
AddHandler server-parsed .shtm
AddHandler server-parsed .shtml
RewriteEngine On
RewriteCond *** *** 
# some rules for backend
RewriteRule *** *** [NC,L,P]
SuexecUserGroup user group
/VirtualHost

Total number of virtual hosts is about 2000.

-- 
BRGDS. Alexey Vlasov.

-
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: [EMAIL PROTECTED]
  from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[EMAIL PROTECTED] ProxyTimeout and mod_rewrite proxy request

2008-01-29 Thread Alexey Vlasov
Hi,

Hi,

I use Apache 2.2.8 (2.2.6) worker mpm as frontend proxy server for
working up static requests.
And Apache 2.2.3 mpm prefork (as backend) with mod_php serves to work
up
dynamic requests, in this case, for PHP scripts.

I separate static from dynamic in worker with simple rules mod_rewrite,
for example:
...
RewriteCond %{HTTP_HOST} ([^/:]*)(.*)
RewriteRule ^([^?]*)\.php(.*)$ http://%1:8080%{REQUEST_URI} [NC,L,P]
...

When backend doesn't answer on requests, frontend returns to the client
an error 502 Proxy Error.

I want to increase timeout for getting this error. I tried to use
Timeout 300, ProxyTimeout 300 in httpd.conf, but it didn't bring any
result, timeout is 180 seconds.
I check it this way:

$ cat sleep.php
?php ini_set ('max_execution_time', '3600'); sleep (600); ?

$ time wget -T 3600 http://test-apache.hu/sleep.php
--21:23:42--  http://test-apache.hu/sleep.php
   = `sleep.php'
Resolving test-apache.hu... 111.222.222.111
Connecting to test-apache.hu|111.222.222.111|:80... connected.
HTTP request sent, awaiting response... 502 Proxy Error
21:26:43 ERROR 502: Proxy Error.

real3m1.556s
user0m0.000s
sys 0m0.004s

Does anyone have ideas what the timeout is and how to increase it?

-- 
BRGDS. Alexey Vlasov.

-
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: [EMAIL PROTECTED]
  from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]