httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1691920 - in /httpd/test/mod_h2/trunk: Makefile.am conf/php-fpm.conf conf/sites/test.example.org.conf configure.ac htdocs/test.example.org/info.php php-fpm/ php-fpm/php-fpm.conf php-fpm/www.conf
Date Mon, 20 Jul 2015 12:14:31 GMT
Author: icing
Date: Mon Jul 20 12:14:31 2015
New Revision: 1691920

URL: http://svn.apache.org/r1691920
Log:
test setup for mod_proxy_fcgi interactions

Added:
    httpd/test/mod_h2/trunk/conf/php-fpm.conf
    httpd/test/mod_h2/trunk/php-fpm/
    httpd/test/mod_h2/trunk/php-fpm/php-fpm.conf
    httpd/test/mod_h2/trunk/php-fpm/www.conf
Modified:
    httpd/test/mod_h2/trunk/Makefile.am
    httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
    httpd/test/mod_h2/trunk/configure.ac
    httpd/test/mod_h2/trunk/htdocs/test.example.org/info.php

Modified: httpd/test/mod_h2/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/Makefile.am?rev=1691920&r1=1691919&r2=1691920&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/Makefile.am Mon Jul 20 12:14:31 2015
@@ -48,6 +48,12 @@ CURL         = $(prefix)/bin/curl
 NGHTTP       = @NGHTTP@
 H2LOAD       = @H2LOAD@
 
+TEST_DEP     = @TEST_DEP@
+
+PHP_FPM      = @PHP_FPM@
+PHP_FPM_PID  = gen/php-fpm/php-fpm.pid
+
+
 .PHONY: clean test loadtest start stop restart install-client install-nghttp2
 
 
@@ -64,6 +70,8 @@ distdir:
 
 start: $(SERVER_DIR)/.test-setup
 	$(APACHECTL) -k start
+	@-test -x "$(PHP_FPM)" && test ! -f "$(PHP_FPM_PID)" && \
+        "$(PHP_FPM)" --prefix gen/php-fpm && echo "php-fpm started"
 
 start-debug: $(SERVER_DIR)/.test-setup
 	$(APACHECTL) -k start -X
@@ -77,8 +85,12 @@ restart: $(SERVER_DIR)/.test-setup
 	@while true; do sleep 1; pkill -1 -U $(USER) httpd; test "$$?" != "0" && break;
done   
 	@echo done.
 	$(APACHECTL) -k restart
+	@-test -f "$(PHP_FPM_PID)" && kill "$$( cat $(PHP_FPM_PID) )" || echo "php-fpm not
running"
+	@-test -x "$(PHP_FPM)" && test ! -f "$(PHP_FPM_PID)" && \
+        "$(PHP_FPM)" --prefix gen/php-fpm && echo "php-fpm started"
 
 stop:
+	@-test -f "$(PHP_FPM_PID)" && kill "$$( cat $(PHP_FPM_PID) )" || echo "php-fpm not
running"
 	$(APACHECTL) -k stop
 
 install-nghttp2:
@@ -195,10 +207,10 @@ SETUP_FILES = conf/*.conf \
     bin/*
 
 $(SERVER_DIR)/.testdocs-setup: \
-	conf/* htdocs/*/*
+	conf/* htdocs/*/* $(TEST_DEP)
 	@echo -n setup htdocs locally...
 	@mkdir -p $(SERVER_DIR)/htdocs
-	@cp -r htdocs/test.example.org $(SERVER_DIR)/htdocs/test.example.org
+	@cp -r htdocs/test.example.org $(SERVER_DIR)/htdocs/
 	@chmod +x $$(find $(SERVER_DIR)/htdocs/test.example.org/ -name "*.py" )
 	@echo done.
 	@touch $(SERVER_DIR)/.testdocs-setup
@@ -312,6 +324,21 @@ $(SERVER_DIR)/conf/ssl/noh2.example.org.
 		-extfile conf/ssl/extensions.conf -extensions ssl_client < conf/ssl/noh2.example.org.x509.input
 
 ################################################################################
+# php-fpm configuration
+#
+$(GEN)/php-fpm/.setup: \
+    php-fpm/*.*
+	@mkdir -p $(GEN)/php-fpm $(GEN)/php-fpm/etc $(GEN)/php-fpm/logs
+	@cp php-fpm/php-fpm.conf $(GEN)/php-fpm/etc
+	@sed -e "s,SUBST_SERVER_ROOT_SUBST,$(SERVER_DIR),g" \
+        -e "s,SUBST_SERVER_NAME_SUBST,@SERVER_NAME@,g" \
+        -e "s,SUBST_PORT_HTTP_SUBST,$(HTTP_PORT),g" \
+        -e "s,SUBST_PORT_HTTPS_SUBST,$(HTTPS_PORT),g" \
+        -e "s,SUBST_PHP_CGI_SUBST,@PHPCGI@,g" \
+        < php-fpm/www.conf > $(GEN)/php-fpm/www.conf
+
+
+################################################################################
 # Install the local curl
 #
 $(SERVER_DIR)/.curl-installed:

Added: httpd/test/mod_h2/trunk/conf/php-fpm.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/php-fpm.conf?rev=1691920&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/conf/php-fpm.conf (added)
+++ httpd/test/mod_h2/trunk/conf/php-fpm.conf Mon Jul 20 12:14:31 2015
@@ -0,0 +1,130 @@
+;;;;;;;;;;;;;;;;;;;;;
+; FPM Configuration ;
+;;;;;;;;;;;;;;;;;;;;;
+
+; All relative paths in this configuration file are relative to PHP's install
+; prefix (/usr). This prefix can be dynamically changed by using the
+; '-p' argument from the command line.
+
+; Include one or more files. If glob(3) exists, it is used to include a bunch of
+; files from a glob(3) pattern. This directive can be used everywhere in the
+; file.
+; Relative path can also be used. They will be prefixed by:
+;  - the global prefix if it's been set (-p argument)
+;  - /usr otherwise
+;include=/etc/php5/fpm/*.conf
+
+;;;;;;;;;;;;;;;;;;
+; Global Options ;
+;;;;;;;;;;;;;;;;;;
+
+[global]
+; Pid file
+; Note: the default prefix is /var
+; Default Value: none
+pid = /var/run/php5-fpm.pid
+
+; Error log file
+; If it's set to "syslog", log is sent to syslogd instead of being written
+; in a local file.
+; Note: the default prefix is /var
+; Default Value: log/php-fpm.log
+error_log = /var/log/php5-fpm.log
+
+; syslog_facility is used to specify what type of program is logging the
+; message. This lets syslogd specify that messages from different facilities
+; will be handled differently.
+; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
+; Default Value: daemon
+;syslog.facility = daemon
+
+; syslog_ident is prepended to every message. If you have multiple FPM
+; instances running on the same server, you can change the default value
+; which must suit common needs.
+; Default Value: php-fpm
+;syslog.ident = php-fpm
+
+; Log level
+; Possible Values: alert, error, warning, notice, debug
+; Default Value: notice
+;log_level = notice
+
+; If this number of child processes exit with SIGSEGV or SIGBUS within the time
+; interval set by emergency_restart_interval then FPM will restart. A value
+; of '0' means 'Off'.
+; Default Value: 0
+;emergency_restart_threshold = 0
+
+; Interval of time used by emergency_restart_interval to determine when 
+; a graceful restart will be initiated.  This can be useful to work around
+; accidental corruptions in an accelerator's shared memory.
+; Available Units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;emergency_restart_interval = 0
+
+; Time limit for child processes to wait for a reaction on signals from master.
+; Available units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;process_control_timeout = 0
+
+; The maximum number of processes FPM will fork. This has been design to control
+; the global number of processes when using dynamic PM within a lot of pools.
+; Use it with caution.
+; Note: A value of 0 indicates no limit
+; Default Value: 0
+; process.max = 128
+
+; Specify the nice(2) priority to apply to the master process (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool process will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
+; Default Value: yes
+;daemonize = yes
+ 
+; Set open file descriptor rlimit for the master process.
+; Default Value: system defined value
+;rlimit_files = 1024
+ 
+; Set max core size rlimit for the master process.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Specify the event mechanism FPM will use. The following is available:
+; - select     (any POSIX os)
+; - poll       (any POSIX os)
+; - epoll      (linux >= 2.5.44)
+; - kqueue     (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
+; - /dev/poll  (Solaris >= 7)
+; - port       (Solaris >= 10)
+; Default Value: not set (auto detection)
+;events.mechanism = epoll
+
+; When FPM is build with systemd integration, specify the interval,
+; in second, between health report notification to systemd.
+; Set to 0 to disable.
+; Available Units: s(econds), m(inutes), h(ours)
+; Default Unit: seconds
+; Default value: 10
+;systemd_interval = 10
+
+;;;;;;;;;;;;;;;;;;;;
+; Pool Definitions ; 
+;;;;;;;;;;;;;;;;;;;;
+
+; Multiple pools of child processes may be started with different listening
+; ports and different management options.  The name of the pool will be
+; used in logs and stats. There is no limitation on the number of pools which
+; FPM can handle. Your system will tell you anyway :)
+
+; To configure the pools it is recommended to have one .conf file per
+; pool in the following directory:
+include=/etc/php5/fpm/pool.d/*.conf
+

Modified: httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf?rev=1691920&r1=1691919&r2=1691920&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf (original)
+++ httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf Mon Jul 20 12:14:31 2015
@@ -66,6 +66,13 @@
     <Location "/server-status">
         SetHandler server-status
     </Location>
+
+    <IfModule proxy_fcgi_module>
+        <FilesMatch "\.php$">
+            SetHandler "proxy:unix:SUBST_SERVER_ROOT_SUBST/php-fpm.sock|fcgi://localhost/"
+        </FilesMatch>
+    </IfModule>
+
 </VirtualHost>
 
 

Modified: httpd/test/mod_h2/trunk/configure.ac
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/configure.ac?rev=1691920&r1=1691919&r2=1691920&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/configure.ac (original)
+++ httpd/test/mod_h2/trunk/configure.ac Mon Jul 20 12:14:31 2015
@@ -117,6 +117,7 @@ fi
 
 INSTALL_DEP=""
 INSTALL_ADDITIONAL=""
+TEST_DEP=""
 
 ################################################################################
 # curl 
@@ -282,6 +283,21 @@ fi
 INSTALL_ADDITIONAL="${INSTALL_ADDITIONAL# }"
 
 ################################################################################
+# php stuff 
+################################################################################
+
+AC_PATH_PROG([PHP_FPM], [php-fpm])
+if test "x${PHP_FPM}" = "x"; then
+    AC_PATH_PROG([PHP_FPM], [php5-fpm])
+fi
+if test "x${PHP_FPM}" != "x"; then
+    TEST_DEP="$TEST_DEP \$(GEN)/php-fpm/.setup"
+else
+    AC_MSG_NOTICE([no suitable php-fpm found])
+fi
+
+
+################################################################################
 # generate files 
 ################################################################################
 
@@ -309,6 +325,8 @@ AC_SUBST(LIBEV_VERSION)
 AC_SUBST(LIBEVENT_VERSION)
 AC_SUBST(ZLIB_VERSION)
 AC_SUBST(INSTALL_DEP)
+AC_SUBST(PHP_FPM)
+AC_SUBST(TEST_DEP)
 
 AC_CONFIG_FILES([
     Makefile

Modified: httpd/test/mod_h2/trunk/htdocs/test.example.org/info.php
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/htdocs/test.example.org/info.php?rev=1691920&r1=1691919&r2=1691920&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/htdocs/test.example.org/info.php (original)
+++ httpd/test/mod_h2/trunk/htdocs/test.example.org/info.php Mon Jul 20 12:14:31 2015
@@ -1,3 +1,4 @@
 <?php
+    date_default_timezone_set( 'Europe/Berlin' );
     phpinfo();
 ?>
\ No newline at end of file

Added: httpd/test/mod_h2/trunk/php-fpm/php-fpm.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/php-fpm/php-fpm.conf?rev=1691920&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/php-fpm/php-fpm.conf (added)
+++ httpd/test/mod_h2/trunk/php-fpm/php-fpm.conf Mon Jul 20 12:14:31 2015
@@ -0,0 +1,16 @@
+;;;;;;;;;;;;;;;;;;;;;
+; FPM Configuration ;
+;;;;;;;;;;;;;;;;;;;;;
+
+[global]
+pid = php-fpm.pid
+
+error_log = logs/php-fpm.log
+log_level = notice
+
+;;;;;;;;;;;;;;;;;;;;
+; Pool Definitions ; 
+;;;;;;;;;;;;;;;;;;;;
+
+include=www.conf
+

Added: httpd/test/mod_h2/trunk/php-fpm/www.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/php-fpm/www.conf?rev=1691920&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/php-fpm/www.conf (added)
+++ httpd/test/mod_h2/trunk/php-fpm/www.conf Mon Jul 20 12:14:31 2015
@@ -0,0 +1,14 @@
+[www]
+
+;user = enlightened
+;group = enlightened
+
+listen = SUBST_SERVER_ROOT_SUBST/php-fpm.sock
+
+; process manager
+pm = ondemand
+pm.max_children = 4
+
+catch_workers_output = yes
+php_admin_flag[log_errors] = on
+



Mime
View raw message