[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5306] trunk



Revision: 5306
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5306&view=rev
Author:   einhverfr
Date:     2012-12-06 09:25:05 +0000 (Thu, 06 Dec 2012)
Log Message:
-----------
Merging from branches/1.3

Modified Paths:
--------------
    trunk/Changelog

Added Paths:
-----------
    trunk/tools/app.psgi
    trunk/tools/lsmb_13-fcgi.conf
    trunk/tools/system/

Property Changed:
----------------
    trunk/


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-5303
   + /branches/1.3:3711-5305

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-12-06 09:21:16 UTC (rev 5305)
+++ trunk/Changelog	2012-12-06 09:25:05 UTC (rev 5306)
@@ -81,6 +81,7 @@
 
 Changelog for 1.3.26
 * Added db statistics post-upgrade and pre/post rebuild (Chris T, 3586113)
+* Merged in fcgi support from addons (Chris T)
 
 Changelog for 1.3.25
 * Fixed internal server errors on LedgerSMB->error() during new() (Chris T)

Copied: trunk/tools/app.psgi (from rev 5305, branches/1.3/tools/app.psgi)
===================================================================
--- trunk/tools/app.psgi	                        (rev 0)
+++ trunk/tools/app.psgi	2012-12-06 09:25:05 UTC (rev 5306)
@@ -0,0 +1,45 @@
+#!/usr/bin/plackup -s FCGI ledgersmb.fcgi
+
+package LedgerSMB::FCGI;
+
+use CGI::Emulate::PSGI;
+use FCGI::ProcManager;
+use FindBin;
+# Preloads
+use LedgerSMB;
+use LedgerSMB::Form;
+use LedgerSMB::Sysconfig;
+use LedgerSMB::Template;
+use LedgerSMB::Template::LaTeX;
+use LedgerSMB::Template::HTML;
+use LedgerSMB::Locale;
+use LedgerSMB::DBObject;
+use LedgerSMB::File;
+
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
+
+# Process Manager
+my $proc_manager = FCGI::ProcManager->new({ n_processes => 10 });
+
+
+my $app = CGI::Emulate::PSGI->handler(
+   sub {
+       if (my $cpid = fork()){
+          wait
+       } else {
+          $proc_manager->pm_pre_dispatch();
+          $uri = $ENV{REQUEST_URI};
+          $uri =~ s/\?.*//;
+          $ENV{SCRIPT_NAME} = $uri;
+          $ENV{SCRIPT_NAME} =~ m/([^\/\\]*.pl)\?*.*$/;
+
+          my $script = $1;
+          warn $script;
+          do "./$script";
+          $proc_manager->pm_post_dispatch();
+       }
+   }
+);
+

Copied: trunk/tools/lsmb_13-fcgi.conf (from rev 5305, branches/1.3/tools/lsmb_13-fcgi.conf)
===================================================================
--- trunk/tools/lsmb_13-fcgi.conf	                        (rev 0)
+++ trunk/tools/lsmb_13-fcgi.conf	2012-12-06 09:25:05 UTC (rev 5306)
@@ -0,0 +1,63 @@
+# This file must be edited to substitute the current path with WORKING_DIR
+
+Alias /ledgersmb_1.3 WORKING_DIR/
+LoadModule fastcgi_module modules/mod_fastcgi.so
+
+LogLevel debug
+
+FastCgiExternalServer WORKING_DIR/ledgersmb.fcgi -socket /var/run/httpd/fastcgi/lsmb.sock -idle-timeout 240 -pass-header Authorization
+
+<Directory WORKING_DIR>
+
+  # Rewrite rule to allow HTTP Authorization information to the scripts only
+  # from this directory.
+  RewriteEngine On
+  RewriteBase /ledgersmb_1.3/
+  RewriteRule ^([^/]*\.pl) ledgersmb.fcgi/$0 
+
+
+  AllowOverride All
+  Options Includes FollowSymlinks +ExecCGI
+
+
+  # By default, only allow from localhost.  If you change this, please be
+  # advised that you should use SSL protection on any and all network
+  # connections that access this application in order to protect usernames and
+  # passwords.
+
+  # The rest of this file just tightens up security.
+  <Files ~ "\.conf$">
+    Order Deny,Allow
+    Deny from All
+  </Files>
+</Directory>
+
+<Directory WORKING_DIR/users>
+  Order Deny,Allow
+  Deny from All
+</Directory>
+
+<Directory WORKING_DIR/bin>
+  Order Deny,Allow
+  Deny from All
+</Directory>
+
+<Directory WORKING_DIR/utils>
+  Order Deny,Allow
+  Deny from All
+</Directory>
+
+<Directory WORKING_DIR/spool>
+  Order Deny,Allow
+  Deny from All
+</Directory>
+
+<Directory WORKING_DIR/templates>
+  Order Deny,Allow
+  Deny from All
+</Directory>
+
+<Directory WORKING_DIR/LedgerSMB>
+  Order Deny,Allow
+  Deny from All
+</Directory>

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.