summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamil Kaminski <kylek389@gmail.com>2023-01-16 15:24:31 -0600
committerKamil Kaminski <kylek389@gmail.com>2023-01-16 15:24:31 -0600
commit9f2448ea8b2528dd79108242ac46f011eba80c82 (patch)
treeea9d9f1884d2895873866fd6b363cdeb3ddd6bbb
parentf42a910e3304e22255d1ad3dde1cb1a0de19e462 (diff)
downloadconfigs-9f2448ea8b2528dd79108242ac46f011eba80c82.tar.gz
configs-9f2448ea8b2528dd79108242ac46f011eba80c82.tar.bz2
configs-9f2448ea8b2528dd79108242ac46f011eba80c82.zip
tiny php fastcgi and fpm php5 configsHEADmaster
-rw-r--r--tiny/etc/apache2/conf-available/php5_cgi.conf17
-rw-r--r--tiny/etc/apache2/conf-available/php5_fastcgi.conf32
-rw-r--r--tiny/etc/apache2/conf-available/php5_fastcgi_nonwrappercall.conf29
-rw-r--r--tiny/etc/apache2/conf-available/php5_fcgid.conf42
-rw-r--r--tiny/etc/apache2/conf-available/php5_fpm.conf8
5 files changed, 128 insertions, 0 deletions
diff --git a/tiny/etc/apache2/conf-available/php5_cgi.conf b/tiny/etc/apache2/conf-available/php5_cgi.conf
new file mode 100644
index 0000000..0d75024
--- /dev/null
+++ b/tiny/etc/apache2/conf-available/php5_cgi.conf
@@ -0,0 +1,17 @@
+# i don't think mod_cgi is meant for handling php, i fucking really dunno after shitload of time,
+# but this was done for fun, fuck you
+#
+# maybe this only works for shebanged scripts e.g. pl py?
+
+<IfModule dir_module>
+ <IfModule cgi_module>
+# when below was on, http response header was "Content-Type: application/x-httpd-php" and prompted firefox to download the file
+# AddType application/x-httpd-php .php
+ AddHandler cgi-script .php
+ DirectoryIndex index.php index.html
+ <FilesMatch "\.php$">
+ SetHandler cgi-script
+ </FilesMatch>
+ </IfModule>
+</IfModule>
+
diff --git a/tiny/etc/apache2/conf-available/php5_fastcgi.conf b/tiny/etc/apache2/conf-available/php5_fastcgi.conf
new file mode 100644
index 0000000..982974a
--- /dev/null
+++ b/tiny/etc/apache2/conf-available/php5_fastcgi.conf
@@ -0,0 +1,32 @@
+#
+# with FastCgiWrapper I'm running into weird perm issue
+# -> might need to look at suexec?
+#
+
+<IfModule dir_module>
+ <IfModule fastcgi_module>
+ DirectoryIndex index.php index.html
+ AddType application/x-httpd-php .php
+ AddHandler fastcgi-script .php
+ FastCgiWrapper /srv/http/cgi-bin/fastcgi-php-wrapper
+ <Location /cgi-bin/>
+ Options +FollowSymLinks +ExecCGI
+ </Location>
+ <FilesMatch "\.php$">
+ Options +ExecCGI
+ </FilesMatch>
+ </IfModule>
+</IfModule>
+
+#
+# # chown -R http.http /srv/http/cgi-bin/
+
+# cat /srv/http/cgi-bin/fastcgi-php-wrapper
+#
+# #!/usr/bin/env bash
+#
+# PHP_FCGI_MAX_REQUESTS=1000
+# export PHP_FCGI_MAX_REQUESTS
+#
+# exec /usr/bin/php-cgi
+
diff --git a/tiny/etc/apache2/conf-available/php5_fastcgi_nonwrappercall.conf b/tiny/etc/apache2/conf-available/php5_fastcgi_nonwrappercall.conf
new file mode 100644
index 0000000..b94993d
--- /dev/null
+++ b/tiny/etc/apache2/conf-available/php5_fastcgi_nonwrappercall.conf
@@ -0,0 +1,29 @@
+<IfModule fastcgi_module>
+ AddHandler php-fastcgi .php
+ AddType application/x-httpd-php .php
+ DirectoryIndex index.php index.html
+ Action php-fastcgi /cgi-bin/fastcgi-php-wrapper
+ <Location /cgi-bin/>
+ # below SetHandler is not needed but nice for shebanged .sh or .pl scripts
+ SetHandler cgi-script
+ Options +FollowSymLinks +ExecCGI
+ </Location>
+
+# <FilesMatch "\.php$">
+# # with this i enable php via fastcgi server wide, might want to narrow it down to specific vhosts
+# # SetHandler is am override, redundant here since AddHandler already registered .php extension
+# SetHandler php-fastcgi
+# # below probably redundant since it looks like only the wrapper needs this bit ON
+# Options +ExecCGI
+# </FilesMatch>
+
+</IfModule>
+
+
+# almost worked, blew up on:
+#
+# mod_fastcgi: error reading data from FastCGI server
+# [Sun Nov 30 01:00:59.663064 2014] [core:error] [pid 11886] [client ::1:46027] End of script output before headers: php-fastcgi-wrapper
+#
+# what a fucking joke
+
diff --git a/tiny/etc/apache2/conf-available/php5_fcgid.conf b/tiny/etc/apache2/conf-available/php5_fcgid.conf
new file mode 100644
index 0000000..a3bac7b
--- /dev/null
+++ b/tiny/etc/apache2/conf-available/php5_fcgid.conf
@@ -0,0 +1,42 @@
+#
+# (1) the /cgi-bin needs its uid and gid to be owned by http! otherwise infinite strange loop occurs
+# (2) the following error: mod_fcgid: error reading data from FastCGI server, End of script output before headers: hello.cgi
+# -> it can be fixed by changing back to "AddHandler cgi-script .cgi", but I don't want that, I want fastcgi
+# -> the "End of script output before headers: fastcgi-php-wrapper" actually happened when fastcgi-php-wrapper was using 'php-cgi'
+# that did not exist on my system, therefore that wrapper script ENDED/PRINTED (nothing) before HEADERS (because headers never were sent back!)
+# -> this might mean that mod_fcgid/mod_fastcgi need wrappers for all file extensions, e.g. spawn /bin/bash for .sh, spawn php-cgi for .php, etc.
+#
+# - look like there are 2 ways to spawn wrappers, (1) via FcgidWrapper or FastCgiWrapper and (2) via new 'AddHandler' and 'Action'
+# - to verify fastcgi is used use phpinfo() and look for "Server API = CGI/FastCGI"
+# - php_admin_value directive is not available in cgi mode!
+#
+
+<IfModule fcgid_module>
+ AddHandler php-fcgid .php
+ AddType application/x-httpd-php .php
+ DirectoryIndex index.php index.html
+ Action php-fcgid /cgi-bin/fastcgi-php-wrapper
+ <Location /cgi-bin/>
+ # below SetHandler is not needed but nice for shebanged .sh or .pl scripts
+ SetHandler cgi-script
+ Options +FollowSymLinks +ExecCGI
+ </Location>
+
+# <FilesMatch "\.php$">
+# # with this i enable php via fastcgi server wide, might want to narrow it down to specific vhosts
+# # SetHandler is am override, redundant here since AddHandler already registered .php extension
+# SetHandler php-fcgid
+# # below probably redundant since it looks like only the wrapper needs this bit ON
+# Options +ExecCGI
+# </FilesMatch>
+
+</IfModule>
+
+
+# almost worked, blew up on:
+#
+# mod_fcgid: error reading data from FastCGI server
+# [Sun Nov 30 01:00:59.663064 2014] [core:error] [pid 11886] [client ::1:46027] End of script output before headers: php-fcgid-wrapper
+#
+# what a fucking joke
+
diff --git a/tiny/etc/apache2/conf-available/php5_fpm.conf b/tiny/etc/apache2/conf-available/php5_fpm.conf
new file mode 100644
index 0000000..1ebf27d
--- /dev/null
+++ b/tiny/etc/apache2/conf-available/php5_fpm.conf
@@ -0,0 +1,8 @@
+AddType application/x-httpd-php .php
+<FilesMatch \.php$>
+ SetHandler fcgi://localhost:9011/srv/http/
+</FilesMatch>
+<IfModule dir_module>
+ DirectoryIndex index.php index.html
+</IfModule>
+