mirror of
https://github.com/myvesta/vesta
synced 2025-07-16 10:03:23 -07:00
added FastCGI template
This commit is contained in:
parent
7fede99297
commit
5760da5a7e
8 changed files with 92 additions and 12 deletions
|
@ -1,7 +1,7 @@
|
|||
WEB_DOMAINS='10'
|
||||
WEB_SSL='10'
|
||||
WEB_ALIASES='10'
|
||||
WEB_TPL='default,phpcgi,unlim'
|
||||
WEB_TPL='default,phpcgi,unlim,phpfcgid'
|
||||
DATABASES='10'
|
||||
MAIL_DOMAINS='10'
|
||||
MAIL_BOXES='30'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
WEB_DOMAINS='30'
|
||||
WEB_SSL='30'
|
||||
WEB_ALIASES='50'
|
||||
WEB_TPL='default,phpcgi,unlim'
|
||||
WEB_TPL='default,phpcgi,unlim,phpfcgid'
|
||||
DATABASES='30'
|
||||
MAIL_DOMAINS='30'
|
||||
MAIL_BOXES='50'
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# Default template with basic php module restrictions.
|
||||
# This is recomended config for basic sites.
|
||||
# Best performance. Not recomended for shared hosting.
|
||||
PHP='module' CGI='yes' ELOG='no'
|
||||
|
|
|
@ -15,15 +15,9 @@
|
|||
AllowOverride AuthConfig FileInfo Indexes Limit
|
||||
SSLRequireSSL
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
php_admin_value upload_tmp_dir %home%/%user%/tmp
|
||||
php_admin_value upload_max_filesize 10M
|
||||
php_admin_value max_execution_time 20
|
||||
php_admin_value post_max_size 8M
|
||||
php_admin_value memory_limit 32M
|
||||
php_admin_flag mysql.allow_persistent off
|
||||
php_admin_flag safe_mode off
|
||||
php_admin_value session.save_path %home%/%user%/tmp
|
||||
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f %email%'
|
||||
php_admin_flag engine off
|
||||
Action phpcgi-script /cgi-bin/php
|
||||
AddHandler phpcgi-script .php
|
||||
</Directory>
|
||||
<Directory %home%/%user%/web/%domain%/stats>
|
||||
AllowOverride All
|
||||
|
|
3
data/templates/apache_phpfcgid.descr
Normal file
3
data/templates/apache_phpfcgid.descr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Template with php as FastCGI for best performance and security.
|
||||
# (it uses post instal script)
|
||||
PHP='fcgid' CGI='yes' ELOG='no'
|
22
data/templates/apache_phpfcgid.sh
Executable file
22
data/templates/apache_phpfcgid.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
# Adding php wrapper
|
||||
user="$1"
|
||||
domain="$2"
|
||||
ip="$3"
|
||||
home_dir="$4"
|
||||
docroot="$5"
|
||||
|
||||
wrapper_script="#!/bin/sh
|
||||
PHPRC=/etc/
|
||||
export PHPRC
|
||||
export PHP_FCGI_MAX_REQUESTS=1000
|
||||
export PHP_FCGI_CHILDREN=8
|
||||
exec /usr/bin/php-cgi
|
||||
"
|
||||
wrapper_file="$home_dir/$user/web/$domain/cgi-bin/fcgi-starter"
|
||||
|
||||
echo "$wrapper_script" > $wrapper_file
|
||||
chown $user:$user $wrapper_file
|
||||
chmod -f 751 $wrapper_file
|
||||
|
||||
exit 0
|
34
data/templates/apache_phpfcgid.stpl
Normal file
34
data/templates/apache_phpfcgid.stpl
Normal file
|
@ -0,0 +1,34 @@
|
|||
<VirtualHost %ip%:%web_ssl_port%>
|
||||
|
||||
ServerName %domain_idn%
|
||||
ServerAlias %alias_idn%
|
||||
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/httpd/domains/%domain%.bytes bytes
|
||||
CustomLog /var/log/httpd/domains/%domain%.log combined
|
||||
%elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
|
||||
<Directory %docroot%>
|
||||
AllowOverride AuthConfig FileInfo Indexes Limit
|
||||
SSLRequireSSL
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
php_admin_flag engine off
|
||||
AddHandler fcgid-script .php
|
||||
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
|
||||
</Directory>
|
||||
<Directory %home%/%user%/web/%domain%/stats>
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
php_admin_value open_basedir %home%/%user%/web:%home%/%user%/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp
|
||||
SSLEngine on
|
||||
SSLVerifyClient none
|
||||
SSLCertificateFile %ssl_cert%
|
||||
SSLCertificateKeyFile %ssl_key%
|
||||
|
||||
Include %home%/%user%/conf/shttpd.%domain%.conf*
|
||||
|
||||
</VirtualHost>
|
||||
|
27
data/templates/apache_phpfcgid.tpl
Normal file
27
data/templates/apache_phpfcgid.tpl
Normal file
|
@ -0,0 +1,27 @@
|
|||
<VirtualHost %ip%:%web_port%>
|
||||
|
||||
ServerName %domain_idn%
|
||||
ServerAlias %alias_idn%
|
||||
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/httpd/domains/%domain%.bytes bytes
|
||||
CustomLog /var/log/httpd/domains/%domain%.log combined
|
||||
%elog%ErrorLog /var/log/httpd/domains/%domain%.error.log
|
||||
<Directory %docroot%>
|
||||
AllowOverride AuthConfig FileInfo Indexes Limit
|
||||
Options +Includes -Indexes +ExecCGI
|
||||
php_admin_flag engine off
|
||||
AddHandler fcgid-script .php
|
||||
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
|
||||
</Directory>
|
||||
<Directory %home%/%user%/web/%domain%/stats>
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
Include %home%/%user%/conf/httpd.%domain%.conf*
|
||||
|
||||
</VirtualHost>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue