initial commit of file from CVS for smeserver-php on Sat Mar 23 15:31:58 AEDT 2024

master
Trevor Batley 2 months ago
parent ba0cd7fb70
commit e590ff9746

4
.gitignore vendored

@ -0,0 +1,4 @@
*.rpm
*.log
*spec-20*
*.tar.gz

@ -0,0 +1,21 @@
# Makefile for source rpm: smeserver-php
# $Id: Makefile,v 1.1 2020/01/28 19:39:21 jpp Exp $
NAME := smeserver-php
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

@ -1,3 +1,18 @@
# smeserver-php
# <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> smeserver-php
SMEServer Koozali developed git repo for smeserver-php smeserver
SMEServer Koozali developed git repo for smeserver-php smeserver
## Wiki
<br />https://wiki.koozali.org/PHP
<br />https://wiki.koozali.org/PHP/fr
<br />https://wiki.koozali.org/Php-fpm
<br />https://wiki.koozali.org/PHP_Software_Collections
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-php&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
*Once it has been checked, then this comment will be deleted*
<br />

@ -0,0 +1 @@
sme10

@ -0,0 +1,140 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
my $ver; my $service; my $file; my $event;
#old e-smith-php
foreach $file (qw(/etc/php.ini
/opt/remi/php55/root/etc/php.ini
/opt/remi/php56/root/etc/php.ini
/etc/opt/remi/php70/php.ini
/etc/opt/remi/php71/php.ini
/etc/opt/remi/php72/php.ini
/etc/opt/remi/php73/php.ini
/etc/opt/remi/php74/php.ini
/etc/opt/remi/php80/php.ini
/etc/opt/remi/php81/php.ini
/etc/opt/remi/php82/php.ini
/etc/opt/remi/php83/php.ini
)){
templates2events($file, qw(
console-save
bootstrap-console-save
webapps-update
smeserver-php-update
));
}
templates2events("/etc/rsyslog.conf","smeserver-php-update");
safe_symlink("restart", "root/etc/e-smith/events/smeserver-php-update/services2adjust/rsyslog");
#new php-fpm
foreach $service (qw(php-fpm)){
foreach $event (qw(webapps-update ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers )){
safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/$service");
}
$event="smeserver-php-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/$service");
}
for $event (qw(smeserver-php-update webapps-update)){
$service="httpd-e-smith";
#when moved to systemd could become a reload-or-restart
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/$service");
$file="/etc/httpd/conf/httpd.conf";
templates2events($file, $event);
}
foreach $ver (qw( 55 56 70 71 72 73 74 80 81 82 83)){
foreach $service ( "php$ver-php-fpm" ){
foreach $event (qw(webapps-update ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers )){
safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/$service");
}
$event="smeserver-php-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/$service");
}
}
#general php-fpm
foreach $file (qw( /etc/php-fpm.conf
/etc/php-fpm.d/www.conf
/etc/php-fpm.d/ibays.conf
/etc/php-fpm.d/custom.conf)){
templates2events($file, qw(webapps-update bootstrap-console-save ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update));
safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin");
}
safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates/etc/php.ini/template-begin");
foreach $file (qw( /etc/sysconfig/php-fpm
/etc/logrotate.d/php-fpm
/etc/logrotate.d/php55-php-fpm
/etc/logrotate.d/php56-php-fpm
/etc/logrotate.d/php70-php-fpm
/etc/logrotate.d/php70-php-fpm
/etc/logrotate.d/php71-php-fpm
/etc/logrotate.d/php72-php-fpm
/etc/logrotate.d/php73-php-fpm
/etc/logrotate.d/php74-php-fpm
/etc/logrotate.d/php80-php-fpm
/etc/logrotate.d/php81-php-fpm
/etc/logrotate.d/php82-php-fpm
/etc/logrotate.d/php83-php-fpm
)){
templates2events($file, qw(webapps-update bootstrap-console-save smeserver-php-update));
}
#php5*
foreach $ver (qw( 55 56 )){
foreach $file ( "/opt/remi/php$ver/root/etc/php-fpm.conf",
"/opt/remi/php$ver/root/etc/php-fpm.d/www.conf",
"/opt/remi/php$ver/root/etc/php-fpm.d/ibays.conf",
"/opt/remi/php$ver/root/etc/php-fpm.d/custom.conf" ){
templates2events($file, qw(webapps-update bootstrap-console-save ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update));
#safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin");
}
foreach $file ( "/opt/remi/php$ver/root/etc/sysconfig/php-fpm" ){
templates2events($file, qw(webapps-update bootstrap-console-save));
}
}
#php7*
foreach $ver (qw( 70 71 72 73 74 80 81 82 83)){
foreach $file ( "/etc/opt/remi/php$ver/php-fpm.conf",
"/etc/opt/remi/php$ver/php-fpm.d/www.conf",
"/etc/opt/remi/php$ver/php-fpm.d/ibays.conf",
"/etc/opt/remi/php$ver/php-fpm.d/custom.conf" ){
templates2events($file, qw(webapps-update bootstrap-console-save ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update));
#safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin");
}
foreach $file ( "/etc/opt/remi/php$ver/sysconfig/php-fpm" ){
templates2events($file, qw(webapps-update bootstrap-console-save smeserver-php-update));
}
}
safe_symlink('/etc/e-smith/templates-default/template-begin-shell', 'root/etc/e-smith/templates/etc/cron.daily/tmpwatch-php-fpm/template-begin');
foreach my $event (qw( ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update post-install post-upgrade)) {
event_link( "php-pool-dirs", $event, "90");
}
foreach my $event (qw( ibay-create ibay-delete ibay-modify ibay-modify-files ibay-modify-servers smeserver-php-update console-save post-upgrade post-install )) {
event_link( "php-pool-customs", $event, "90");
}
# systemd units
#foreach $ver (qw( 55 56 70 71 72 73 74 )){
#$service = "php$ver-php-fpm.service";
#safe_symlink("../$service", "root/usr/lib/systemd/system/multi-user.target.wants/$service");
#safe_symlink("../$service", "root/usr/lib/systemd/system/sme-server.target.wants/$service");
#}
#$service = "php-fpm.service";
#safe_symlink("../$service", "root/usr/lib/systemd/system/multi-user.target.wants/$service");
#safe_symlink("../$service", "root/usr/lib/systemd/system/sme-server.target.wants/$service");
#webapps
$event = 'webapps-update';
templates2events("/etc/my.cnf", $event);
safe_symlink("start", "root/etc/e-smith/events/$event/services2adjust/mysql.init");

@ -0,0 +1,2 @@
[ -d /var/lib/php ] && /usr/sbin/tmpwatch --nodirs -f 8 /var/lib/php
[ -d /var/cache/e-smith/files/ibays ] && /usr/sbin/tmpwatch --nodirs -f 8 /var/cache/e-smith/files/ibays

@ -0,0 +1,36 @@
{
my %old2new = (
UpMaxFileSize => "UploadMaxFilesize",
PHPUploadMaxFilesize => "UploadMaxFilesize",
PHPPostMaxSize => "PostMaxSize",
PHPMaxExecutionTime => "MaxExecutionTime",
PHPMemoryLimit => "MemoryLimit",
PHPAllowUrlfOpen => "AllowUrlFopen",
PHPFileUpload => "FileUpload",
PHPDisabledFunctions => "DisabledFunctions",
PHPAutoPrependFile => "AutoPrependFile",
PHPCustomPool => "CustomPool",
PHPMaxInputTime => "MaxInputTime",
MaxExecTime => "MaxExecutionTime",
);
foreach my $ibay ($DB->get_all_by_prop(type => 'ibay'))
{
for my $key (keys %old2new)
{
next unless (defined $ibay->prop($key));
my $value = $DB->get_prop_and_delete($ibay->key, $key);
next if (defined $ibay->prop($old2new{$key}) );
$DB->set_prop($ibay->key, $old2new{$key}, $value);
}
for my $key (qw(MemoryLimit UploadMaxFilesize PostMaxSize MaxExecutionTime))
{
next unless (defined $ibay->prop($key));
my $value = $DB->get_prop_and_delete($ibay->key, $key) if ($ibay->prop($key) eq "disabled");
next unless $key eq "MaxExecutionTime";
$DB->set_prop($ibay->key,MaxExecutionTime,0) if ($ibay->prop($key) eq "unlimited");
}
}
}

@ -0,0 +1,6 @@
{
$DB->get_prop_and_delete ('php', 'MagicQuotes');
}

@ -0,0 +1,28 @@
#!/usr/bin/perl -w
use strict;
use warnings;
use File::Path qw(make_path remove_tree);
use esmith::ConfigDB;
use esmith::util;
my $pool_db = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php');
foreach my $pool ($pool_db->get_all_by_prop(type => 'pool')){
my $status = $pool->prop('status') || 'enabled';
next unless ($status eq 'enabled');
my $key = $pool->key;
my @dirs = ( "/var/log/php/$key",
"/var/lib/php/$key/session",
"/var/lib/php/$key/wsdlcache",
"/var/lib/php/$key/opcache",
"/var/lib/php/$key/tmp" );
for (@dirs){
esmith::util::chownFile("root", "www", $_) if -e $_;
make_path( $_, {
owner => 'root',
group => 'www'
}) unless -e $_;
}
chmod 0770, @dirs;
}

@ -0,0 +1,52 @@
#!/usr/bin/perl -w
use strict;
use warnings;
use esmith::AccountsDB;
use File::Path qw(make_path remove_tree);
use esmith::util;
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n";
my $event = shift;
my $apool = shift;
my @pools = (defined $apool && $a->get($apool) ) ? map { $a->get($_); } $apool : ( $a->get_all_by_prop(type => "ibay" ) , $a->get_all_by_prop(type => "share" ));# unless $acc;
foreach my $acc (@pools){
my $pool = $acc->key;
my $type = $acc->prop('type');
my $dyn = 'disabled';
if ( $type eq "ibay") {
$dyn = $acc->prop('CgiBin') || 'disabled';
}
else {
$dyn = $acc->prop('DynamicContent') || 'disabled';
}
if ($dyn =~ m/^enabled|on|1|yes$/ && $event ne 'share-delete' && $event ne 'ibay-delete'){
my @dirs = ( "/var/log/php/$pool",
"/var/lib/php/$pool/session",
"/var/lib/php/$pool/wsdlcache",
"/var/lib/php/$pool/opcache",
"/var/lib/php/$pool/tmp" );
# create dir if does not exist; set owner and group if create it
# does not change ownership if folder already exists
for (@dirs){
esmith::util::chownFile("root", "www", $_) if -e $_;
make_path( $_, {
owner => 'root',
group => 'www'
}) unless -e $_;
}
chmod 0770, @dirs;
}
}
if ( defined $event && defined $apool && ($event eq 'share-delete' || $event eq 'ibay-delete') ) {
my $acc = $a->get($apool);
die "$apool not found in the account database\n" unless $acc;
remove_tree( "/var/log/php/$apool",
"/var/lib/php/$apool" );
}

@ -0,0 +1,11 @@
;------------------------------------------------------------
; !!DO NOT MODIFY THIS FILE!!
;
; Manual changes will be lost when this file is regenerated.
;
; Please read the developer's guide, which is available
; at http://www.contribs.org/development/
;
; Copyright (C) 1999-2006 Mitel Networks Corporation
;------------------------------------------------------------

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.conf"
MORE_DATA={ PHP_VERSION => 70, FPM_POOL_DIR => "/etc/opt/remi/php70/php-fpm.d" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/custom.conf"
MORE_DATA={ PHP_VERSION => 70 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/ibays.conf"
MORE_DATA={ PHP_VERSION => 70 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/www.conf"
MORE_DATA={ PHP_VERSION => 70 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php.ini"
MORE_DATA={ PHP_VERSION => 70, INCLUDE_PATH => ".:/opt/remi/php70/root/usr/share/pear:/opt/remi/php70/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php70/root/usr/lib64/php/modules" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/sysconfig/php-fpm"
MORE_DATA={ PHP_VERSION => 70 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.conf"
MORE_DATA={ PHP_VERSION => 71, FPM_POOL_DIR => "/etc/opt/remi/php71/php-fpm.d" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/custom.conf"
MORE_DATA={ PHP_VERSION => 71 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/ibays.conf"
MORE_DATA={ PHP_VERSION => 71 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/www.conf"
MORE_DATA={ PHP_VERSION => 71 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php.ini"
MORE_DATA={ PHP_VERSION => 71, INCLUDE_PATH => ".:/opt/remi/php70/root/usr/share/pear:/opt/remi/php71/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php71/root/usr/lib64/php/modules" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/sysconfig/php-fpm"
MORE_DATA={ PHP_VERSION => 71 }

@ -0,0 +1,3 @@
TEMPLATE_PATH="/etc/php.ini"
MORE_DATA={ PHP_VERSION => 72, INCLUDE_PATH => ".:/opt/remi/php72/root/usr/share/pear:/opt/remi/php72/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php72/root/usr/lib64/php/modules" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php.ini"
MORE_DATA={ PHP_VERSION => 73, INCLUDE_PATH => ".:/opt/remi/php73/root/usr/share/pear:/opt/remi/php73/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php73/root/usr/lib64/php/modules" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php.ini"
MORE_DATA={ PHP_VERSION => 74, INCLUDE_PATH => ".:/opt/remi/php74/root/usr/share/pear:/opt/remi/php74/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php74/root/usr/lib64/php/modules" }

@ -0,0 +1 @@
MORE_DATA={ PHP_VERSION => 80, INCLUDE_PATH => ".:/opt/remi/php80/root/usr/share/pear:/opt/remi/php80/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php80/root/usr/lib64/php/modules" }

@ -0,0 +1 @@
MORE_DATA={ PHP_VERSION => 81, INCLUDE_PATH => ".:/opt/remi/php81/root/usr/share/pear:/opt/remi/php81/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php81/root/usr/lib64/php/modules" }

@ -0,0 +1 @@
MORE_DATA={ PHP_VERSION => 82, INCLUDE_PATH => ".:/opt/remi/php82/root/usr/share/pear:/opt/remi/php82/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php82/root/usr/lib64/php/modules" }

@ -0,0 +1 @@
MORE_DATA={ PHP_VERSION => 83, INCLUDE_PATH => ".:/opt/remi/php83/root/usr/share/pear:/opt/remi/php83/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php83/root/usr/lib64/php/modules" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.conf"
MORE_DATA={ PHP_VERSION => '', FPM_POOL_DIR => "/etc/php-fpm.d" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/custom.conf"
MORE_DATA={ PHP_VERSION => '' }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/ibays.conf"
MORE_DATA={ PHP_VERSION => '' }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/www.conf"
MORE_DATA={ PHP_VERSION => '' }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php.ini"
MORE_DATA={ PHP_VERSION => '', INCLUDE_PATH => ".:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php.ini"
MORE_DATA={ PHP_VERSION => 55, INCLUDE_PATH => ".:/opt/remi/php55/root/usr/share/pear:/opt/remi/php55/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php55/root/usr/lib64/php/modules" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.conf"
MORE_DATA={ PHP_VERSION => 56, FPM_POOL_DIR => "/opt/remi/php56/root/etc/php-fpm.d" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/custom.conf"
MORE_DATA={ PHP_VERSION => 56 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/ibays.conf"
MORE_DATA={ PHP_VERSION => 56 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php-fpm.d/www.conf"
MORE_DATA={ PHP_VERSION => 56 }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/php.ini"
MORE_DATA={ PHP_VERSION => 56, INCLUDE_PATH => ".:/opt/remi/php56/root/usr/share/pear:/opt/remi/php56/root/usr/share/php:/usr/share/php:/usr/share/pear", EXTENSION_DIR => "/opt/remi/php56/root/usr/lib64/php/modules" }

@ -0,0 +1,2 @@
TEMPLATE_PATH="/etc/sysconfig/php-fpm"
MORE_DATA={ PHP_VERSION => 56 }

@ -0,0 +1,8 @@
for VER in php php55 php56 php70 php71 php72 php73 php74 php80 php81 php82 php83; do
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/tmp
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/opcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/wsdlcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$VER/opcache
done

@ -0,0 +1,14 @@
{
use esmith::AccountsDB;
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n";
foreach my $ibay ($a->get_all_by_prop(type => 'ibay')){
next unless (($ibay->prop('CgiBin') || 'disabled') =~ m/^enabled|on|yes|1$/);
my $key = $ibay->key;
$OUT .=_EOF;
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/tmp
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/wsdlcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache
_EOF
}
}

@ -0,0 +1,14 @@
{
use esmith::AccountsDB;
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n";
foreach my $share ($a->get_all_by_prop(type => 'share')){
next unless (($share->prop('DynamicContent') || 'disabled') =~ m/^enabled|on|yes|1$/);
my $key = $share->key;
$OUT .=_EOF;
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/tmp
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/wsdlcache
/usr/sbin/tmpwatch -umc --nodirs -q 7d /var/lib/php/$key/opcache
_EOF
}
}

@ -0,0 +1,17 @@
{
$phpModule = $php{phpModule} || 'disabled';
# default we return with nothing activated
return "#PHP mod is disabled by default, please use PHP-fpm" unless (exists $php{status} and $php{status} eq "enabled" and $phpModule eq "enabled");
use esmith::php;
our $PHPVersion = PHPdefault(1);
my $phpMR = substr($PHPVersion,0,1) || '';
#php7 software collection libphp72.so
return "LoadModule php$\{phpMR\}_module modules/libphp$PHPVersion.so\n" if (-r "/usr/lib64/httpd/modules/libphp$PHPVersion.so");
#php5 software collection libphp56-php5.so
return "LoadModule php$\{phpMR\}_module modules/libphp$PHPVersion-php$phpMR.so\n" if (-r "/usr/lib64/httpd/modules/libphp$PHPVersion-php$phpMR.so");
# else we default to base php
return "LoadModule php5_module modules/libphp5.so" if ( -r "/usr/lib/httpd/modules/libphp5.so" ||
-r "/usr/lib64/httpd/modules/libphp5.so" );
return "#no PHP module found";
}

@ -0,0 +1,6 @@
{
$fastcgi_mod = 'mod_proxy_fcgi';
$OUT .=<<_EOF;
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
_EOF
}

@ -0,0 +1,10 @@
{
return "" unless (defined $php{'status'} and $php{'status'} eq 'enabled');
my @directives = qw(
index.htm index.html index.shtml index.cgi
index.php index.phtml
);
$OUT = "DirectoryIndex @directives\n";
}

@ -0,0 +1,15 @@
{
return "" unless (exists $php{status} and $php{status} eq "enabled");
$OUT =<<HERE;
<IfModule mod_php5.c>
AddIcon /icons/php.gif .phps .php .phtml
</IfModule>
<IfModule mod_php7.c>
AddIcon /icons/php.gif .phps .php .phtml
</IfModule>
HERE
}

@ -0,0 +1,35 @@
{
$OUT = '';
use esmith::DomainsDB;
my $db = esmith::DomainsDB->open_ro;
unless ($db){
warn "Couldn't open domains DB in VirtualHosts template fragment";
return;
}
my @vhosts = $db->get_all_by_prop('type' => 'vhost');
foreach my $vhost (@vhosts) {
my $templatePath = $vhost->prop('TemplatePath') || 'WebAppVirtualHost';
foreach my $port ($httpPort, $httpsPort){
my %virtualHost = (
ipAddress => '0.0.0.0',
port => $port,
localAccess => $localAccess,
externalSSLAccess => $externalSSLAccess,
domain => $vhost,
httpPort => $httpPort,
httpsPort => $httpsPort
);
$OUT .= esmith::templates::processTemplate (
{
MORE_DATA => \%virtualHost,
TEMPLATE_PATH =>
"/etc/httpd/conf/httpd.conf/$templatePath",
OUTPUT_TYPE => 'string',
});
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save