Added fixes for non php-fpm installation
This commit is contained in:
@@ -1456,11 +1456,30 @@ if [ "$apache" = 'yes' ]; then
|
||||
|
||||
# IDK why those modules still here, but ok. if they are disabled by default
|
||||
|
||||
if [ -e /etc/httpd/conf.modules.d/01-suexec.conf ]; then
|
||||
sed 's/^LoadModule suexec_module/#LoadModule suexec_module/' -i /etc/httpd/conf.modules.d/01-suexec.conf
|
||||
fi
|
||||
if [ -e /etc/httpd/conf.modules.d/10-fcgid.conf ]; then
|
||||
sed 's/^LoadModule fcgid_module/#LoadModule fcgid_module/' -i /etc/httpd/conf.modules.d/10-fcgid.conf
|
||||
if [ "$phpfpm" = 'yes' ]; then
|
||||
if [ -e /etc/httpd/conf.modules.d/01-suexec.conf ]; then
|
||||
sed 's/^LoadModule suexec_module/#LoadModule suexec_module/' -i /etc/httpd/conf.modules.d/01-suexec.conf
|
||||
fi
|
||||
if [ -e /etc/httpd/conf.modules.d/10-fcgid.conf ]; then
|
||||
sed 's/^LoadModule fcgid_module/#LoadModule fcgid_module/' -i /etc/httpd/conf.modules.d/10-fcgid.conf
|
||||
fi
|
||||
else
|
||||
cp -f $HESTIA_INSTALL_DIR/httpd/01-mpm-itk.conf /etc/httpd/conf.modules.d/
|
||||
if [ -e /etc/httpd/conf.modules.d/01-suexec.conf ]; then
|
||||
sed 's/#LoadModule suexec_module/LoadModule suexec_module/' -i /etc/httpd/conf.modules.d/01-suexec.conf
|
||||
fi
|
||||
echo "LoadModule suphp_module modules/mod_suphp.so" > /etc/httpd/conf.modules.d/10-suphp.conf
|
||||
if [ -e /etc/httpd/conf.modules.d/10-fcgid.conf ]; then
|
||||
sed 's/#LoadModule fcgid_module/LoadModule fcgid_module/' -i /etc/httpd/conf.modules.d/10-fcgid.conf
|
||||
fi
|
||||
if [ -e /etc/httpd/conf.d/fcgid.conf ]; then
|
||||
cp /etc/httpd/conf.d/fcgid.conf /etc/httpd/conf.h.d/fcgid.conf
|
||||
fi
|
||||
if [ -e /etc/httpd/conf.dmod_suphp.conf ]; then
|
||||
cp /etc/httpd/conf.d/mod_suphp.conf /etc/httpd/conf.h.d/mod_suphp.conf
|
||||
fi
|
||||
ln -s "/etc/httpd/conf.d.prep/php${php_v}.conf" /etc/httpd/conf.modules.d/09-mod-php.conf
|
||||
|
||||
fi
|
||||
|
||||
# Switch status loader to custom one
|
||||
@@ -1474,6 +1493,10 @@ if [ "$apache" = 'yes' ]; then
|
||||
sed 's/LoadModule mpm_prefork_module/#LoadModule mpm_prefork_module/' -i /etc/httpd/conf.modules.d/00-mpm.conf
|
||||
sed 's/#LoadModule mpm_event_module/LoadModule mpm_event_module/' -i /etc/httpd/conf.modules.d/00-mpm.conf
|
||||
cp -f $HESTIA_INSTALL_DIR/httpd/hestia-event.conf /etc/httpd/conf.h.d/
|
||||
else
|
||||
sed 's/LoadModule mpm_worker_module/#LoadModule mpm_worker_module/' -i /etc/httpd/conf.modules.d/00-mpm.conf
|
||||
sed 's/LoadModule mpm_event_module/#LoadModule mpm_event_module/' -i /etc/httpd/conf.modules.d/00-mpm.conf
|
||||
sed 's/#LoadModule mpm_prefork_module/LoadModule mpm_prefork_module/' -i /etc/httpd/conf.modules.d/00-mpm.conf
|
||||
fi
|
||||
|
||||
if [ ! -d /etc/httpd/sites-available ]; then
|
||||
|
||||
3
install/rpm/httpd/01-mpm-itk.conf
Normal file
3
install/rpm/httpd/01-mpm-itk.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
<IfModule mpm_prefork_module>
|
||||
LoadModule mpm_itk_module modules/mod_mpm_itk.so
|
||||
</IfModule>
|
||||
@@ -18,6 +18,13 @@
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.log combined
|
||||
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
|
||||
<Directory %sdocroot%>
|
||||
<FilesMatch ".+\.ph(ar|p|tml)$">
|
||||
SetHandler application/x-httpd-php
|
||||
</FilesMatch>
|
||||
<FilesMatch ".+\.phps$">
|
||||
SetHandler application/x-httpd-php-source
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
AllowOverride All
|
||||
SSLRequireSSL
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
|
||||
@@ -21,6 +21,13 @@
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf*
|
||||
|
||||
<Directory %docroot%>
|
||||
<FilesMatch ".+\.ph(ar|p|tml)$">
|
||||
SetHandler application/x-httpd-php
|
||||
</FilesMatch>
|
||||
<FilesMatch ".+\.phps$">
|
||||
SetHandler application/x-httpd-php-source
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
AllowOverride All
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
|
||||
|
||||
41
install/rpm/templates/web/httpd/forbidden.stpl
Normal file
41
install/rpm/templates/web/httpd/forbidden.stpl
Normal file
@@ -0,0 +1,41 @@
|
||||
#=========================================================================#
|
||||
# Default Web Domain Template #
|
||||
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
|
||||
# https://hestiacp.com/docs/server-administration/web-templates.html #
|
||||
#=========================================================================#
|
||||
|
||||
<VirtualHost %ip%:%web_ssl_port%>
|
||||
|
||||
ServerName %domain_idn%
|
||||
%alias_string%
|
||||
ServerAdmin %email%
|
||||
DocumentRoot %sdocroot%
|
||||
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
|
||||
Alias /vstats/ %home%/%user%/web/%domain%/stats/
|
||||
Alias /error/ %home%/%user%/web/%domain%/document_errors/
|
||||
#SuexecUserGroup %user% %group%
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.log combined
|
||||
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
|
||||
|
||||
<Location />
|
||||
Require all denied
|
||||
</Location>
|
||||
SSLEngine on
|
||||
SSLVerifyClient none
|
||||
SSLCertificateFile %ssl_crt%
|
||||
SSLCertificateKeyFile %ssl_key%
|
||||
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
|
||||
|
||||
<IfModule mod_ruid2.c>
|
||||
RMode config
|
||||
RUidGid %user% %group%
|
||||
RGroups apache
|
||||
</IfModule>
|
||||
<IfModule mpm_itk.c>
|
||||
AssignUserID %user% %group%
|
||||
</IfModule>
|
||||
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
|
||||
IncludeOptional /etc/httpd/conf.h.d/*.inc
|
||||
</VirtualHost>
|
||||
38
install/rpm/templates/web/httpd/forbidden.tpl
Normal file
38
install/rpm/templates/web/httpd/forbidden.tpl
Normal file
@@ -0,0 +1,38 @@
|
||||
#=========================================================================#
|
||||
# Default Web Domain Template #
|
||||
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
|
||||
# https://hestiacp.com/docs/server-administration/web-templates.html #
|
||||
#=========================================================================#
|
||||
|
||||
<VirtualHost %ip%:%web_port%>
|
||||
|
||||
ServerName %domain_idn%
|
||||
%alias_string%
|
||||
ServerAdmin %email%
|
||||
DocumentRoot %docroot%
|
||||
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
|
||||
Alias /vstats/ %home%/%user%/web/%domain%/stats/
|
||||
Alias /error/ %home%/%user%/web/%domain%/document_errors/
|
||||
#SuexecUserGroup %user% %group%
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.log combined
|
||||
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
|
||||
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf*
|
||||
|
||||
<Location />
|
||||
Require all denied
|
||||
</Location>
|
||||
|
||||
<IfModule mod_ruid2.c>
|
||||
RMode config
|
||||
RUidGid %user% %group%
|
||||
RGroups apache
|
||||
</IfModule>
|
||||
<IfModule mpm_itk.c>
|
||||
AssignUserID %user% %group%
|
||||
</IfModule>
|
||||
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
|
||||
IncludeOptional /etc/httpd/conf.h.d/*.inc
|
||||
</VirtualHost>
|
||||
@@ -18,6 +18,13 @@
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.log combined
|
||||
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
|
||||
<Directory %sdocroot%>
|
||||
<FilesMatch ".+\.ph(ar|p|tml)$">
|
||||
SetHandler application/x-httpd-php
|
||||
</FilesMatch>
|
||||
<FilesMatch ".+\.phps$">
|
||||
SetHandler application/x-httpd-php-source
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
AllowOverride All
|
||||
SSLRequireSSL
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
|
||||
@@ -21,6 +21,13 @@
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf*
|
||||
|
||||
<Directory %docroot%>
|
||||
<FilesMatch ".+\.ph(ar|p|tml)$">
|
||||
SetHandler application/x-httpd-php
|
||||
</FilesMatch>
|
||||
<FilesMatch ".+\.phps$">
|
||||
SetHandler application/x-httpd-php-source
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
AllowOverride All
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
php_admin_value upload_max_filesize 10M
|
||||
|
||||
32
install/rpm/templates/web/httpd/php-fpm/forbidden.stpl
Normal file
32
install/rpm/templates/web/httpd/php-fpm/forbidden.stpl
Normal file
@@ -0,0 +1,32 @@
|
||||
#=========================================================================#
|
||||
# Default Web Domain Template #
|
||||
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
|
||||
# https://hestiacp.com/docs/server-administration/web-templates.html #
|
||||
#=========================================================================#
|
||||
|
||||
<VirtualHost %ip%:%web_ssl_port%>
|
||||
|
||||
ServerName %domain_idn%
|
||||
%alias_string%
|
||||
ServerAdmin %email%
|
||||
DocumentRoot %sdocroot%
|
||||
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
|
||||
Alias /vstats/ %home%/%user%/web/%domain%/stats/
|
||||
Alias /error/ %home%/%user%/web/%domain%/document_errors/
|
||||
#SuexecUserGroup %user% %group%
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.log combined
|
||||
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
|
||||
<Location />
|
||||
Require all denied
|
||||
</Location>
|
||||
|
||||
SSLEngine on
|
||||
SSLVerifyClient none
|
||||
SSLCertificateFile %ssl_crt%
|
||||
SSLCertificateKeyFile %ssl_key%
|
||||
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
|
||||
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
|
||||
IncludeOptional /etc/httpd/conf.h.d/*.inc
|
||||
</VirtualHost>
|
||||
30
install/rpm/templates/web/httpd/php-fpm/forbidden.tpl
Normal file
30
install/rpm/templates/web/httpd/php-fpm/forbidden.tpl
Normal file
@@ -0,0 +1,30 @@
|
||||
#=========================================================================#
|
||||
# Default Web Domain Template #
|
||||
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
|
||||
# https://hestiacp.com/docs/server-administration/web-templates.html #
|
||||
#=========================================================================#
|
||||
|
||||
<VirtualHost %ip%:%web_port%>
|
||||
|
||||
ServerName %domain_idn%
|
||||
%alias_string%
|
||||
ServerAdmin %email%
|
||||
DocumentRoot %docroot%
|
||||
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
|
||||
Alias /vstats/ %home%/%user%/web/%domain%/stats/
|
||||
Alias /error/ %home%/%user%/web/%domain%/document_errors/
|
||||
#SuexecUserGroup %user% %group%
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.log combined
|
||||
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
|
||||
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/apache2.forcessl.conf*
|
||||
|
||||
<Location />
|
||||
Require all denied
|
||||
</Location>
|
||||
|
||||
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
|
||||
IncludeOptional /etc/httpd/conf.h.d/*.inc
|
||||
</VirtualHost>
|
||||
@@ -1,16 +1,26 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/bash
|
||||
# Adding php wrapper
|
||||
user="$1"
|
||||
domain="$2"
|
||||
ip="$3"
|
||||
home_dir="$4"
|
||||
docroot="$5"
|
||||
php_path="$6"
|
||||
|
||||
wrapper_script='#!/usr/bin/php-cgi -cphp5-cgi.ini'
|
||||
wrapper_script="#!$php_path -cphp5-cgi.ini"
|
||||
wrapper_file="$home_dir/$user/web/$domain/cgi-bin/php"
|
||||
wrapper_dir="/var/www/$user/$domain/cgi-bin"
|
||||
wrapper_file2="$wrapper_dir/php"
|
||||
|
||||
echo "$wrapper_script" > $wrapper_file
|
||||
chown $user:$user $wrapper_file
|
||||
chmod -f 751 $wrapper_file
|
||||
|
||||
mkdir -p $wrapper_dir
|
||||
|
||||
echo "$wrapper_script" > $wrapper_file2
|
||||
chown $user:$user $wrapper_file2
|
||||
chown $user:$user $wrapper_dir
|
||||
chmod -f 751 $wrapper_file2
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
%alias_string%
|
||||
ServerAdmin %email%
|
||||
DocumentRoot %sdocroot%
|
||||
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
|
||||
#ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
|
||||
ScriptAlias /cgi-bin/ /var/www/%user%/%domain%/cgi-bin/
|
||||
Alias /vstats/ %home%/%user%/web/%domain%/stats/
|
||||
Alias /error/ %home%/%user%/web/%domain%/document_errors/
|
||||
SuexecUserGroup %user% %group%
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
%alias_string%
|
||||
ServerAdmin %email%
|
||||
DocumentRoot %docroot%
|
||||
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
|
||||
#ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
|
||||
ScriptAlias /cgi-bin/ /var/www/%user%/%domain%/cgi-bin/
|
||||
Alias /vstats/ %home%/%user%/web/%domain%/stats/
|
||||
Alias /error/ %home%/%user%/web/%domain%/document_errors/
|
||||
SuexecUserGroup %user% %group%
|
||||
|
||||
@@ -1,22 +1,32 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/bash
|
||||
# Adding php wrapper
|
||||
user="$1"
|
||||
domain="$2"
|
||||
ip="$3"
|
||||
home_dir="$4"
|
||||
docroot="$5"
|
||||
php_path="$6"
|
||||
|
||||
wrapper_script="#!/bin/sh
|
||||
PHPRC=/usr/local/lib
|
||||
export PHPRC
|
||||
export PHP_FCGI_MAX_REQUESTS=1000
|
||||
export PHP_FCGI_CHILDREN=20
|
||||
exec /usr/bin/php-cgi
|
||||
exec $php_path
|
||||
"
|
||||
wrapper_file="$home_dir/$user/web/$domain/cgi-bin/fcgi-starter"
|
||||
wrapper_dir="/var/www/$user/$domain/cgi-bin"
|
||||
wrapper_file2="$wrapper_dir/fcgi-starter"
|
||||
|
||||
echo "$wrapper_script" > $wrapper_file
|
||||
chown $user:$user $wrapper_file
|
||||
chmod -f 751 $wrapper_file
|
||||
|
||||
mkdir -p $wrapper_dir
|
||||
|
||||
echo "$wrapper_script" > $wrapper_file2
|
||||
chown $user:$user $wrapper_file2
|
||||
chown $user:$user $wrapper_dir
|
||||
chmod -f 751 $wrapper_file2
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
<Files *.php>
|
||||
SetHandler fcgid-script
|
||||
</Files>
|
||||
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
|
||||
#FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
|
||||
FCGIWrapper /var/www/%user%/%domain%/cgi-bin/fcgi-starter .php
|
||||
</Directory>
|
||||
<Directory %home%/%user%/web/%domain%/stats>
|
||||
AllowOverride All
|
||||
@@ -42,4 +43,12 @@
|
||||
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
|
||||
IncludeOptional /etc/httpd/conf.h.d/*.inc
|
||||
<IfModule mod_ruid2.c>
|
||||
RMode config
|
||||
RUidGid %user% %group%
|
||||
RGroups apache
|
||||
</IfModule>
|
||||
<IfModule mpm_itk.c>
|
||||
AssignUserID %user% %group%
|
||||
</IfModule>
|
||||
</VirtualHost>
|
||||
|
||||
@@ -30,11 +30,20 @@
|
||||
<Files *.php>
|
||||
SetHandler fcgid-script
|
||||
</Files>
|
||||
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
|
||||
#FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
|
||||
FCGIWrapper /var/www/%user%/%domain%/cgi-bin/fcgi-starter .php
|
||||
</Directory>
|
||||
<Directory %home%/%user%/web/%domain%/stats>
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
|
||||
IncludeOptional /etc/httpd/conf.h.d/*.inc
|
||||
<IfModule mod_ruid2.c>
|
||||
RMode config
|
||||
RUidGid %user% %group%
|
||||
RGroups apache
|
||||
</IfModule>
|
||||
<IfModule mpm_itk.c>
|
||||
AssignUserID %user% %group%
|
||||
</IfModule>
|
||||
</VirtualHost>
|
||||
|
||||
@@ -19,6 +19,13 @@
|
||||
CustomLog /var/log/%web_system%/domains/%domain%.log combined
|
||||
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
|
||||
<Directory %sdocroot%>
|
||||
<FilesMatch ".+\.ph(ar|p|tml)$">
|
||||
SetHandler application/x-httpd-php
|
||||
</FilesMatch>
|
||||
<FilesMatch ".+\.phps$">
|
||||
SetHandler application/x-httpd-php-source
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
AllowOverride All
|
||||
SSLRequireSSL
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
|
||||
@@ -22,6 +22,13 @@
|
||||
IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf*
|
||||
|
||||
<Directory %docroot%>
|
||||
<FilesMatch ".+\.ph(ar|p|tml)$">
|
||||
SetHandler application/x-httpd-php
|
||||
</FilesMatch>
|
||||
<FilesMatch ".+\.phps$">
|
||||
SetHandler application/x-httpd-php-source
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
AllowOverride All
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
|
||||
|
||||
Reference in New Issue
Block a user