Re: [suPHP] PHP opcode cache that works with suPHP

2009-05-19 Thread Jani Ollikainen
Vladimir Prelovac wrote:
 Do you guys know of any PHP caching solution that will work with suphp?

There aren't for the reasons how mod_suphp works.

I've been thinking about what would be needed to make some opcode caching.

- PHP as Fast-CGI with user rights

- mod_suphp or fork or new code (later mod_fsuphp:) which handles these 
and sends requests to already existing fastcgi php if one exists, if not
it will run new fast-cgi php and send the request there.

- mod_fsuphp will need to watch those fast-cgi processes and kill them
when some idle time is exceeded or some memory consuption restrictions
is exceeded.

Negative impact is of course the memory consuption that every user will
have it's own opcode cache.

Maybe that would also be possible to avoid with shared memory which is 
read/writable with some group which these users belong and the used 
opcode cache uses shm.

I'm not so familiar with apache/apache's modules/mod_suphp that I could
say that this approach is doable. This is just something that I've been
thinking.

If this is doable I think it would be nice in the sites which are using
mod_suphp but there aren't plenty of active users.

At this moment I don't have any plans to research/implement these,
but if someone has I'd be interested.

Also comments are welcome...


-- 
Yhteistyöterveisin,
Jani Ollikainen @ Pronetko Networks Oy

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] PHP opcode cache that works with suPHP

2009-05-19 Thread Aki Tuomi
On Tue, May 19, 2009 at 11:54:44AM +0300, Jani Ollikainen wrote:
 Vladimir Prelovac wrote:
  Do you guys know of any PHP caching solution that will work with suphp?
 
 There aren't for the reasons how mod_suphp works.
 

Perhaps best way to deal with this would be to persist a per-user PHP
process for dealing with subsequent requests. You could kill it after
certain number of requests or time. 

Special care should be taken to handle chrooting correctly, and that
same process is never reused for another user. 

This is similar to how Passenger module for ruby works. 

Aki Tuomi


signature.asc
Description: Digital signature
___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


[suPHP] terminate called after throwing an instance of 'suPHP::LookupException'

2009-05-19 Thread Margusja
Hello, the old good terminate called after throwing an instance of 
'suPHP::LookupException' problem is back.

Some month ago I have had a problem and now I have it again.
The old problem description and at the moment I have almost the same 
situation. Now I have OS Fedora Core 10 and php:
[20:08:55 r...@h11 lepinguabi.ee]# php-cgi -v
PHP 5.2.6 (cgi-fcgi) (built: Sep 13 2008 11:12:16)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend 
Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend 
Technologies


---
Hello,

I found a problem.
The problem was in directory: /home/virtual/tuuleke.ee/vhosts/
permissions. In old system (Fedora Core 7 and
mod_suphp-0.6.3-1.fc9.x86_64) it works fine fith permission:
[12:54:56 root at h11 ~]# ls -lah /var/www/tuuleke.ee/
total 28K
drwxrwxr-x   4 11933 10386 4.0K 2008-08-25 20:07 .
drwxr-xr-x 280 root  root   12K 2009-03-02 15:47 ..
drwxrwxr-x   2 11933 10386 4.0K 2008-08-25 20:07 users
drwxrwxr-x   3 11933 10386 4.0K 2008-09-03 21:21 vhosts

But not anymore in Fedora Core 9 and mod_suphp-0.6.3-3.fc10.x86_64 - I
tried even Fedora Core 10 package :) In current sustem it works with
directory permission:
[12:57:06 root at h11 tuuleke.ee]# ls -lah
total 40K
drwxrwxr-x   4 root  root  4.0K 2008-08-25 20:07 .
drwxr-xr-x 277 root  root   12K 2008-07-14 22:37 ..
drwxrwxr-x   2 11933 10386 4.0K 2008-08-25 20:07 users
drwxrwxr-x   3 root  root  4.0K 2008-09-03 21:21 vhosts

Ok that is not a problem but can someone describe what is changed?

---
Margus Margusja Roo
+3725148780
skype: margusja
msn: margusja at kodila.ee
homepage: http://margusja.pri.ee



Margusja wrote:
  Hello.
 
  I still use mod_suphp-0.6.2-1.fc7 on Fedora Core 7. All is fine.
 
  Set up new test server and moved all data to new server. Upgraded Fedora
  Core 7 to Fedora Core 9 and got mod_suphp-0.6.3-1.fc9.x86_64.
 
  One example virtualhost config.
  VirtualHost *:80
  ServerName  www.tuuleke.ee
  ServerAlias tuuleke.ee  

  DocumentRoot/home/virtual/tuuleke.ee/vhosts/www/htdocs
  CustomLog  
  /home/virtual/tuuleke.ee/vhosts/www/logs/www.tuuleke.ee.access combined
  ErrorLog   
  /home/virtual/tuuleke.ee/vhosts/www/logs/www.tuuleke.ee.errors
  Directory /home/virtual/tuuleke.ee/vhosts/www/htdocs
  Options MultiViews FollowSymLinks
  AllowOverride FileInfo AuthConfig Limit Indexes
  /Directory
  Alias /stats /home/www/logs/stats
 
  ScriptAlias /cgi-bin/ 
/home/virtual/tuuleke.ee/vhosts/www/cgi-bin/
  Directory /home/virtual/tuuleke.ee/vhosts/www/cgi-bin
  Options ExecCGI
  AllowOverride FileInfo AuthConfig Limit Indexes
  /Directory
 
 
  Directory /home/virtual/tuuleke.ee/vhosts/www/cgi-bin
  Options ExecCGI
  /Directory
 
 
 
  RewriteEngine On
  RewriteRule   ^/~([^./]+)(.*) 
  /ispman/domains/tuuleke.ee/users/$1_tuuleke_ee/public_html$2
 
  suPHP_Engine on
  suPHP_AddHandler php5-script
 
  CBandSpeed 128 3 1
  CBandRemoteSpeed 20kb/s 1 1
  CBandScoreboard /home/virtual/tuuleke.ee/vhosts/www/scoreboard
  CBandLimit 100M
  CBandPeriod 4W
 
  /VirtualHost
 
  /etc/suphp.conf:
 
  I   
  
/etc/suphp.conf 


  Row 1Col 1   10:58  Ctrl-K H for help
  [global]
  ;Path to logfile
  logfile=/var/log/suphp.log
 
  ;Loglevel
  loglevel=info
 
  ;User Apache is running as
  webserver_user=apache
 
  ;Path all scripts have to be in
  docroot=/
 
  ;Path to chroot() to before executing script
  ;chroot=/mychroot
 
  ; Security options
  allow_file_group_writeable=true
  allow_file_others_writeable=false
  allow_directory_group_writeable=true
  allow_directory_others_writeable=false
 
  ;Check wheter script is within DOCUMENT_ROOT
  check_vhost_docroot=false
 
  ;Send minor error messages to browser
  errors_to_browser=true
 
  ;PATH environment variable
  env_path=/bin:/usr/bin
 
  ;Umask to set, specify in octal notation
  umask=0077
 
  ; Minimum UID
  min_uid=500
 
  ; Minimum GID
  min_gid=500
 
  ; Use correct permissions for mod_userdir sites
  handle_userdir=true
 
  [handlers]
  ;Handler for php-scripts
  php5-script=php:/usr/bin/php-cgi
 
  ;Handler for CGI-scripts
  x-suphp-cgi=execute:!self
 
  /etc/httpd/conf.d/mod_suphp.conf:
  # This is the Apache server configuration file providing suPHP support..
  # It contains the configuration directives to instruct the server how to
  # serve php pages while switching to the user context before rendering.
 
  LoadModule suphp_module modules/mod_suphp.so
 
 
  ### Uncomment to activate mod_suphp
  #suPHP_AddHandler php5-script
 
 
  # This option tells mod_suphp if a