Line 1: |
Line 1: |
| + | {{Warning box|This page is for SME v9 and is now deprecated and for reference only. |
| + | v10 uses systemd. See https://wiki.koozali.org/PHP |
| + | if you search to write your own contrib using php-fpm follow [[Building_Your_Contrib#PHP-FPM]]}} |
| + | |
| {{Languages}} | | {{Languages}} |
| <!-- here we define the contrib name variable --> | | <!-- here we define the contrib name variable --> |
Line 13: |
Line 17: |
| |licence= | | |licence= |
| |url= https://wiki.contribs.org | | |url= https://wiki.contribs.org |
− | |category= Category you want | + | |category= |
| |tags=php,fpm | | |tags=php,fpm |
| }} | | }} |
Line 22: |
Line 26: |
| | | |
| === Version === | | === Version === |
| + | |
| + | {{Warning box|DO NOT USE ON v10. |
| + | SME v9 is no longer supported. v10 has php-fpm built in. |
| + | Please refer to this page for more information.<br> |
| + | https://wiki.koozali.org/PHP}} |
| + | |
| + | |
| <!-- keep this first element as is, you can add some if needed --> | | <!-- keep this first element as is, you can add some if needed --> |
− | {{#smeversion: {{#var:smecontribname}} }} | + | {{#smeversion: smeserver-php-fpm }} |
− | {{#smeversion: {{#var:contribname}} }}
| + | |
| | | |
| === Description === | | === Description === |
Line 40: |
Line 51: |
| signal-event webapps-update | | signal-event webapps-update |
| service php-fpm start | | service php-fpm start |
− | service php-56 start | + | service php56-php-fpm start |
− | service php-70 start | + | service php70-php-fpm start |
− | service php-71 start | + | service php71-php-fpm start |
− | service php-72 start | + | service php72-php-fpm start |
− | service php-73 start | + | service php73-php-fpm start |
| | | |
| </syntaxhighlight> | | </syntaxhighlight> |
Line 262: |
Line 273: |
| $php =<<'_EOF'; | | $php =<<'_EOF'; |
| <FilesMatch \.php$> | | <FilesMatch \.php$> |
− | SetHannextclouder "proxy:unix:/var/run/php-fpm/php71-nextcloud.sock|fcgi://localhost" | + | SetHandler "proxy:unix:/var/run/php-fpm/php71-nextcloud.sock|fcgi://localhost" |
| </FilesMatch> | | </FilesMatch> |
| _EOF | | _EOF |
| } | | } |
| + | |
| + | my $config =<<_EOF; |
| + | <Directory "/usr/share/nextcloud"> |
| + | Options +FollowSymLinks |
| + | AllowOverride All |
| + | $php |
| + | order deny,allow |
| + | deny from all |
| + | allow from $allow |
| + | $auth |
| + | |
| + | <IfModule mod_dav.c> |
| + | Dav off |
| + | </IfModule> |
| + | |
| + | SetEnv HOME /usr/share/nextcloud |
| + | SetEnv HTTP_HOME /usr/share/nextcloud |
| + | SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=\$1 |
| + | </Directory> |
| + | |
| + | <Directory "/home/e-smith/files/nextcloud/data/"> |
| + | # just in case if .htaccess gets disabled |
| + | deny from all |
| + | </Directory> |
| + | _EOF |
| + | |
| + | |
| + | $OUT .=<<"END" |
| + | # nextcloud Configuration |
| + | <IfModule mod_headers.c> |
| + | Header always set Strict-Transport-Security "max-age=15552000" |
| + | </IfModule> |
| + | $alias |
| + | |
| + | $config |
| + | |
| + | Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav |
| + | Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav |
| + | |
| + | |
| + | END |
| + | } |
| + | else{ |
| + | $OUT .= "# nextcloud is disabled\n"; |
| + | } |
| + | } |
| | | |
| </syntaxhighlight>Of course you will need to process both httpd.conf, php-fpm specific version and restart both httpd-e-smith and the php-fpm version you use. | | </syntaxhighlight>Of course you will need to process both httpd.conf, php-fpm specific version and restart both httpd-e-smith and the php-fpm version you use. |
| | | |
| You will also need specific code to create the destination directories for php usage : see /etc/e-smith/events/actions/php-pool-dirs from this contrib | | You will also need specific code to create the destination directories for php usage : see /etc/e-smith/events/actions/php-pool-dirs from this contrib |
| + | |
| + | {{Warning box|On initial installation, smeserver-php-fpm does not start php pools and signal-event webapps-update does only a reload which will not start stopped services. |
| + | So pay attention you need to start if not already started on initial install.}} |
| | | |
| === Create and use my own pool === | | === Create and use my own pool === |
Line 321: |
Line 381: |
| | | | | |
| |- | | |- |
− | |DisableFunctions | + | |DisabledFunctions |
− | |system,show_source, symlink,exec,dl,shell_exec,passthru,phpinfo,escapeshellarg,escapeshellcmd | + | |system,show_source,symlink,exec,dl,shell_exec,passthru,phpinfo,escapeshellarg,escapeshellcmd |
| | | | | |
| |- | | |- |
Line 341: |
Line 401: |
| | | | | |
| |} | | |} |
− | you will then need a httpd.conf template fragment to use your pool. | + | you will then need two httpd.conf custom template fragment to use your pool. You will need to change '''MYPOOL''' to what you want<syntaxhighlight lang="bash"> |
| + | mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/ |
| + | vim /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/98mypoolusage |
| + | </syntaxhighlight><syntaxhighlight lang="perl"> |
| + | <Directory /home/e-smith/files/ibays/test/html> |
| + | SSLRequireSSL |
| + | Options None |
| + | Options +Indexes |
| + | Options +FollowSymLinks |
| + | DirectoryIndex index.php index.shtml index.htm index.html |
| + | AddHandler phpMYPOOL-fastcgi .php |
| + | AllowOverride All |
| + | order deny,allow |
| + | deny from all |
| + | allow from all |
| + | </Directory> |
| + | |
| + | </syntaxhighlight>then just do signal-event webapps-update |
| | | |
| === Uninstall === | | === Uninstall === |
Line 359: |
Line 436: |
| | | |
| <!-- list of category you want to see this page in --> | | <!-- list of category you want to see this page in --> |
− | [[Category: Contrib]] | + | [[Category: Deprecated_Contrib]] |
| <!-- Please keep there the template revision number as is --> | | <!-- Please keep there the template revision number as is --> |