diff --git a/.gitignore b/.gitignore
index 6701a887..fe0574ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,6 @@
*.gz
.vscode
.DS_Store
+data
+conf
+log
\ No newline at end of file
diff --git a/Changelog.md b/Changelog.md
new file mode 100644
index 00000000..617bc9c3
--- /dev/null
+++ b/Changelog.md
@@ -0,0 +1,468 @@
+Version 0.9.9-0-13 [2025-08-15]
+==================================================
+* Improvement: Activating FileManager licence for all users (credits to Official VestaCP)
+* Introducing a malware cleaning set of tools: v-install-wordfence-cli, v-desinfect-wordpress, v-fix-wordpress-core, v-change-database-password-for-wordpress, v-change-wordpress-admin-passwords, v-delete-inactive-wordpress-plugins-and-themes, v-delete-wordpress-uploads-php-files) (credits to isscbta)
+* Improvement: Added support for PHP 8.3 and 8.4
+* SRS support for Exim4 (v-add-srs-support-to-exim) (credits to HestiaCP)
+* Security: Ensuring that PHP files are visible only to the account they belong to - setting chmod 600 for all .php and .env files (also added as admin cronjob - v-fix-website-permissions-for-all-websites-only-php)
+* Added cronjob for disk usage snapshot (size of each folder) to see what folder is growing every day (v-df-snapshot-make, v-df-snapshot-diff [some-day-snapshot] [some-other-day-snapshot])
+* Bugfix: SSL fix for Apache 2.4.65+ (fix for '421 Misdirected Request')
+* Bugfix: vst-install-debian.sh: ability to install MySQL 8 on Debian 12
+* Improvement: Update nginx block-firewall.conf when user blocks 80,443 ports for some IPv4 address in the Firewall section of the admin panel
+* Improvement: v-install-wordpress: Support for IDN format domains
+* Security: Adding ProFTPD jail rule to Fail2Ban
+* Introducing: v-make-main-apache-log - making one log file for PHP requests for all websites
+* Security: Introducing a new command: v-fix-php-ini-disable-functions
+* Improvement: Introducing myVesta rules for SpamAssassin (enhancing spam filtering)
+* Improvement: When deleting a domain, also delete the database if the domain has a database
+* Bugfix: Removing temporary Docker container network interfaces from RRD
+* Introducing v-run-wp-cli-myvesta that knows the correct terminal width
+* Introducing a new command: v-cd-www alias for v-change-dir-www
+* Introducing a new command: v-clear-fail2ban
+* Introducing a new command: v-get-dns-config (to print zone file in bind9 format)
+* Introducing a DISABLE_IP_CHECK as vesta.conf variable (if logged-in user is getting a new IPv4 address every minute)
+* Security: Introducing a parse_object_kv_list_non_eval() function in main.sh, to avoid the evil eval command
+* Security: Enhance package validation, in v-change-user-package 'eval' replaced with 'parse_object_kv_list_non_eval'
+* Improvement: Replacing all WordPress scripts to use 'v-run-wp-cli' instead of 'wp'
+* Improvement: v-install-wordpress: Almost always use https
+* Improvement: Skip the prompt to continue during myVesta installation if the administrator has set all required variables in the command line
+* Security: Jailing v-run-wp-cli (running WP-CLI as user, added open_basedir, disabling shell_exec() and other dangerous PHP functions)
+* Security: v-commander: removing the ability to set a root password
+* Bugfix: DKIM record deletion command in v-delete-mail-domain-dkim script
+* Adding FTP / SFTP port for Remote Backup (credits to ikheetjeff)
+* Introducing a new command: v-delete-mails - delete emails older than N days (credits to isscbta)
+* Introducing new commands: v-blacklist-email-domain, v-blacklist-email-account, v-whitelist-email-domain, v-whitelist-email-account (credits to isscbta)
+* Bugfix: v-move-folder-and-make-symlink: use 'mv' instead of 'rsync'
+* Improvement: Calculate the size of directories on /hdd too
+* Bugfix: v-move-domain-and-database-to-account: Update wordfence-waf.php
+* Bugfix: v-add-letsencrypt-domain: Detecting valid status on wildcard variant
+* Bugfix: db.sh and v-clone-website: mysqldump --max_allowed_packet=1024M
+* Bugfix: web/index.php: Prevent recreation of token by shitty browser add-ons
+* Bugfix: v-restore-user: permissions fix while restoring backup
+* Bugfix: Add some loops due to 403 errors during LE request in some random cases
+* Improvement: v-clone-website: adding --EXCLUDE_UPLOADS parameter
+* Bugfix: vst-install-debian.sh - removing phppgadmin
+* Bugfix: v-update-firewall: $FIREWALL_STATEFUL conf variable (for Infomaniak VPS servers)
+* Bugfix: Awstats template for all systems does not have a closed bracket in line 27 (credits to gkirde)
+* Bugfix: Update v-import-cpanel-backup - removing /*!999999\- enable the sandbox mode */
+* Bugfix: Small PHP syntax fixes in the admin panel
+* Introducing nginx template 'wprocket-webp-express-force-https' (credits to Luka Paunovic)
+* Improvement: Added functions to check if a domain or user is unsuspended in main.sh
+* Introducing a new command: v-update-document-errors-files
+* Improvement: new v-backup-user-now command does backup even if the system Load Average is above the limit, or the administrator configured backups to perform only at night
+* Improvement: v-install-wp-cli and v-install-wp-cli-myvesta - automatically updates if wp-cli is 30 days old
+* Bugfix: Check for SSL certificate existence before deleting web domain SSL in v-install-unsigned-ssl
+* Improvement: v-install-wordpress: avoid changing nginx proxy template in apache-less variant
+* Added to .gitignore excludes for 'data', 'conf', and 'log' folders
+* And many other minor bugfixes and improvements...
+
+Version 0.9.9-0-12 [2025-02-28]
+==================================================
+* SpamHaus DNSBL removed from exim4
+* A lot of small bugs fixed
+
+Version 0.9.9-0-11 [2024-05-30]
+==================================================
+* Introducing v-run-wp-cli command ( @isscbta )
+* Introducing v-add-wordpress-admin command ( @isscbta )
+* Few bugs fixed
+
+Version 0.9.9-0-10 [2024-04-11]
+==================================================
+* Introducing v-edit-php-ini command ( @isscbta )
+* Introducing v-edit-domain-php-ini command ( @isscbta )
+
+Version 0.9.9-0-9 [2024-04-05]
+==================================================
+* Get quick info about a banned IP (Host, Banlist, Location) (many thanks to @VasilisParaschos )
+* Few bugs fixed
+
+Version 0.9.9-0-5 to 0.9.9-0-8
+==================================================
+* Few bugs fixed
+
+Version 0.9.9-0-4 [2023-06-27]
+==================================================
+* Support for Debian 12 ( in mutual cooperation with @HestiaCP )
+
+Version 0.9.9-0-2 [2023-06-12]
+==================================================
+* Hosting panel UI perfomance fix
+
+Version 0.9.9-0 [2023-06-05]
+==================================================
+* Redesign of hosting panel
+* Fix for WP_CACHE_KEY_SALTs in v-clone-website command
+* Fix for "Helo name contains a ip address" in Exim4
+* Fix for Exim4 for punycode domains (in collaboration with @HestiaCP )
+
+Version 0.9.8-26-62 [2023-04-05]
+==================================================
+* Fix for LetsEncrypt Asynchronous Order Finalization (in collaboration with @HestiaCP )
+
+Version 0.9.8-26-61 [2023-04-04]
+==================================================
+* Many bugfixes
+* Hotfix for LetsEncrypt to prevent Apache falling
+
+Version 0.9.8-26-60 [2023-02-12]
+==================================================
+* New script: v-commander (useful for maintaining the server)
+* New script: v-activate-rocket-nginx (serve WP-Rocket cache directly from nginx)
+* New script: v-update-myvesta (get the very latest build of myVesta)
+* v-clone-website: By default cloning to database: user_domain_com (instead of cloning to database: user_old_db_migrated)
+* Many minor bugfixes
+
+Version 0.9.8-26-59 [2023-02-01]
+==================================================
+* Support for PHP 8.2
+* New script: v-move-folder-and-make-symlink
+* New script: v-lock-wordpress (to prevent PHP malware) and v-unlock-wordpress
+* v-install-wordpress: Installing WordPress to user_domain_com database instead of installing to user_wp database
+* Many minor bugfixes
+
+Version 0.9.8-26-58 [2022-07-12]
+==================================================
+* [Security] hash_equals() in /reset/mail/ (credits to @divinity76 )
+* Avoid out-of-memory while downloading large log files from panel (credits to @divinity76 )
+* Fix for an boring PHP Notice in vesta-php
+
+Version 0.9.8-26-57 [2022-07-06]
+==================================================
+* Fix for GMail SMTP timeouts on Debian11
+* [Security] Fix for Local Sed Injection Vulnerability ( credits to @cleemy-desu-wayo )
+
+Version 0.9.8-26-56 [2022-05-28]
+==================================================
+* Adding Barracuda RBL to SpamAssassin
+* Fixing insane HTML form bug in List backup items page
+* Script for easy adding second IP address for SMTP authenticated users only (v-make-separated-ip-for-email)
+
+Version 0.9.8-26-55 [2022-04-26]
+==================================================
+* Support for MySQL 8
+* [Security] Preventing brute-force resetting password (thanks to HestiaCP @hestiacp for fix)
+* Many minor bugfixes
+
+Version 0.9.8-26-54 [2021-12-17]
+==================================================
+* Checking if FreshClam is started after installation
+
+Version 0.9.8-26-53 [2021-12-12]
+==================================================
+* Support for PHP 8.1
+* Function to ensure that pool.d folders are not empty
+
+Version 0.9.8-26-52 [2021-11-23]
+==================================================
+* Fix for not to match wildcard "*domains" and "databases*" while restoring
+* Added memcached to v-list-sys-services
+
+Version 0.9.8-26-51 [2021-11-14]
+==================================================
+* Many fixes for "List services" page (v-list-sys-services function)
+
+Version 0.9.8-26-50 [2021-11-07]
+==================================================
+* Many small bugfixes and CSRF fixes
+
+Version 0.9.8-26-49 [2021-07-17]
+==================================================
+* Support for Debian 11
+
+Version 0.9.8-26-48 [2021-07-11]
+==================================================
+* Fixed two bugs in LetsEncrypt generating process
+
+Version 0.9.8-26-47 [2021-05-30]
+==================================================
+* Enabling TLS for ProFTPD FTPS
+* More logical "Restore backup" template
+
+Version 0.9.8-26-46 [2021-04-17]
+==================================================
+* [Feature] Updating CloudFlare IP addresses
+
+Version 0.9.8-26-45 [2021-04-13]
+==================================================
+* [Feature] Logging whole LetsEncrypt process to /usr/local/vesta/log/letsencrypt.log and /usr/local/vesta/log/letsencrypt_cron.log
+* [Feature] Warn admin once (by sending email) if LetsEncrypt renewing failed for server hostname
+* [Bugfix] Correct truncating of CA LetsEncrypt certificate (thanks to HestiaCP @hestiacp for fix)
+
+Version 0.9.8-26-44 [2021-04-04]
+==================================================
+* [Security] Preventing denial-of-service in openssl library in vesta-nginx service (CVE-2021-3449)
+* [Security] Preventing admin to install non-vesta packages from vesta admin panel user interface (Credits to: Numan Türle @numanturle)
+* [Bugfix] Preventing multiple execution of v-backup-users
+* [UserInterface] CSS fix for Apache status table (Credits to: Milos Spasic)
+
+Version 0.9.8-26-43 [2021-03-15]
+==================================================
+* [Security] fix for: CSRF remote code execution in UploadHandler.php - CVE-2021-28379 (Credits to: Fady Osman @fady_othman)
+* [Security] fix for: Local privilege escalation from user account to admin account via v-add-web-domain (Credits to: Two independent security researchers, Marti Guasch Jiménez and Francisco Andreu Sanz, working with the SSD Secure Disclosure program) (and also thanks to HestiaCP @hestiacp for fix)
+* [Security] fix for: Local privilege escalation in v-generate-ssl-cert (potential user to admin or root escalation) (Credits to: Numan Türle @numanturle, thanks to HestiaCP @hestiacp for fix)
+* [Security] fix for: Local privilege escalation in /web/api/ via v-make-tmp-file (probably admin to root escalation) (Credits to: Numan Türle @numanturle, thanks to HestiaCP @hestiacp for fix)
+* [Security] fix for: Cross site scripting in /web/add/ip/ (admin to other admin XSS escalation) (Credits to: Numan Türle @numanturle, thanks to HestiaCP @hestiacp for fix)
+* [Security] fix for: Admin to root escalation in v-activate-vesta-license (Credits to: Numan Türle @numanturle)
+* [Security] Ensure HTML will not be displayed in list log page (Credits to: Kristan Kenney @kristankenney, thanks to HestiaCP @hestiacp for fix)
+
+Version 0.9.8-26-42 [2021-02-26]
+==================================================
+* [Feature] Support for PHP 8.0, see: https://forum.myvestacp.com/viewtopic.php?f=18&t=52
+* [Bugfix] Making sure Apache is in mpm_event mode
+
+Version 0.9.8-26-41 [2021-02-11]
+==================================================
+* Few bugfixes
+
+Version 0.9.8-26-40 [2021-02-08]
+==================================================
+* Few bugfixes
+
+Version 0.9.8-26-39 [2020-12-12]
+==================================================
+* [Security] Fixing useless issue with tokens in "download backup" and "loginas" functions (thanks to HestiaCP for fixes)
+* [Security] Fixing XSS in /list/rrd/?period= value
+
+Version 0.9.8-26-38 [2020-12-05]
+==================================================
+* [Security] Fixing Apache status public access (thanks to HestiaCP for letting us know)
+
+Version 0.9.8-26-37 [2020-10-26]
+==================================================
+* [Bugfix] Fixing LetsEncrypt deprecated GET method for ACME v2 (thanks to @moucho)
+* [Bugfix] Fixing Roundcube to send via authenticated SMTP user instead via php
+
+Version 0.9.8-26-36 [2020-09-10]
+==================================================
+* [Bugfix] Checking necessary available disk space before doing backup
+* [Security] Disabling login with 'root'
+
+Version 0.9.8-26-35 [2020-08-23]
+==================================================
+* [Feature] Limiting max recipients per email to 15, in order to prevent mass spamming
+* [Bugfix] While restoring backup, only exclude logs folder from root, not in public_html
+
+Version 0.9.8-26-34 [2020-08-19]
+==================================================
+* [Bugfix] Split long DNS TXT entries into 255 chunks
+
+Version 0.9.8-26-33 [2020-08-16]
+==================================================
+* [Feature] Ability to set some domain to send emails from another IP (command: v-make-separated-ip-for-email-domain)
+
+Version 0.9.8-26-32 [2020-08-02]
+==================================================
+* [Feature] v-replace-in-file command introduced
+* [Security] Making sure new myVesta commands can be called only by root
+
+Version 0.9.8-26-31 [2020-07-30]
+==================================================
+* [Feature] v-import-cpanel-backup command moved to vesta-bin folder (becoming standard myVesta command)
+* Starting to log auto-update output
+
+Version 0.9.8-26-30 [2020-07-26]
+==================================================
+* New ASCII logo in installer
+* Deleted favicon when user don't know secret-url of hosting panel
+* [bugfix] Minor bug fixed in v-make-separated-ip-for-email
+* [bugfix] Minor fix of URL for templates in v-update-dns-templates
+* [bugfix] Minor fixes in installer
+
+Version 0.9.8-26-29 [2020-07-21]
+==================================================
+* [Feature] v-clone-website command moved to vesta-bin folder (becoming standard myVesta command)
+* [Feature] v-migrate-site-to-https command moved to vesta-bin folder (becoming standard myVesta command)
+* [Bugfix] Fix for ClamAV socket
+* Changing Vesta to myVesta in title of hosting panel pages
+
+Version 0.9.8-26-28 [2020-07-15]
+==================================================
+* [Feature] v-install-wordpress command introduced
+* [Feature] v-move-domain-and-database-to-account command introduced
+* [Feature] v-make-separated-ip-for-email command introduced
+* [Bugfix] Fix for LetsEncrypt issuing in apache-less variant (nginx + php-fpm variant)
+* [Bugfix] Fix for configuring phpMyAdmin DB in apache-less variant (nginx + php-fpm variant)
+
+Version 0.9.8-26-27 [2020-07-05]
+==================================================
+* [Feature] Admins now see changelog when they open myVesta panel after myVesta get updated (changelog will dissapear on next refresh)
+* [Bugfix] Better control of opened SMTP concurrent connections (preventing denial-of-service of SMTP) on fresh installed servers - https://github.com/myvesta/vesta/commit/c57b15b5daca2a0ea88ee6a89a2ff5a4ef47d2a3
+* Second tuning of php-fpm pool.d config files (perfomances and limits)
+
+Version 0.9.8-26-26 [2020-06-27]
+==================================================
+* [Feature] Self-signed SSL will be automaticaly added when you add new domain (CloudFlare is fine with that, you don't need LetsEncrypt anymore if you use CloudFlare as reverse-proxy(CDN+Firewall), just set "Full" in SSL section on CloudFlare)
+* [Feature] Script for adding self-signed SSL to desired domain [v-install-unsigned-ssl]
+* From now, on fresh installed server, default backup cron goes at Saturday at 01 AM (instead of everyday at 05 AM)
+* New favicon for hosting panel
+
+Version 0.9.8-26-25 [2020-06-23]
+==================================================
+* [Security] Fixing unnecessary slash in nginx configs for phpmyadmin and roundcube (Credits to Bernardo Berg @bberg1984 for finding this issue!)
+* [Security] Adding escapeshellarg on few more places in php code (Credits to Talha Günay and @Lupul for finding these places)
+
+Version 0.9.8-26-24 [2020-06-22]
+==================================================
+* [Bugfix] nginx + php-fpm installer variant now finally works
+
+Version 0.9.8-26-23 [2020-06-14]
+==================================================
+* Adding label that LetsEncrypt can be added when you Edit domain
+
+Version 0.9.8-26-22 [2020-06-13]
+==================================================
+* [Bugfix] Checking (in order to delete) php7.4 pool config file while deleting domain
+
+Version 0.9.8-26-21 [2020-06-13]
+==================================================
+* [Feature] Blocking executable files inside archives in received emails (ClamAV)
+* [Bugfix] Removing ability to schedule LetsEncrypt issuing while adding new domain (because it can fall in infinite loop whole day)
+* [Bugfix] Force acme-challenge to use Apache if myVesta is behind main nginx
+* [Bugfix] Adding http2 support to nginx caching.tpl
+* [Bugfix] Script that removes depricated 'ssl on;' in nginx templates
+* [Security] Ensure UPDATE_SSL_SCRIPT is not set in some config files
+
+Version 0.9.8-26-20 [2020-06-01]
+==================================================
+* [Bugfix] Script that will ensure that Apache2 will always stay in mpm_event mode
+* [Bugfix] Ensure config files will not be overwritten while updating vesta-nginx package
+* [Bugfix] Fixing URL in v-update-web-templates script
+* [Feature] Additional rates for nginx anti-denial-of-service templates
+
+Version 0.9.8-26-19 [2020-05-15]
+==================================================
+* [Bugfix] Do not match subdomains while restoring domain [v-restore-user]
+
+Version 0.9.8-26-18 [2020-05-15]
+==================================================
+* [Bugfix] Fixing NS parameters in v-add-dns-on-web-alias
+
+Version 0.9.8-26-17 [2020-05-15]
+==================================================
+* [Bugfix] Reverting default clamav socket path
+* [Bugfix] Put mail_max_userip_connections = 50 in dovecot
+
+Version 0.9.8-26-16 [2020-05-15]
+==================================================
+* [Bugfix] Allow quick restarting of nginx if acme-challenge should be added many times
+* [Bugfix] Enabling email notification to fresh installed servers about backup success status
+* [Bugfix] Timeout 10 sec for apache2 status
+
+Version 0.9.8-26-15 [2020-05-09]
+==================================================
+* [Feature] nginx templates that can prevent denial-of-service on your server
+* First tuning php-fpm pool.d config files (perfomances and limits)
+* New logo
+
+Version 0.9.8-26-14 [2020-05-08]
+==================================================
+* v-clone-website script switched to parameters
+* Display new version in console while updating myVesta
+
+Version 0.9.8-26-13 [2020-05-07]
+==================================================
+* [Feature] Put build date and version in right-bottom corner of control panel
+
+Version 0.9.8-26-12 [2020-05-07]
+==================================================
+* [Feature] Put build date and version while compiling myVesta
+* [Feature] Office365 DNS template
+* [Feature] Yandex DNS template
+* ProFTPD MaxIstances = 100 for fresh installed servers
+
+Version 0.9.8-26-11 [2020-05-01]
+==================================================
+* [Feature] Skipping LE renewing after 7 failed attempts
+* [Bugfix] Keep conf files during auto-update
+* [Bugfix] Do not restart apache while preparing letsencrypt acme challenge
+* [Bugfix] Set ALLOW_BACKUP_ANYTIME='yes' for fresh installed servers
+
+Version 0.9.8-26-10 [2020-04-11]
+==================================================
+* [Feature] Creating v-normalize-restored-user script (normalize NS1, NS2 and IP of account that is backuped on other server and restored on this server)
+* Tweak for hostname FPM conf
+* [Security] Forbid changing root password (Credits to Alexandre ZANNI, Orange Cyberdefense, https://cyberdefense.orange.com)
+* [Security] Importing system enviroment in v-change-user-password (Credits to Alexandre ZANNI, Orange Cyberdefense, https://cyberdefense.orange.com)
+
+Version 0.9.8-26-9 [2020-03-23]
+==================================================
+* [Security] Preventing manipulation with $SERVER['HTTP_HOST'] (Credits to @mdisec - Managing Partner of PRODAFT / INVICTUS A.Ş. Master ninja at pentest.blog)
+
+Version 0.9.8-26-8 [2020-03-23]
+==================================================
+* [Security] Temporary fix for parsing backup conf (Credits to @dreiggy - https://pentest.blog/vesta-control-panel-second-order-remote-code-execution-0day-step-by-step-analysis/)
+
+Version 0.9.8-26-7 [2020-03-18]
+==================================================
+* [Bugfix] Fix that avoid LetsEncrypt domain validation timeout
+* [Bugfix] Set timeout in v-list-sys-web-status script
+
+Version 0.9.8-26-6 [2020-02-21]
+==================================================
+* [Bugfix] mail-wrapper.php from now works
+* [Feature] Introducing NOTIFY_ADMIN_FULL_BACKUP, email notification about backup success status
+* [Feature] Introducing KEEP_N_FTP_BACKUPS, ability to limit number of remote FTP backups
+* [Feature] Introducing force-https-webmail-phpmyadmin nginx template
+* [Feature] Trigger for /root/update_firewall_custom.sh
+
+Version 0.9.8-26-5 [2020-02-10]
+==================================================
+* [Security] sudoers fix for Debian10
+* [Feature] [Script that will migrate your site from http to https, replacing http to https URLs in database](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/v-migrate-site-to-https)
+* [Feature] [Cloning script that will copy the whole site from one domain to another (sub)domain](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/v-clone-website)
+* [Feature] [Script that will install multiple PHP versions on your server](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/multi-php-install.sh)
+* [Bugfix] Roundcube force https
+* [Bugfix] Exim compatibility with Loopia for Debian10
+
+Version 0.9.8-26-4 [2020-01-07]
+==================================================
+* [Feature] Allow whitelisting specific IP for /api/
+* [Feature] Allow whitelisting specific IP to avoid secret_url
+* [Feature] Allow Softaculous in secure_login gateway
+* [Bugfix] apparmor install fix again
+* [Bugfix] Turning off MariaDB SQL strict mode
+
+Version 0.9.8-26-3 [2019-11-26]
+==================================================
+* [Bugfix] Better check if session cron already added
+
+Version 0.9.8-26-2 [2019-11-15]
+==================================================
+* [Feature] Support for sub-sub-sub-sub versions :))
+* [Bugfix] Support for longer username of email accounts
+* [Bugfix] apparmor install fix
+* [Bugfix] Trying to fix ClamAV broken socket
+* Moving to myvestacp.com
+
+Version 0.9.8-26 [2019-09-28]
+==================================================
+* [Bugfix] Let's Encrypt HTTP/2 support (by @serghey-rodin)
+* [Bugfix] Fixing broken autoreply output
+* [Feature] Multi-PHP support for PHP 7.4
+* [Feature] Multi-PHP installer for Debian 8
+* [Bugfix] Cron for removing old PHP sessions files
+* [Bugfix] New CloudFlare IPs
+* [Security] MySQL port blocked by default from outside
+* [Feature] Warning when server hostname is not pointing to server IP
+* [Feature] max_length_of_MySQL_username=80
+
+Older versions
+==================================================
+* Support for Debian 10 (previous Debian releases are also supported, but Debian 10 is recommended)
+* [Support for multi-PHP versions](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/multi-php-install.sh)
+* You can limit the maximum number of sent emails (per hour) [per mail account](https://github.com/myvesta/vesta/blob/master/install/debian/10/exim/exim4.conf.template#L105-L106) and [per hosting account](https://github.com/myvesta/vesta/blob/master/install/debian/10/exim/exim4.conf.template#L65-L66), preventing hijacking of email accounts and preventing PHP malware scripts to send spam.
+* You can see [what PHP scripts are sending emails](https://github.com/myvesta/vesta/blob/master/install/debian/10/php/php7.3-dedi.patch#L50), when and to whom
+* You can completely "lock" myVesta so it can be accessed only via **secret URL**, for example https://serverhost:8083/?MY-SECRET-URL
+ + Literally no PHP scripts will be alive on your hosting panel (won't be able to get executed), unless you access the hosting panel with secret URL parameter. Thus, when it happens that, let's say, some zero-day exploit pops up - attackers won't be able to access it without knowing your secret URL - PHP scripts from myVesta
+* We [disabled dangerous PHP functions](https://github.com/myvesta/vesta/blob/master/install/debian/10/php/php7.3-dedi.patch#L9) in php.ini, so even if, for example, your customer's CMS gets compromised, hacker will not be able to execute shell scripts from within PHP.
+* Apache is fully switched to mpm_event mode, while PHP is running in PHP-FPM mode, which is the most stable PHP-stack solution
+ + OPCache is turned on by default
+* Auto-generating LetsEncrypt SSL for server hostname (signed SSL for Vesta 8083 port, for dovecot (IMAP & POP3) and for Exim (SMTP))
+* You can change Vesta port during installation or later using one command line: **v-change-vesta-port [number]**
+* Backup will run with lowest priority (to avoid load on server), and can be configured to run only by night (and to stop on the morning and continue next night)
+* You can compile Vesta binaries by yourself
+* [Script that will convert Vesta to myVesta](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/convert-vesta-to-myvesta.sh)
+* [Wordpress installer in one second](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/create_wp_https)
+* [Script for importing cPanel backups to Vesta](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/cpanel-import.sh)
+* [Official Vesta Softaculous installer](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/install-softaculous.sh)
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index a515b12e..526e5166 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,23 +1,19 @@
-### Operating System (OS/VERSION):
+### Describe the problem:
-Type here, e.g. CentOS 6
-
-### VestaCP Version:
-
-Type here, e.g. 3.14159
-
-### Installed Software (what you got with the installer):
-
-Type here, e.g. php-fpm, apache, nginx, mysql
+Type here what is the problem
### Steps to Reproduce:
-Type here, e.g. install vesta and type rm -rf / --no-preserve-root
+Type here what we should do in order to see the bug on our test server
-### Related Issues/Forum Threads:
+### Debian version:
-Found anything that might be related to this? It might help us find the cause.
+Type here, example: Debian 10
-### Other Notes:
+### VestaCP Version:
-Anything else?
+Type here, example: 0.9.8.26-29
+
+### Installed Software (what you got with the installer):
+
+Copy here first 22 lines of file /usr/local/vesta/conf/vesta.conf
diff --git a/README.md b/README.md
index 3ff9c929..a2e7a3de 100644
--- a/README.md
+++ b/README.md
@@ -1,107 +1,95 @@
-News
-==================================================
-Forum:
-- https://forum.myvestacp.com/
+
-And we finally have normal homepage:
-- https://myvestacp.com/
+[](https://www.myvestacp.com/)
-myVesta Control Panel
-==================================================
+
-* myVesta is a fork of [VestaCP](https://vestacp.com/)
-* Focused on security and stability
-* Therefore, only Debian is supported - keeping focus on only one eco-system - not wasting energy on compatibility with other Linux distributions
-* However, it will be always synchronized with official VestaCP commits
-* VestaCP commercial plugins will be only available for purchase on official [vestacp.com](https://vestacp.com/) website - we will NOT take their earnings, since we are not making this fork for monetary reasons. Instead, we are doing this with open source in mind - to enhance security and to build new features, without being interlocked with official VestaCP release cycles, and without affecting or heavily diverting from the VestaCP's planned development milestones
-* With previous in mind, all features that are built for this fork (myVesta), will be offered to official VestaCP, via pull requests
+
About
-Features of myVesta
-==================================================
+
myVesta is a security and stability-focused fork of VestaCP, exclusively supporting Debian in order to maintain a streamlined ecosystem. Boasting a clean, clutter-free interface and the latest innovative technologies, our project is committed to staying synchronized with official VestaCP commits. We work independently to enhance security and develop new features, driven by our passion for contributing to the open-source community rather than monetary gain. As such, we will offer all features built for myVesta to the official VestaCP project through pull requests, without interfering with their development milestones.
-+ Support for Debian 10 (previous Debian releases are also supported, but Debian 10 is recommended)
+
-+ [nginx templates](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/rate-limit-tpl/install_rate_limit_tpl.sh) that can prevent denial-of-service on your server
+
-+ [Support for multi-PHP versions](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/multi-php-install.sh)
-
-+ You can limit the maximum number of sent emails (per hour) [per mail account](https://github.com/myvesta/vesta/blob/master/install/debian/10/exim/exim4.conf.template#L105-L106) and [per hosting account](https://github.com/myvesta/vesta/blob/master/install/debian/10/exim/exim4.conf.template#L65-L66), preventing hijacking of email accounts and preventing PHP malware scripts to send spam.
-
-+ You can see [what PHP scripts are sending emails](https://github.com/myvesta/vesta/blob/master/install/debian/10/php/php7.3-dedi.patch#L50), when and to whom
-
-+ You can completely "lock" myVesta so it can be accessed only via **secret URL**, for example https://serverhost:8083/?MY-SECRET-URL
- + During installation you will be asked to choose a secret URL for your hosting panel
- + Literally no PHP scripts will be alive on your hosting panel (won't be able to get executed), unless you access the hosting panel with secret URL parameter. Thus, when it happens that, let's say, some zero-day exploit pops up - attackers won't be able to access it without knowing your secret URL - PHP scripts from VestaCP will be simply dead - no one will be able to interact with your panel unless they have the secret URL.
- + You can see for yourself how this mechanism was built by looking at:
- + https://github.com/myvesta/vesta/blob/master/src/deb/for-download/php/php.ini#L496
- + https://github.com/myvesta/vesta/blob/master/web/inc/secure_login.php
- + If you didn't set the secret URL during installation, you can do it anytime. Just execute in shell:
- + `echo " /usr/local/vesta/web/inc/login_url.php`
-
-+ We [disabled dangerous PHP functions](https://github.com/myvesta/vesta/blob/master/install/debian/10/php/php7.3-dedi.patch#L9) in php.ini, so even if, for example, your customer's CMS gets compromised, hacker will not be able to execute shell scripts from within PHP.
-
-+ Apache is fully switched to mpm_event mode, while PHP is running in PHP-FPM mode, which is the most stable PHP-stack solution
- + OPCache is turned on by default
-
-+ Auto-generating LetsEncrypt SSL for server hostname (signed SSL for Vesta 8083 port, for dovecot (IMAP & POP3) and for Exim (SMTP))
-
-+ You can change Vesta port during installation or later using one command line: **v-change-vesta-port [number]**
-
-+ ClamAV is configured to block zip/rar/7z archives that contains executable files (just like GMail)
-
-+ Backup will run with lowest priority (to avoid load on server), and can be configured to run only by night (and to stop on the morning and continue next night)
-
-+ You can compile Vesta binaries by yourself - https://github.com/myvesta/vesta/blob/master/src/deb/vesta_compile.sh
- + You can even create your own APT repository in a minute
- + We are using latest nginx version for vesta-nginx package
- + With your own APT infrastructure you can take security of Vesta-installer infrastructure in your own hands. You will have full control of your Vesta code (this way you can rest assured that there's 0% chance that you'll install malicious packages from repositories that may get hacked)
- + Binaries that you compile are 100% compatible with official VestaCP from vestacp.com, so you can run official VestaCP code with your own binaries (in case you don't want the source code from this fork)
-
-Useful tools
-==================================================
-
-+ [Script that will convert Vesta to myVesta](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/convert-vesta-to-myvesta.sh)
-
-+ [Wordpress installer in one second](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/create_wp_https)
-
-+ [Script for importing cPanel backups to Vesta](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/cpanel-import.sh)
-
-+ [Cloning script that will copy the whole site from one domain to another (sub)domain](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/v-clone-website)
-
-+ [Script that will migrate your site from http to https, replacing http to https URLs in database](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/v-migrate-site-to-https)
-
-+ [Script that will install multiple PHP versions on your server](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/multi-php-install.sh)
-
-+ [Script that will install nginx templates that can prevent denial-of-service on your server](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/rate-limit-tpl/install_rate_limit_tpl.sh)
-
-+ [Official Vesta Softaculous installer](https://github.com/myvesta/vesta/blob/master/src/deb/for-download/tools/install-softaculous.sh)
-
-
-How to install
-----------------------------
+
Features of myVesta
+
+
Support for Debian 11 and 12 (Debian 12 is recommended, but previous Debian releases are also supported)
+
Support for MySQL 8
+
nginx templates that can prevent denial-of-service on your server
You can limit the maximum number of sent emails (per hour) per mail account and per hosting account, preventing hijacking of email accounts and preventing PHP malware scripts to send spam.
+
+ You can completely "lock" myVesta so it can be accessed only via secret URL, for example https://serverhost:8083/?MY-SECRET-URL
+
+
During installation you will be asked to choose a secret URL for your hosting panel
+
Literally no PHP scripts will be alive on your hosting panel (won't be able to get executed), unless you access the hosting panel with secret URL parameter. Thus, when it happens that, let's say, some zero-day exploit pops up - attackers won't be able to access it without knowing your secret URL - PHP scripts from VestaCP will be simply dead - no one will be able to interact with your panel unless they have the secret URL.
+
You can see for yourself how this mechanism was built by looking at:
If you didn't set the secret URL during installation, you can do it anytime. Just execute in shell: echo "<?php \$login_url='MY-SECRET-URL';" > /usr/local/vesta/web/inc/login_url.php
+
+
+
We disabled dangerous PHP functions in php.ini, so even if, for example, your customer's CMS gets compromised, hacker will not be able to execute shell scripts from within PHP.
+
Apache is fully switched to mpm_event mode, while PHP is running in PHP-FPM mode, which is the most stable PHP-stack solution
+
OPCache is turned on by default
+
Auto-generating LetsEncrypt SSL for server hostname (signed SSL for Vesta 8083 port, for dovecot (IMAP & POP3) and for Exim (SMTP))
+
You can change Vesta port during installation or later using one command line: v-change-vesta-port [number]
+
ClamAV is configured to block zip/rar/7z archives that contains executable files (just like GMail)
+
Backup will run with lowest priority (to avoid load on server), and can be configured to run only by night (and to stop on the morning and continue next night)
You can even create your own APT repository in a minute
+
We are using latest nginx version for vesta-nginx package
+
With your own APT infrastructure you can take security of Vesta-installer infrastructure in your own hands. You will have full control of your Vesta code (this way you can rest assured that there's 0% chance that you'll install malicious packages from repositories that may get hacked)
+
Binaries that you compile are 100% compatible with official VestaCP from vestacp.com, so you can run official VestaCP code with your own binaries (in case you don't want the source code from this fork)
+
+
+
+
+
+
How to install
Download the installation script:
-```bash
+
+```shell
curl -O http://c.myvestacp.com/vst-install-debian.sh
```
+
Then run it:
-```bash
+
+```shell
bash vst-install-debian.sh
```
-About VestaCP
-==================================================
+Or use our installer generator.
-* [Vesta](https://vestacp.com/) is an open source hosting control panel.
-* Vesta has a clean and focused interface without clutter.
-* Vesta has the latest of very innovative technologies.
+
-Special thanks to vestacp.com and Serghey Rodin for open-source VestaCP project
-License
-----------------------------
-Vesta is licensed under [GPL v3 ](https://github.com/serghey-rodin/vesta/blob/master/LICENSE) license
+
Licence
+myVesta is licensed under GPL v3 license.
+
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000..32d7405f
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,5 @@
+# Security Policy
+
+## Reporting a Vulnerability
+
+Please report security issues to info@myvestacp.com
diff --git a/bin/v-activate-rocket-nginx b/bin/v-activate-rocket-nginx
new file mode 100644
index 00000000..8b562c9b
--- /dev/null
+++ b/bin/v-activate-rocket-nginx
@@ -0,0 +1,144 @@
+#!/bin/bash
+# info: Install rocket-nginx extension for certain domain
+# options: DOMAIN
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/domain.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ echo "User doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "Domain doesn't exist";
+ exit 1;
+fi
+
+if [ ! -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then
+ echo 'Please install WordPress first.'
+ exit 1;
+fi
+
+if [ ! -d "/etc/nginx/rocket-nginx" ]; then
+ echo "rocket-nginx is not installed";
+ echo "Do you want to install it now (y/n)?"
+ read answer
+ if [ "$answer" == "y" ]; then
+ echo "Installing rocket-nginx..."
+ curl -sL https://c.myvestacp.com/tools/install-rocket-nginx.sh | bash -
+ else
+ echo "Exiting script"
+ exit 1;
+ fi
+fi
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Changing Proxy Template
+# Check if the proxy template is already set correctly
+current_template=$(/usr/local/vesta/bin/v-list-web-domain $user $domain | grep 'PROXY:' | awk '{print $2}')
+if [ "$current_template" == "wprocket-force-https" ] || [ "$current_template" == "wprocket-hosting" ] || [ "$current_template" == "wprocket-webp-express-force-https" ]; then
+ echo "Proxy Template is already set up correctly"
+else
+ # Prompt the user to choose whether to force HTTPS or not
+ echo "Do you want to use wprocket-hosting template, wprocket-force-https template or wprocket-webp-express-force-https template (h/f/w):"
+ read answer
+
+ # Change the proxy template based on the user's choice
+ if [ "$answer" == "h" ]; then
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-hosting"
+ elif [ "$answer" == "f" ]; then
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-force-https"
+ elif [ "$answer" == "w" ]; then
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "wprocket-webp-express-force-https"
+ fi
+
+ echo "Proxy Template is ready"
+fi
+
+# Disabling wp-cron in wp-config.php
+cd /home/$user/web/$domain/public_html
+checkstring_disable="define('DISABLE_WP_CRON', true)"
+checkstring_enable="define('DISABLE_WP_CRON', false)"
+string_disable="define( 'DISABLE_WP_CRON', true );"
+line="/home/$user/web/$domain/cron.log" | grep -v "grep")
+
+if [ ! -z "$existing_cron" ]; then
+ echo "There is already a cron job added for user $user and domain $domain."
+else
+ echo "Adding cron job..."
+ # Add the cron job
+ fpm_ver=$(/usr/local/vesta/bin/v-get-php-version-of-domain "$domain")
+ touch /home/$user/web/$domain/cron.log
+ chown $user:$user /home/$user/web/$domain/cron.log
+
+ case $fpm_ver in
+ 5.6 | 7.0 | 7.1 | 7.2 | 7.3 | 7.4 | 8.0 | 8.1 | 8.2 | 8.3)
+ /usr/local/vesta/bin/v-add-cron-job "$user" "*/15" "*" "*" "*" "*" "cd /home/$user/web/$domain/public_html; /usr/bin/php$fpm_ver wp-cron.php >/home/$user/web/$domain/cron.log 2>&1"
+ ;;
+ esac
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+echo "Installation is completed."
+echo "Checking RESPONSE HEADERS (You should see x-rocket-nginx-serving-static if the WP Rocket plugin is activated):"
+curl -I https://$domain
+
+exit
diff --git a/bin/v-activate-vesta-license b/bin/v-activate-vesta-license
index 6d5c875e..8d9ebd20 100755
--- a/bin/v-activate-vesta-license
+++ b/bin/v-activate-vesta-license
@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
# Checking arg number
check_args '2' "$#" 'MODULE LICENSE'
-
+is_user_format_valid "$license" "license"
#----------------------------------------------------------#
# Action #
@@ -35,7 +35,7 @@ check_args '2' "$#" 'MODULE LICENSE'
# Activating license
v_host='https://vestacp.com/checkout'
-answer=$(curl -s $v_host/activate.php?licence_key=$license&module=$module)
+answer=$(curl --max-time 60 -s $v_host/activate.php?licence_key=$license&module=$module)
check_result $? "cant' connect to vestacp.com " $E_CONNECT
# Checking server answer
diff --git a/bin/v-add-firewall-ban b/bin/v-add-firewall-ban
index a1eed13e..80143132 100755
--- a/bin/v-add-firewall-ban
+++ b/bin/v-add-firewall-ban
@@ -72,6 +72,13 @@ $iptables -I fail2ban-$chain 1 -s $ip \
# Changing permissions
chmod 660 $conf
+# nginx deny rules conf
+if [ "$chain" = "WEB" ] && [ -f "/etc/nginx/conf.d/block.conf" ]; then
+ if ! grep -q "deny $ip;" /etc/nginx/conf.d/block.conf; then
+ echo "deny $ip;" >> /etc/nginx/conf.d/block.conf
+ systemctl reload nginx
+ fi
+fi
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-add-firewall-rule b/bin/v-add-firewall-rule
index 6fb867d3..b815778b 100755
--- a/bin/v-add-firewall-rule
+++ b/bin/v-add-firewall-rule
@@ -83,6 +83,16 @@ sort_fw_rules
# Updating system firewall
$BIN/v-update-firewall
+if [ "$WEB_SYSTEM" == 'nginx' ] || [ "$PROXY_SYSTEM" == 'nginx' ]; then
+ if [ "$port_ext" == "80,443" ] && [ "$action" == "DROP" ]; then
+ touch /etc/nginx/conf.d/block-firewall.conf
+ if ! grep -q "deny $ip;" /etc/nginx/conf.d/block-firewall.conf; then
+ echo "deny $ip;" >> /etc/nginx/conf.d/block-firewall.conf
+ systemctl restart nginx
+ fi
+ fi
+fi
+
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-add-letsencrypt-domain b/bin/v-add-letsencrypt-domain
index 57b764da..a7c7fbb8 100755
--- a/bin/v-add-letsencrypt-domain
+++ b/bin/v-add-letsencrypt-domain
@@ -17,6 +17,12 @@ aliases=$3
# LE API
API='https://acme-v02.api.letsencrypt.org'
+if [[ "$LE_STAGING" = 'yes' ]]; then
+ API='https://acme-staging-v02.api.letsencrypt.org'
+fi
+
+deb_release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
@@ -53,8 +59,15 @@ query_le_v2() {
post_data=$post_data'"payload":"'"$payload_"'",'
post_data=$post_data'"signature":"'"$signature_"'"}'
- curl -s -i -d "$post_data" "$1" -H "$content"
-}
+ # Save http response to file passed as "$4" arg or print to stdout if not provided
+ # http response headers are always sent to stdout
+ local save_to_file=${4:-"/dev/stdout"}
+ if [ "$deb_release" -gt 8 ]; then
+ curl --location --user-agent "myVesta" --insecure --retry 5 --retry-connrefused --silent --dump-header /dev/stdout --data "$post_data" "$1" --header "$content" --output "$save_to_file"
+ else
+ curl --location --user-agent "myVesta" --insecure --retry 5 --silent --dump-header /dev/stdout --data "$post_data" "$1" --header "$content" --output "$save_to_file"
+ fi
+ }
@@ -70,11 +83,16 @@ is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
is_object_unsuspended 'web' 'DOMAIN' "$domain"
get_domain_values 'web'
+
+echo "-----------------------------------------------------------------------------------" >> /usr/local/vesta/log/letsencrypt.log
+echo "[$(date)] : v-add-letsencrypt-domain $domain [$aliases]" >> /usr/local/vesta/log/letsencrypt.log
+
# check if alias is the letsencrypt wildcard domain, if not, make the normal checks
if [[ "$aliases" != "*.$domain" ]]; then
for alias in $(echo "$aliases" |tr ',' '\n' |sort -u); do
check_alias="$(echo $ALIAS |tr ',' '\n' |grep ^$alias$)"
if [ -z "$check_alias" ]; then
+ echo "[$(date)] : EXIT=domain alias $alias doesn't exist" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_NOTEXIST "domain alias $alias doesn't exist"
fi
done
@@ -85,11 +103,14 @@ fi;
#----------------------------------------------------------#
# Registering LetsEncrypt user account
+echo "[$(date)] : v-add-letsencrypt-user $user" >> /usr/local/vesta/log/letsencrypt.log
$BIN/v-add-letsencrypt-user $user
+echo "[$(date)] : result: $?" >> /usr/local/vesta/log/letsencrypt.log
if [ "$?" -ne 0 ]; then
touch $VESTA/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
send_notice "LETSENCRYPT" "Account registration failed"
+ echo "[$(date)] : EXIT=LE account registration" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "LE account registration" >/dev/null
fi
@@ -98,9 +119,11 @@ source $USER_DATA/ssl/le.conf
# Checking wildcard alias
if [ "$aliases" = "*.$domain" ]; then
+ echo "[$(date)] : Checking wildcard alias" >> /usr/local/vesta/log/letsencrypt.log
wildcard='yes'
proto="dns-01"
if [ ! -e "$VESTA/data/users/$user/dns/$domain.conf" ]; then
+ echo "[$(date)] : EXIT=DNS domain $domain doesn't exist" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_NOTEXIST "DNS domain $domain doesn't exist"
fi
else
@@ -108,14 +131,21 @@ else
fi
# Requesting nonce / STEP 1
-answer=$(curl -s -I "$API/directory")
+echo "[$(date)] : --- Requesting nonce / STEP 1 ---" >> /usr/local/vesta/log/letsencrypt.log
+echo "[$(date)] : curl -s -I \"$API/directory\"" >> /usr/local/vesta/log/letsencrypt.log
+answer=$(curl --user-agent "myVesta" -s -I "$API/directory")
+echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
+echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
+echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then
+ echo "[$(date)] : EXIT=Let's Encrypt nonce request status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt nonce request status $status"
fi
# Placing new order / STEP 2
+echo "[$(date)] : --- Placing new order / STEP 2 ---" >> /usr/local/vesta/log/letsencrypt.log
url="$API/acme/new-order"
payload='{"identifiers":['
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
@@ -124,38 +154,79 @@ for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
done
payload=$(echo "$payload"|sed "s/,$//")
payload=$payload']}'
+# validation='pending'
+# # Start counter to avoid infinite loop
+# i=0
+# while [ "$validation" = 'pending' ]; do
+# echo "[$(date)] : ----------------------- step 2 loop, counter \$i=$i -----------------------" >> /usr/local/vesta/log/letsencrypt.log
+echo "[$(date)] : payload=$payload" >> /usr/local/vesta/log/letsencrypt.log
+echo "[$(date)] : query_le_v2 \"$url\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(query_le_v2 "$url" "$payload" "$nonce")
+echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
+echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
authz=$(echo "$answer" |grep "acme/authz" |cut -f2 -d '"')
+echo "[$(date)] : authz=$authz" >> /usr/local/vesta/log/letsencrypt.log
finalize=$(echo "$answer" |grep 'finalize":' |cut -f4 -d '"')
+echo "[$(date)] : finalize=$finalize" >> /usr/local/vesta/log/letsencrypt.log
+order=$(echo -e "$answer" | grep -i location | cut -f2 -d \ | tr -d '\r\n')
+echo "[$(date)] : order=$order" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer" |grep HTTP/ |tail -n1 |cut -f2 -d ' ')
+echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
+validation=$(echo "$answer" | grep 'status":' | cut -f4 -d '"')
+echo "[$(date)] : validation=$validation" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 201 ]]; then
+ echo "[$(date)] : EXIT=Let's Encrypt new auth status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt new auth status $status"
fi
+# # Exit the loop after 5 attempts
+# i=$((i + 1))
+# if [ $i -gt 5 ]; then
+# break
+# fi
+# sleep 2
+# done
# Requesting authorization token / STEP 3
+echo "[$(date)] : --- Requesting authorization token / STEP 3 ---" >> /usr/local/vesta/log/letsencrypt.log
for auth in $authz; do
payload=''
+ echo "[$(date)] : for auth=$auth" >> /usr/local/vesta/log/letsencrypt.log
+ echo "[$(date)] : query_le_v2 \"$auth\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(query_le_v2 "$auth" "$payload" "$nonce")
+ echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
url=$(echo "$answer" |grep -A3 $proto |grep url |cut -f 4 -d \")
+ echo "[$(date)] : url=$url" >> /usr/local/vesta/log/letsencrypt.log
token=$(echo "$answer" |grep -A3 $proto |grep token |cut -f 4 -d \")
+ echo "[$(date)] : token=$token" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
+ echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
+ echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then
+ echo "[$(date)] : EXIT=Let's Encrypt acme/authz bad status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt acme/authz bad status $status"
fi
- # Accepting challenge / STEP 4
+ # Configuring challenge / STEP 4
+ echo "[$(date)] : --- Configuring challenge / STEP 4 ---" >> /usr/local/vesta/log/letsencrypt.log
+ echo "[$(date)] : wildcard=$wildcard" >> /usr/local/vesta/log/letsencrypt.log
if [ "$wildcard" = 'yes' ]; then
record=$(printf "%s" "$token.$THUMB" |\
openssl dgst -sha256 -binary |encode_base64)
old_records=$($BIN/v-list-dns-records $user $domain plain|grep 'TXT')
old_records=$(echo "$old_records" |grep _acme-challenge |cut -f 1)
for old_record in $old_records; do
- $BIN/v-delete-dns-record $user $domain $old_record
+ $BIN/v-delete-dns-record "$user" "$domain" "$old_record"
done
- $BIN/v-add-dns-record $user $domain "_acme-challenge" "TXT" $record
- check_result $? "DNS _acme-challenge record wasn't created"
+ $BIN/v-add-dns-record "$user" "$domain" "_acme-challenge" "TXT" "$record"
+ exitstatus=$?
+ echo "[$(date)] : v-add-dns-record \"$user\" \"$domain\" \"_acme-challenge\" \"TXT\" \"$record\"" >> /usr/local/vesta/log/letsencrypt.log
+ if [ "$exitstatus" -ne 0 ]; then
+ echo "[$(date)] : EXIT=DNS _acme-challenge record wasn't created" >> /usr/local/vesta/log/letsencrypt.log
+ fi
+ check_result $exitstatus "DNS _acme-challenge record wasn't created"
+ systemctl restart bind9
else
if [ "$WEB_SYSTEM" = 'nginx' ] || [ ! -z "$PROXY_SYSTEM" ]; then
if [ -f "/usr/local/vesta/web/inc/nginx_proxy" ]; then
@@ -164,23 +235,35 @@ for auth in $authz; do
acme_challenge="$well_known/acme-challenge"
mkdir -p $acme_challenge
echo "$token.$THUMB" > $acme_challenge/$token
+ echo "[$(date)] : in $acme_challenge/$token we put: $token.$THUMB" >> /usr/local/vesta/log/letsencrypt.log
chown -R $user:$user $well_known
else
# default nginx method
conf="$HOMEDIR/$user/conf/web/nginx.$domain.conf_letsencrypt"
sconf="$HOMEDIR/$user/conf/web/snginx.$domain.conf_letsencrypt"
- if [ ! -e "$conf" ]; then
+ # if [ ! -e "$conf" ]; then
echo 'location ~ "^/\.well-known/acme-challenge/(.*)$" {' \
> $conf
echo ' default_type text/plain;' >> $conf
echo ' return 200 "$1.'$THUMB'";' >> $conf
echo '}' >> $conf
- fi
+ # fi
+ echo "[$(date)] : in $conf we put: $THUMB" >> /usr/local/vesta/log/letsencrypt.log
if [ ! -e "$sconf" ]; then
ln -s "$conf" "$sconf"
fi
+ echo "[$(date)] : v-restart-proxy" >> /usr/local/vesta/log/letsencrypt.log
$BIN/v-restart-proxy
- check_result $? "Proxy restart failed" >/dev/null
+ if [ -z "$PROXY_SYSTEM" ]; then
+ # apache-less variant
+ echo "[$(date)] : v-restart-web" >> /usr/local/vesta/log/letsencrypt.log
+ $BIN/v-restart-web
+ fi
+ exitstatus=$?
+ if [ "$exitstatus" -ne 0 ]; then
+ echo "[$(date)] : EXIT=Proxy restart failed = $exitstatus" >> /usr/local/vesta/log/letsencrypt.log
+ fi
+ check_result $exitstatus "Proxy restart failed" >/dev/null
fi
else
well_known="$HOMEDIR/$user/web/$domain/public_html/.well-known"
@@ -188,13 +271,16 @@ for auth in $authz; do
mkdir -p $acme_challenge
echo "$token.$THUMB" > $acme_challenge/$token
chown -R $user:$user $well_known
+ echo "[$(date)] : in $acme_challenge/$token we put: $token.$THUMB" >> /usr/local/vesta/log/letsencrypt.log
# $BIN/v-restart-web
# check_result $? "Web restart failed" >/dev/null
fi
fi
# Requesting ACME validation / STEP 5
+ echo "[$(date)] : --- Requesting ACME validation / STEP 5 ---" >> /usr/local/vesta/log/letsencrypt.log
validation_check=$(echo "$answer" |grep '"valid"')
+ echo "[$(date)] : validation_check=$validation_check" >> /usr/local/vesta/log/letsencrypt.log
if [[ ! -z "$validation_check" ]]; then
validation='valid'
else
@@ -204,22 +290,54 @@ for auth in $authz; do
# Doing pol check on status
i=1
while [ "$validation" = 'pending' ]; do
- payload='{}'
- answer=$(query_le_v2 "$url" "$payload" "$nonce")
- validation=$(echo "$answer"|grep -A1 $proto |tail -n1|cut -f4 -d \")
- nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
- status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
+ i=0
+ while true; do
+ echo "[$(date)] : ----------------------- Doing pol check on status, counter \$i=$i -----------------------" >> /usr/local/vesta/log/letsencrypt.log
+ payload='{}'
+ echo "[$(date)] : query_le_v2 \"$url\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
+ answer=$(query_le_v2 "$url" "$payload" "$nonce")
+ echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
+ url2=$(echo "$answer" |grep -A3 $proto |grep url |cut -f 4 -d \")
+ echo "[$(date)] : url2=$url2" >> /usr/local/vesta/log/letsencrypt.log
+ validation=$(echo "$answer"|grep -A1 $proto |tail -n1|cut -f4 -d \")
+ echo "[$(date)] : validation=$validation" >> /usr/local/vesta/log/letsencrypt.log
+ nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
+ echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
+ status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
+ echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
+ if [[ $(echo "$answer" | grep 'addressesResolved') != "" ]]; then
+ break
+ fi
+ if [ "$wildcard" = 'yes' ]; then
+ if [[ $(echo "$answer" | grep '"status": "valid"') != "" ]]; then
+ break
+ fi
+ fi
+ i=$((i + 1))
+ if ((i > 30)); then
+ break
+ fi
+ sleep 2
+ done
if [[ "$status" -ne 200 ]]; then
+ echo "[$(date)] : EXIT=Let's Encrypt validation status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt validation status $status"
fi
i=$((i + 1))
if [ "$i" -gt 10 ]; then
+ echo "[$(date)] : EXIT=Let's Encrypt domain validation timeout" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt domain validation timeout"
fi
- sleep $((i*2))
+ echo "[$(date)] : curl: $url2 :" >> /usr/local/vesta/log/letsencrypt.log
+ get_answer=$(curl --user-agent "myVesta" --silent -S "$url2")
+ echo "[$(date)] : get_answer=$get_answer" >> /usr/local/vesta/log/letsencrypt.log
+ sleeping=$((i*2))
+ echo "[$(date)] : sleep $sleeping (i=$i)" >> /usr/local/vesta/log/letsencrypt.log
+ sleep $sleeping
done
if [ "$validation" = 'invalid' ]; then
+ echo "[$(date)] : EXIT=Let's Encrypt domain verification failed" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt domain verification failed"
fi
done
@@ -230,37 +348,102 @@ ssl_dir=$($BIN/v-generate-ssl-cert "$domain" "info@$domain" "US" "California"\
"San Francisco" "Vesta" "IT" "$aliases" |tail -n1 |awk '{print $2}')
# Sending CSR to finalize order / STEP 6
+echo "[$(date)] : --- Sending CSR to finalize order / STEP 6 ---" >> /usr/local/vesta/log/letsencrypt.log
+
csr=$(openssl req -in $ssl_dir/$domain.csr -outform DER |encode_base64)
payload='{"csr":"'$csr'"}'
+echo "[$(date)] : query_le_v2 \"$finalize\" \"$payload\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
answer=$(query_le_v2 "$finalize" "$payload" "$nonce")
+echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
+echo "[$(date)] : nonce=$nonce" >> /usr/local/vesta/log/letsencrypt.log
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
+echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
certificate=$(echo "$answer"|grep 'certificate":' |cut -f4 -d '"')
+echo "[$(date)] : certificate=$certificate" >> /usr/local/vesta/log/letsencrypt.log
if [[ "$status" -ne 200 ]]; then
+ echo "[$(date)] : EXIT=Let's Encrypt finalize bad status $status" >> /usr/local/vesta/log/letsencrypt.log
check_result $E_CONNECT "Let's Encrypt finalize bad status $status"
fi
-# Downloading signed certificate / STEP 7
-curl -s "$certificate" -o $ssl_dir/$domain.pem
+if [ "$nonce" = "" ]; then
+ echo "[$(date)] : EXIT=Let's Encrypt 'nonce' is empty after step 6" >> /usr/local/vesta/log/letsencrypt.log
+ check_result $E_CONNECT "Let's Encrypt 'nonce' is empty after step 6"
+fi
+
+if [ "$certificate" = "" ]; then
+ validation="processing"
+ i=1
+ while [ "$validation" = "processing" ]; do
+ echo "[$(date)] : --- Polling server waiting for Certificate / STEP 7 ---" >> /usr/local/vesta/log/letsencrypt.log
+ answer=$(query_le_v2 "$order" "" "$nonce")
+ i=$((i + 1))
+
+ nonce=$(echo "$answer" | grep -i nonce | cut -f2 -d \ | tr -d '\r\n')
+ echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
+ status=$(echo "$answer" | grep HTTP/ | tail -n1 | cut -f 2 -d ' ')
+ echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
+ validation=$(echo "$answer" | grep 'status":' | cut -f4 -d '"')
+ echo "[$(date)] : validation=$validation" >> /usr/local/vesta/log/letsencrypt.log
+ certificate=$(echo "$answer" | grep 'certificate":' | cut -f4 -d '"')
+ echo "[$(date)] : certificate=$certificate" >> /usr/local/vesta/log/letsencrypt.log
+ sleep $((i * 2)) # Sleep for 2s, 4s, 6s, 8s
+ if [ $i -gt 10 ]; then
+ check_result "$E_CONNECT" "Certificate processing timeout ($domain)"
+ fi
+ done
+fi
+
+if [ "$certificate" = "" ]; then
+ echo "[$(date)] : EXIT=Let's Encrypt 'certificate' is empty after step 7" >> /usr/local/vesta/log/letsencrypt.log
+ check_result $E_CONNECT "Let's Encrypt 'certificate' is empty after step 7"
+fi
+
+# Downloading signed certificate / STEP 8
+echo "[$(date)] : --- Downloading signed certificate / STEP 8 ---" >> /usr/local/vesta/log/letsencrypt.log
+echo "[$(date)] : query_le_v2 \"$certificate\" \"\" \"$nonce\"" >> /usr/local/vesta/log/letsencrypt.log
+answer=$(query_le_v2 "$certificate" "" "$nonce" "$ssl_dir/$domain.pem")
+echo "[$(date)] : answer=$answer" >> /usr/local/vesta/log/letsencrypt.log
+status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
+echo "[$(date)] : status=$status" >> /usr/local/vesta/log/letsencrypt.log
+if [[ "$status" -ne 200 ]]; then
+ [ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
+ echo "[$(date)] : EXIT=Let's Encrypt downloading signed cert failed status: $status" >> /usr/local/vesta/log/letsencrypt.log
+ check_result $E_NOTEXIST "Let's Encrypt downloading signed cert failed status: $status"
+fi
# Splitting up downloaded pem
-crt_end=$(grep -n END $ssl_dir/$domain.pem |head -n1 |cut -f1 -d:)
+# echo "[$(date)] : - Splitting up downloaded pem" >> /usr/local/vesta/log/letsencrypt.log
+crt_end=$(grep -n 'END CERTIFICATE' $ssl_dir/$domain.pem |head -n1 |cut -f1 -d:)
+# echo "[$(date)] : crt_end=$crt_end" >> /usr/local/vesta/log/letsencrypt.log
head -n $crt_end $ssl_dir/$domain.pem > $ssl_dir/$domain.crt
pem_lines=$(wc -l $ssl_dir/$domain.pem |cut -f 1 -d ' ')
-ca_end=$(grep -n "BEGIN" $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :)
+# echo "[$(date)] : pem_lines=$pem_lines" >> /usr/local/vesta/log/letsencrypt.log
+ca_end=$(grep -n 'BEGIN CERTIFICATE' $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :)
+# echo "[$(date)] : ca_end=$ca_end" >> /usr/local/vesta/log/letsencrypt.log
ca_end=$(( pem_lines - crt_end + 1 ))
+# echo "[$(date)] : ca_end=$ca_end" >> /usr/local/vesta/log/letsencrypt.log
tail -n $ca_end $ssl_dir/$domain.pem > $ssl_dir/$domain.ca
+# Temporary fix for double "END CERTIFICATE"
+if [[ $(head -n 1 $ssl_dir/$domain.ca) = "-----END CERTIFICATE-----" ]]; then
+ sed -i '1,2d' $ssl_dir/$domain.ca
+fi
+
# Adding SSL
ssl_home=$(search_objects 'web' 'LETSENCRYPT' 'yes' 'SSL_HOME')
$BIN/v-delete-web-domain-ssl $user $domain >/dev/null 2>&1
+echo "[$(date)] : v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home" >> /usr/local/vesta/log/letsencrypt.log
$BIN/v-add-web-domain-ssl $user $domain $ssl_dir $ssl_home
-if [ "$?" -ne '0' ]; then
+exitstatus=$?
+echo "[$(date)] : v-add-web-domain-ssl status: $exitstatus" >> /usr/local/vesta/log/letsencrypt.log
+if [ "$exitstatus" -ne '0' ]; then
touch $VESTA/data/queue/letsencrypt.pipe
sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
+ echo "[$(date)] : EXIT=$domain certificate installation failed" >> /usr/local/vesta/log/letsencrypt.log
send_notice 'LETSENCRYPT' "$domain certificate installation failed"
- check_result $? "SSL install" >/dev/null
+ check_result $exitstatus "SSL install" >/dev/null
fi
# Adding LE autorenew cronjob
@@ -289,7 +472,7 @@ sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
# Notifying user
send_notice 'LETSENCRYPT' "$domain SSL has been installed successfully"
-
+echo "[$(date)] : EXIT=***** $domain SSL has been installed successfully *****" >> /usr/local/vesta/log/letsencrypt.log
# Logging
log_event "$OK" "$ARGUMENTS"
diff --git a/bin/v-add-letsencrypt-user b/bin/v-add-letsencrypt-user
index 11aec113..d2338e82 100755
--- a/bin/v-add-letsencrypt-user
+++ b/bin/v-add-letsencrypt-user
@@ -15,6 +15,10 @@ user=$1
# LE API
API='https://acme-v02.api.letsencrypt.org'
+if [[ "$LE_STAGING" = 'yes' ]]; then
+ API='https://acme-staging-v02.api.letsencrypt.org'
+fi
+
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
@@ -41,7 +45,7 @@ query_le_v2() {
post_data=$post_data'"payload":"'"$payload_"'",'
post_data=$post_data'"signature":"'"$signature_"'"}'
- curl -s -i -d "$post_data" "$1" -H "$content"
+ curl --user-agent "myVesta" -s -i -d "$post_data" "$1" -H "$content"
}
diff --git a/bin/v-add-mail-account b/bin/v-add-mail-account
index 44925680..81da9e71 100755
--- a/bin/v-add-mail-account
+++ b/bin/v-add-mail-account
@@ -61,8 +61,14 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
fi
str="$account:$md5:$user:mail::$HOMEDIR/$user:$quota"
echo $str >> $HOMEDIR/$user/conf/mail/$domain/passwd
+ userstr="$account:$account:$user:mail:$HOMEDIR/$user"
+ echo $userstr >> $HOMEDIR/$user/conf/mail/$domain/accounts
fi
+# Create mail account folder (mailbox)
+mkdir $HOMEDIR/$user/mail/$domain/$account
+chown $user:mail $HOMEDIR/$user/mail/$domain/$account
+chmod 700 $HOMEDIR/$user/mail/$domain/$account
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-add-mail-domain b/bin/v-add-mail-domain
index 7c9dbc36..c26dadb2 100755
--- a/bin/v-add-mail-domain
+++ b/bin/v-add-mail-domain
@@ -91,6 +91,7 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
touch $HOMEDIR/$user/conf/mail/$domain/aliases
touch $HOMEDIR/$user/conf/mail/$domain/passwd
touch $HOMEDIR/$user/conf/mail/$domain/fwd_only
+ touch $HOMEDIR/$user/conf/mail/$domain/accounts
ln -s $HOMEDIR/$user/conf/mail/$domain \
/etc/$MAIL_SYSTEM/domains/$domain_idn
@@ -119,6 +120,7 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
# Set ownership
chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain
chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
+ chown $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain/accounts
chown $user:mail $HOMEDIR/$user/mail/$domain_idn
fi
diff --git a/bin/v-add-srs-support-to-exim b/bin/v-add-srs-support-to-exim
new file mode 100644
index 00000000..4b7789ea
--- /dev/null
+++ b/bin/v-add-srs-support-to-exim
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+gen_pass() {
+ MATRIX='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
+ if [ -z "$1" ]; then
+ LENGTH=32
+ else
+ LENGTH=$1
+ fi
+ while [ ${n:=1} -le $LENGTH ]; do
+ PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}"
+ let n+=1
+ done
+ echo "$PASS"
+}
+
+eximversion=$(exim4 --version | grep '^Exim version ' | awk '{print $3}')
+if (( $(echo "$eximversion < 4.96" | bc -l) )); then
+ echo "= ERROR: Exim SRS support requires Exim 4.96 or higher."
+ echo "You have Exim $eximversion"
+ exit 1;
+fi
+
+echo "=== Addind SRS support to Exim4 ==="
+# SRS support is taken from HestiaCP
+
+if [ ! -f "/etc/exim4/srs.conf" ]; then
+ echo "= Generating SRS KEY"
+ srs=$(gen_pass 16)
+ echo $srs > /etc/exim4/srs.conf
+ chmod 640 /etc/exim4/srs.conf
+ chown root:Debian-exim /etc/exim4/srs.conf
+fi
+
+if [ ! -f "/etc/exim4/exim4.conf.template.backup-without-srs" ]; then
+ echo "= Backing up /etc/exim4/exim4.conf.template"
+ cp /etc/exim4/exim4.conf.template /etc/exim4/exim4.conf.template.backup-without-srs
+fi
+
+if ! /usr/local/vesta/bin/v-grep 'SRS_SECRET = ' '/etc/exim4/exim4.conf.template' '-q'; then
+ echo "= Adding: SRS_SECRET = readfile /etc/exim4/srs.conf"
+ v-sed 'smtputf8_advertise_hosts =' 'smtputf8_advertise_hosts =\n\nSRS_SECRET = ${readfile{/etc/exim4/srs.conf}}' '/etc/exim4/exim4.conf.template'
+fi
+
+if ! /usr/local/vesta/bin/v-grep 'if outbound, and forwarding has been done, use an alternate transport' '/etc/exim4/exim4.conf.template' '-q'; then
+ echo "= Patching \"dnslookup:\" block"
+ /usr/local/vesta/bin/v-php-func "replace_in_file_once_between_including_borders" "/etc/exim4/exim4.conf.template" 'dnslookup:' ' no_more' 'dnslookup:\n driver = dnslookup\n # if outbound, and forwarding has been done, use an alternate transport\n domains = ! +local_domains\n transport = ${if eq {$local_part@$domain} \\n {$original_local_part@$original_domain} \\n {remote_smtp} {remote_forwarded_smtp}}\n no_more'
+fi
+
+if ! /usr/local/vesta/bin/v-grep 'inbound_srs:' '/etc/exim4/exim4.conf.template' '-q'; then
+ echo "= Adding \"inbound_srs\" and \"inbound_srs_failure\" blocks"
+ v-sed 'aliases:' 'inbound_srs:\n driver = redirect\n senders = :\n domains = +local_domains\n # detect inbound bounces which are converted to SRS, and decode them\n condition = ${if inbound_srs {$local_part} {SRS_SECRET}}\n data = $srs_recipient\n\ninbound_srs_failure:\n driver = redirect\n senders = :\n domains = +local_domains\n # detect inbound bounces which look converted to SRS but are invalid\n condition = ${if inbound_srs {$local_part} {}}\n allow_fail\n data = :fail: Invalid SRS recipient address\n\naliases:' '/etc/exim4/exim4.conf.template'
+fi
+
+if ! /usr/local/vesta/bin/v-grep 'remote_forwarded_smtp:' '/etc/exim4/exim4.conf.template' '-q'; then
+ echo "= Adding \"remote_forwarded_smtp:\" block"
+ v-sed 'procmail:\n driver = pipe' 'remote_forwarded_smtp:\n driver = smtp\n dkim_domain = DKIM_DOMAIN\n dkim_selector = mail\n dkim_private_key = DKIM_PRIVATE_KEY\n dkim_canon = relaxed\n dkim_strict = 0\n hosts_try_fastopen = \n hosts_try_chunking = !93.188.3.0/24\n message_linelength_limit = 1G\n # modify the envelope from, for mails that we forward\n max_rcpt = 1\n return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}\n\nprocmail:\n driver = pipe' '/etc/exim4/exim4.conf.template'
+fi
+
+touch /etc/exim4/limit_per_email_account_max_sent_emails_per_hour
+touch /etc/exim4/limit_per_email_account_max_recipients
+touch /etc/exim4/limit_per_hosting_account_max_sent_emails_per_hour
+touch /etc/exim4/limit_per_hosting_account_max_recipients
+
+echo "= Restarting exim4 service"
+systemctl restart exim4
+
+if [ $? -ne 0 ]; then
+ systemctl status exim4
+ cp /etc/exim4/exim4.conf.template.backup-without-srs /etc/exim4/exim4.conf.template
+ systemctl restart exim4
+ echo "=== Patching failed, old exim conf returned, exim4 restarted again."
+ exit 1
+fi
+echo "=== SRS support was added successfully. ==="
+
+exit 0
diff --git a/bin/v-add-user-package b/bin/v-add-user-package
index 0cab1a3d..e9fe210a 100755
--- a/bin/v-add-user-package
+++ b/bin/v-add-user-package
@@ -28,7 +28,7 @@ is_package_new() {
}
is_package_consistent() {
- source $pkg_dir/$package.pkg
+ parse_object_kv_list_non_eval $(cat $pkg_dir/$package.pkg)
if [ "$WEB_DOMAINS" != 'unlimited' ]; then
is_int_format_valid $WEB_DOMAINS 'WEB_DOMAINS'
fi
@@ -63,6 +63,9 @@ is_package_consistent() {
is_int_format_valid $BACKUPS 'BACKUPS'
fi
is_format_valid_shell $SHELL
+ is_web_template_valid $WEB_TEMPLATE
+ is_dns_template_valid $DNS_TEMPLATE
+ is_proxy_template_valid $PROXY_TEMPLATE
}
diff --git a/bin/v-add-web-domain b/bin/v-add-web-domain
index b3d80de3..72de559a 100755
--- a/bin/v-add-web-domain
+++ b/bin/v-add-web-domain
@@ -48,6 +48,8 @@ is_object_unsuspended 'user' 'USER' "$user"
is_package_full 'WEB_DOMAINS' 'WEB_ALIASES'
is_domain_new 'web' "$domain,$aliases"
is_dir_symlink $HOMEDIR/$user/web
+if_dir_exists $HOMEDIR/$user/web/$domain
+is_dir_symlink $HOMEDIR/$user/web/$domain
if [ ! -z "$ip" ]; then
is_ip_valid "$ip" "$user"
else
@@ -89,9 +91,9 @@ done
chown -R $user:$user $HOMEDIR/$user/web/$domain
chown root:$user /var/log/$WEB_SYSTEM/domains/$domain.* $conf
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
-chmod 751 $HOMEDIR/$user/web/$domain $HOMEDIR/$user/web/$domain/*
-chmod 551 $HOMEDIR/$user/web/$domain/stats $HOMEDIR/$user/web/$domain/logs
-chmod 644 $HOMEDIR/$user/web/$domain/public_*html/*.*
+sudo -u $user chmod 751 $HOMEDIR/$user/web/$domain $HOMEDIR/$user/web/$domain/*
+sudo -u $user chmod 551 $HOMEDIR/$user/web/$domain/stats $HOMEDIR/$user/web/$domain/logs
+sudo -u $user chmod 644 $HOMEDIR/$user/web/$domain/public_*html/*.*
# Addding PHP-FPM backend
if [ ! -z "$WEB_BACKEND" ]; then
@@ -164,6 +166,9 @@ echo "DOMAIN='$domain' IP='$ip' IP6='' ALIAS='$ALIAS' TPL='$WEB_TEMPLATE'\
STATS='' STATS_USER='' STATS_CRYPT='' U_DISK='0' U_BANDWIDTH='0'\
SUSPENDED='no' TIME='$time' DATE='$date'" >> $USER_DATA/web.conf
+# Install unsigned SSL
+$BIN/v-install-unsigned-ssl "$domain" "no"
+
# Restarting web server
$BIN/v-restart-web $restart
check_result $? "Web restart failed" >/dev/null
diff --git a/bin/v-add-web-domain-ssl b/bin/v-add-web-domain-ssl
index 2c0f78ae..6d9deb9b 100755
--- a/bin/v-add-web-domain-ssl
+++ b/bin/v-add-web-domain-ssl
@@ -149,6 +149,13 @@ if [ ! -z "$UPDATE_SSL_SCRIPT" ]; then
eval "$UPDATE_SSL_SCRIPT $user $domain"
fi
+UPDATE_SSL_SCRIPT2=''
+source $VESTA/conf/vesta.conf
+if [ ! -z "$UPDATE_SSL_SCRIPT2" ]; then
+ eval "$UPDATE_SSL_SCRIPT2 $user $domain"
+fi
+
+
# Logging
log_history "enabled ssl support for $domain"
log_event "$OK" "$ARGUMENTS"
diff --git a/bin/v-add-wordpress-admin b/bin/v-add-wordpress-admin
new file mode 100644
index 00000000..60778fb2
--- /dev/null
+++ b/bin/v-add-wordpress-admin
@@ -0,0 +1,76 @@
+#!/bin/bash
+# info: Add a WordPress admin user to a specific domain
+# options: DOMAIN USERNAME PASSWORD EMAIL
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+if [ "$#" -lt 4 ]; then
+ echo "Usage: v-add-wordpress-admin [DOMAIN] [USERNAME] [PASSWORD] [EMAIL]"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+SILENT_MODE=1
+
+# Argument definition
+domain=$1
+username=$2
+password=$3
+email=$4
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/domain.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '4' "$#" 'DOMAIN USERNAME PASSWORD EMAIL'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ echo "User doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "Domain doesn't exist";
+ exit 1;
+fi
+
+if [ ! -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then
+ echo 'Please install WordPress first.'
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+/usr/local/vesta/bin/v-run-wp-cli $domain user create $username $email --role=administrator --user_pass="$password" --skip-plugins --skip-themes;
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit 0;
diff --git a/bin/v-backup-user b/bin/v-backup-user
index 88a00cab..f6629c9e 100755
--- a/bin/v-backup-user
+++ b/bin/v-backup-user
@@ -22,6 +22,9 @@ source $VESTA/func/domain.sh
source $VESTA/func/db.sh
source $VESTA/conf/vesta.conf
+if [ ! -z "$NOW" ]; then
+ BACKUP_LA_LIMIT=50
+fi
#----------------------------------------------------------#
# Verifications #
@@ -41,6 +44,11 @@ is_backup_enabled
wait_for_backup_if_it_is_not_time_for_backup
+# Override backup path
+if [ ! -z "$OVERRIDE_BACKUP_PATH" ]; then
+ BACKUP=$OVERRIDE_BACKUP_PATH
+fi
+
# Set backup directory if undefined
if [ -z "$BACKUP" ]; then
BACKUP=/backup
@@ -54,6 +62,19 @@ start_time=$(date '+%s')
subj="$user → backup failed"
email=$(grep CONTACT $VESTA/data/users/admin/user.conf |cut -f 2 -d \')
+# Validate available disk space (take usage * 2, due to the backup handling)
+let u_account=$(grep "U_DISK=" $VESTA/data/users/$user/user.conf |cut -f 2 -d \')
+let u_disk=$(grep "U_DISK=" $VESTA/data/users/$user/user.conf |cut -f 2 -d \')*2
+let v_disk=$(($(stat -f --format="%a*%S" $BACKUP)))/1024/1024
+
+if [ "$u_disk" -gt "$v_disk" ]; then
+ echo "account size : $u_account megabytes" |tee $BACKUP/$user.log
+ echo "available space on disk: $v_disk megabytes" |tee $BACKUP/$user.log
+ echo "needed space on disk : $u_disk megabytes" |tee $BACKUP/$user.log
+ echo "not enough disk space available to perform the backup." |$SENDMAIL -s "$subj" $email $notify
+ check_result $E_LIMIT "not enough disk space available to perform the backup."
+fi
+
if [ -z "$BACKUP_TEMP" ]; then
BACKUP_TEMP=$BACKUP
fi
@@ -133,6 +154,25 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
format_domain_idn
get_domain_values 'web'
+ # backuping php-fpm conf file
+ if [[ $TPL == "PHP-FPM-"* ]]; then
+ fpm_tpl_ver=${TPL:8:2}
+ fpm_ver="${TPL:8:1}.${TPL:9:1}"
+ fpm_folder="$fpm_ver/fpm/pool.d"
+ fpm_path="$fpm_ver/fpm/pool.d/$domain.conf"
+ if [[ $TPL == *"-ioncube" ]]; then
+ fpm_folder="$fpm_ver/fpm/pool.d-ioncube"
+ fpm_path="$fpm_ver/fpm/pool.d-ioncube/$domain.conf"
+ fi
+ fpm_original_path="/etc/php/$fpm_path"
+ fpm_dest_path="$tmpdir/web/$domain/php/$fpm_path"
+ fpm_dest_folder="$tmpdir/web/$domain/php/$fpm_folder"
+ if [ -f "$fpm_original_path" ]; then
+ mkdir -p $fpm_dest_folder
+ cp $fpm_original_path $fpm_dest_path
+ fi
+ fi
+
# Backup web.conf
cd $tmpdir/web/$domain/
conf="$USER_DATA/web.conf"
@@ -214,6 +254,11 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
if [ ! -z "$exlusion" ]; then
xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
for xpath in $xdirs; do
+ # Add ./ at the beginning of the path if the path is in old pattern
+ if [[ $xpath != ./* ]]; then
+ xpath=(./$xpath)
+ fi
+
if [ -d "$xpath" ]; then
fargs+=(--exclude=$xpath/*)
echo "$(date "+%F %T") excluding directory $xpath"
@@ -228,7 +273,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
set +f
# Backup files
- tar --anchored -cpf- ${fargs[@]} * |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
+ tar --anchored -cpf- ${fargs[@]} --exclude={'./','../'} . |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
done
# Print total
diff --git a/bin/v-backup-user-now b/bin/v-backup-user-now
new file mode 100644
index 00000000..10eecd87
--- /dev/null
+++ b/bin/v-backup-user-now
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+export ALLOW_BACKUP_ANYTIME='yes'
+export NOW='yes'
+
+nice -n 19 ionice -c 3 /usr/local/vesta/bin/v-backup-user $1
diff --git a/bin/v-backup-users b/bin/v-backup-users
index 640c1916..05550ded 100755
--- a/bin/v-backup-users
+++ b/bin/v-backup-users
@@ -4,6 +4,13 @@
#
# The function backups all system users.
+scriptname="v-backup-users"
+for pid in $(pidof -x "$scriptname"); do
+ if [ $pid != $$ ]; then
+ echo "[$(date)] : $scriptname : Process is already running with PID $pid"
+ exit 1
+ fi
+done
#----------------------------------------------------------#
# Variable&Function #
@@ -30,11 +37,11 @@ fi
log=$VESTA/log/backup.log
-$BIN/v-check-vesta-license >/dev/null
+# $BIN/v-check-vesta-license >/dev/null
+touch $log
if [ ! -z "$NOTIFY_ADMIN_FULL_BACKUP" ]; then
mv $log $log-`date +"%Y-%m-%d--%H:%M:%S"`
- touch $log
fi
# Auto-repair all databases before backuping all accounts
diff --git a/bin/v-blacklist-email-account b/bin/v-blacklist-email-account
new file mode 100644
index 00000000..59ec9cf8
--- /dev/null
+++ b/bin/v-blacklist-email-account
@@ -0,0 +1,102 @@
+#!/bin/bash
+# info: Add a specific email address to exim4 and spamassassin blacklist
+# usage: v-blacklist-email-account EMAIL
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Determine Debian version and set SpamAssassin service name
+release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+if [ "$release" -lt 12 ]; then
+ SPAMD_SERVICE="spamassassin.service"
+else
+ SPAMD_SERVICE="spamd.service"
+fi
+
+DENY_SENDERS_FILE="/etc/exim4/deny_senders"
+SPAMASSASSIN_FILE="/etc/spamassassin/local.cf"
+
+# Flags to track changes
+SPAMASSASSIN_CHANGED=false
+
+# Function to check if an entry already exists in a file
+check_entry_exists() {
+ local entry=$1
+ local file=$2
+ grep -qF "$entry" "$file"
+}
+
+# Function to add an entry to a file
+add_entry_to_file() {
+ local entry=$1
+ local file=$2
+ echo "$entry" >> "$file"
+}
+
+# Display usage if no arguments are provided
+if [ $# -lt 1 ]; then
+ echo "Usage: v-blacklist-email EMAIL"
+ exit 1
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+EMAIL=$1
+
+# Validate email format
+if [[ ! "$EMAIL" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then
+ echo "Invalid email address format."
+ exit 1
+fi
+
+# Prepare entries for Exim4 and SpamAssassin
+EXIM_ENTRY="$EMAIL"
+SPAMASSASSIN_ENTRY="blacklist_from $EMAIL"
+
+#----------------------------------------------------------#
+# Exim4 Blacklist #
+#----------------------------------------------------------#
+
+echo "Updating $DENY_SENDERS_FILE..."
+if ! check_entry_exists "$EXIM_ENTRY" "$DENY_SENDERS_FILE"; then
+ add_entry_to_file "$EXIM_ENTRY" "$DENY_SENDERS_FILE"
+ echo "Added $EXIM_ENTRY to $DENY_SENDERS_FILE."
+else
+ echo "$EXIM_ENTRY already exists in $DENY_SENDERS_FILE."
+fi
+
+#----------------------------------------------------------#
+# SpamAssassin Blacklist #
+#----------------------------------------------------------#
+
+echo "Updating $SPAMASSASSIN_FILE..."
+if ! check_entry_exists "$SPAMASSASSIN_ENTRY" "$SPAMASSASSIN_FILE"; then
+ add_entry_to_file "$SPAMASSASSIN_ENTRY" "$SPAMASSASSIN_FILE"
+ echo "Added $SPAMASSASSIN_ENTRY to $SPAMASSASSIN_FILE."
+ SPAMASSASSIN_CHANGED=true
+else
+ echo "$SPAMASSASSIN_ENTRY already exists in $SPAMASSASSIN_FILE."
+fi
+
+if [ "$SPAMASSASSIN_CHANGED" == "true" ]; then
+ systemctl restart "$SPAMD_SERVICE"
+ echo "SpamAssassin service ($SPAMD_SERVICE) restarted."
+fi
+
+#----------------------------------------------------------#
+# Done #
+#----------------------------------------------------------#
+
+exit 0
diff --git a/bin/v-blacklist-email-domain b/bin/v-blacklist-email-domain
new file mode 100644
index 00000000..a72a17a9
--- /dev/null
+++ b/bin/v-blacklist-email-domain
@@ -0,0 +1,133 @@
+#!/bin/bash
+# info: Add a domain to exim4 and spamassassin blacklist
+# usage: v-blacklist-email-domain DOMAIN SUBDOMAIN(YES/NO)
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Determine Debian version and set SpamAssassin service name
+release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+if [ "$release" -lt 12 ]; then
+ SPAMD_SERVICE="spamassassin.service"
+else
+ SPAMD_SERVICE="spamd.service"
+fi
+
+DENY_SENDERS_FILE="/etc/exim4/deny_senders"
+SPAMASSASSIN_FILE="/etc/spamassassin/local.cf"
+
+# Flags to track changes
+SPAMASSASSIN_CHANGED=false
+
+# Function to check if a domain already exists in a file
+check_domain_exists() {
+ local domain=$1
+ local file=$2
+ grep -qE "^${domain}$" "$file"
+}
+
+# Function to check if a SpamAssassin entry already exists
+check_spamassassin_exists() {
+ local entry=$1
+ local file=$2
+ grep -qF "$entry" "$file"
+}
+
+# Function to add domain to file
+add_domain_to_file() {
+ local domain=$1
+ local file=$2
+ echo "$domain" >> "$file"
+}
+
+# Display usage if no arguments are provided
+if [ $# -lt 2 ]; then
+ echo "Usage: v-blacklist-domain DOMAIN SUBDOMAIN(YES/NO)"
+ exit 1
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+DOMAIN=$1
+SUBDOMAIN=${2^^} # Convert to uppercase for consistency (YES/NO)
+
+# Validate SUBDOMAIN parameter
+if [[ "$SUBDOMAIN" != "YES" && "$SUBDOMAIN" != "NO" ]]; then
+ echo "Invalid parameter for SUBDOMAIN. Use YES or NO."
+ exit 1
+fi
+
+# Prepare entries for Exim4
+EXIM_ENTRY_MAIN="$DOMAIN"
+EXIM_ENTRY_SUB="*.$DOMAIN"
+
+# Prepare entries for SpamAssassin
+SPAMASSASSIN_ENTRY_MAIN="blacklist_from *@${DOMAIN}"
+SPAMASSASSIN_ENTRY_SUB="blacklist_from *.$DOMAIN"
+
+#----------------------------------------------------------#
+# Exim4 Blacklist #
+#----------------------------------------------------------#
+
+echo "Updating $DENY_SENDERS_FILE..."
+if ! check_domain_exists "$EXIM_ENTRY_MAIN" "$DENY_SENDERS_FILE"; then
+ add_domain_to_file "$EXIM_ENTRY_MAIN" "$DENY_SENDERS_FILE"
+ echo "Added $EXIM_ENTRY_MAIN to $DENY_SENDERS_FILE."
+else
+ echo "$EXIM_ENTRY_MAIN already exists in $DENY_SENDERS_FILE."
+fi
+
+if [ "$SUBDOMAIN" == "YES" ]; then
+ if ! check_domain_exists "$EXIM_ENTRY_SUB" "$DENY_SENDERS_FILE"; then
+ add_domain_to_file "$EXIM_ENTRY_SUB" "$DENY_SENDERS_FILE"
+ echo "Added $EXIM_ENTRY_SUB to $DENY_SENDERS_FILE."
+ else
+ echo "$EXIM_ENTRY_SUB already exists in $DENY_SENDERS_FILE."
+ fi
+fi
+
+#----------------------------------------------------------#
+# SpamAssassin Blacklist #
+#----------------------------------------------------------#
+
+echo "Updating $SPAMASSASSIN_FILE..."
+if ! check_spamassassin_exists "$SPAMASSASSIN_ENTRY_MAIN" "$SPAMASSASSIN_FILE"; then
+ add_domain_to_file "$SPAMASSASSIN_ENTRY_MAIN" "$SPAMASSASSIN_FILE"
+ echo "Added $SPAMASSASSIN_ENTRY_MAIN to $SPAMASSASSIN_FILE."
+ SPAMASSASSIN_CHANGED=true
+else
+ echo "$SPAMASSASSIN_ENTRY_MAIN already exists in $SPAMASSASSIN_FILE."
+fi
+
+if [ "$SUBDOMAIN" == "YES" ]; then
+ if ! check_spamassassin_exists "$SPAMASSASSIN_ENTRY_SUB" "$SPAMASSASSIN_FILE"; then
+ add_domain_to_file "$SPAMASSASSIN_ENTRY_SUB" "$SPAMASSASSIN_FILE"
+ echo "Added $SPAMASSASSIN_ENTRY_SUB to $SPAMASSASSIN_FILE."
+ SPAMASSASSIN_CHANGED=true
+ else
+ echo "$SPAMASSASSIN_ENTRY_SUB already exists in $SPAMASSASSIN_FILE."
+ fi
+fi
+
+if [ "$SPAMASSASSIN_CHANGED" == "true" ]; then
+ systemctl restart "$SPAMD_SERVICE"
+ echo "SpamAssassin service ($SPAMD_SERVICE) restarted."
+fi
+
+#----------------------------------------------------------#
+# Done #
+#----------------------------------------------------------#
+
+exit 0
diff --git a/bin/v-change-database-owner b/bin/v-change-database-owner
index d84d8eb2..983f7cb1 100755
--- a/bin/v-change-database-owner
+++ b/bin/v-change-database-owner
@@ -60,6 +60,10 @@ if [ ! -z "$check_db" ]; then
exit $E_EXISTS
fi
+if [ ! -d "/backup" ]; then
+ echo "There is no /backup folder, creating it now..."
+ mkdir /backup
+fi
#----------------------------------------------------------#
# Action #
diff --git a/bin/v-change-database-password-for-all-wordpress b/bin/v-change-database-password-for-all-wordpress
new file mode 100644
index 00000000..1a364307
--- /dev/null
+++ b/bin/v-change-database-password-for-all-wordpress
@@ -0,0 +1,65 @@
+#!/bin/bash
+# info: change db password to all wordpress databases
+# options:
+#
+# The command is used for changing db password to all wordpress databases on the server.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Importing system variables
+source /etc/profile
+
+# Includes
+source $VESTA/func/main.sh
+
+only_user='';
+if [ ! -z "$1" ]; then
+ only_user=$1
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+touch /root/remember-db-user-pass.txt
+
+for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
+ if [ ! -f "/usr/local/vesta/data/users/$user/user.conf" ]; then
+ continue;
+ fi
+
+ if [ ! -z "$only_user" ]; then
+ if [ "$only_user" != "$user" ]; then
+ continue;
+ fi
+ fi
+
+ for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
+ if [ -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then
+ /usr/local/vesta/bin/v-change-database-password-for-wordpress $domain $user
+ echo "--------------------------------"
+ fi
+ done
+
+ if [ ! -z "$only_user" ]; then
+ break;
+ fi
+
+done
+
+# cat /root/remember-db-user-pass.txt
+if [ -f "/root/remember-db-user-pass.txt" ]; then
+ rm /root/remember-db-user-pass.txt
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-change-database-password-for-wordpress b/bin/v-change-database-password-for-wordpress
new file mode 100644
index 00000000..7f31b181
--- /dev/null
+++ b/bin/v-change-database-password-for-wordpress
@@ -0,0 +1,132 @@
+#!/bin/bash
+# info: change database password for wordpress
+# options:
+#
+# The command is used for changing database password for wordpress.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Argument definition
+domain=$1
+
+# Check if number of arguments is 2
+if [ $# -eq 2 ]; then
+ user=$2
+else
+ user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+fi
+USER=$user
+
+if [ -z "$user" ]; then
+ echo "ERROR: Domain $domain not found"
+ exit 1;
+fi
+
+if [ ! -d "/home/$user" ]; then
+ echo "ERROR: User $user doesn't exist";
+ exit 1;
+fi
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "ERROR: Domain doesn't exist";
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+if [ -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then
+ echo "=== Domain: $domain"
+ wp_config_path="/home/$user/web/$domain/public_html/wp-config.php"
+ if grep -q $'\r' $wp_config_path; then
+ echo "=== removing CRLF from wp-config.php"
+ tr -d '\r' < $wp_config_path > /tmp/wp-config.php && mv /tmp/wp-config.php $wp_config_path
+ chown $user:$user $wp_config_path
+ fi
+ db_name=$(grep "DB_NAME" $wp_config_path | grep -oP "define\s*\(\s*'DB_NAME'\s*,\s*'\K[^']+")
+ db_user=$(grep "DB_USER" $wp_config_path | grep -oP "define\s*\(\s*'DB_USER'\s*,\s*'\K[^']+")
+ if [ -z "$db_name" ]; then
+ db_name=$(grep "DB_NAME" $wp_config_path | grep -oP "define\s*\(\s*'DB_NAME'\s*,\s*\"\K[^\"]+")
+ fi
+ if [ -z "$db_user" ]; then
+ db_user=$(grep "DB_USER" $wp_config_path | grep -oP "define\s*\(\s*'DB_USER'\s*,\s*\"\K[^\"]+")
+ fi
+ new_password=''
+ found_existing_password=0
+ if [ -f "/root/remember-db-user-pass.txt" ]; then
+ db_user_pass=$(grep "$db_user:" /root/remember-db-user-pass.txt)
+ if [ -n "$db_user_pass" ]; then
+ new_password=$(echo "$db_user_pass" | cut -d':' -f2)
+ echo "= Using existing password for $db_user"
+ found_existing_password=1
+ fi
+ fi
+
+ if [ -z "$new_password" ]; then
+ new_password=$(generate_password)
+ fi
+
+ echo "DB name: $db_name"
+ echo "DB user: $db_user"
+ echo "New DB password: $new_password"
+ if [ $found_existing_password -eq 0 ]; then
+ touch /root/remember-db-user-pass.txt
+ echo "$db_user:$new_password" >> /root/remember-db-user-pass.txt
+ chown root:root /root/remember-db-user-pass.txt
+ chmod 600 /root/remember-db-user-pass.txt
+ fi
+ /usr/local/vesta/bin/v-change-database-password "$user" "$db_name" "$new_password"
+ if [ $? -ne 0 ]; then
+ echo "*************** ERROR: Failed to change database password ***************"
+ exit 1;
+ fi
+ line="define('DB_PASSWORD', '$new_password');"
+ chattr -i $wp_config_path
+ sed -i "s/.*define(.*DB_PASSWORD'.*/$line/" $wp_config_path
+ new_password_line=$(grep "DB_PASSWORD" $wp_config_path)
+ echo "New DB password line: $new_password_line"
+ if [ "$new_password_line" != "$line" ]; then
+ echo "*************** ERROR: line in wp-config.php is not what we expected ***************"
+ echo "Expected: $line"
+ echo "Actual : $new_password_line"
+ echo "*************** ERROR: Please check wp-config.php manually ***************"
+ exit 1;
+ fi
+else
+ echo "ERROR: WP-config.php not found"
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit 0;
diff --git a/bin/v-change-dir-www b/bin/v-change-dir-www
new file mode 100644
index 00000000..1f230099
--- /dev/null
+++ b/bin/v-change-dir-www
@@ -0,0 +1,71 @@
+#!/bin/bash
+# info: Change directory to the public_html folder of a domain
+# usage: source v-cd-www DOMAIN
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
+ echo "This script must be sourced to change the current directory."
+ echo "Usage: source v-cd-www DOMAIN"
+ exit 1
+fi
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ return 1
+fi
+
+# Importing system environment
+source /etc/profile
+PATH=$PATH:/usr/local/vesta/bin && export PATH
+
+SILENT_MODE=1
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+
+if [ -z "$user" ]; then
+ echo "Domain $domain doesn't exist"
+ return 1
+fi
+
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/domain.sh
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ echo "User $user doesn't exist"
+ return 1
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "Domain $domain doesn't have a public_html directory"
+ return 1
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+cd "/home/$user/web/$domain/public_html"
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+return 0
diff --git a/bin/v-change-domain-owner b/bin/v-change-domain-owner
index 8f267307..ed5fa5a4 100755
--- a/bin/v-change-domain-owner
+++ b/bin/v-change-domain-owner
@@ -35,6 +35,9 @@ if [ "$owner" = "$user" ]; then
exit
fi
+USER_DATA=$VESTA/data/users/$owner
+is_object_unsuspended 'user' 'USER' "$owner"
+USER_DATA=$VESTA/data/users/$user
#----------------------------------------------------------#
# Action #
@@ -57,11 +60,11 @@ if [ ! -z "$web_data" ]; then
ssl_key=$VESTA/data/users/$owner/ssl/$domain.key
ssl_ca=$VESTA/data/users/$owner/ssl/$domain.ca
ssl_pem=$VESTA/data/users/$owner/ssl/$domain.pem
- mv $ssl_crt $VESTA/data/users/$user/ssl/
- mv $ssl_key $VESTA/data/users/$user/ssl/
- mv $ssl_ca $VESTA/data/users/$user/ssl/ >> /dev/null 2>&1
- mv $ssl_pem $VESTA/data/users/$user/ssl/ >> /dev/null 2>&1
- rm -f $HOMEDIR/$owner/conf/web/ssl.$domain.*
+ cp $ssl_crt $VESTA/data/users/$user/ssl/
+ cp $ssl_key $VESTA/data/users/$user/ssl/
+ cp $ssl_ca $VESTA/data/users/$user/ssl/ > /dev/null 2>&1
+ cp $ssl_pem $VESTA/data/users/$user/ssl/ > /dev/null 2>&1
+ # rm -f $HOMEDIR/$owner/conf/web/ssl.$domain.*
fi
# Check ftp user account
@@ -79,10 +82,23 @@ if [ ! -z "$web_data" ]; then
# Move data
mv $HOMEDIR/$owner/web/$domain $HOMEDIR/$user/web/
+ if [ -d "/hdd/home/$owner/web/$domain" ]; then
+ $BIN/v-move-folder-and-make-symlink /hdd/home/$owner/web/$domain /hdd/home/$user/web/$domain
+ fi
+
# Change ownership
find $HOMEDIR/$user/web/$domain -user $owner \
-exec chown -h $user:$user {} \;
+ if [ "$SSL" = 'yes' ]; then
+ sleep 10
+ rm $ssl_crt
+ rm $ssl_key
+ rm $ssl_ca > /dev/null 2>&1
+ rm $ssl_pem > /dev/null 2>&1
+ rm -f $HOMEDIR/$owner/conf/web/ssl.$domain.*
+ fi
+
# Rebuild config
$BIN/v-unsuspend-web-domain $user $domain no >> /dev/null 2>&1
$BIN/v-rebuild-web-domains $owner no
@@ -140,6 +156,10 @@ if [ ! -z "$mail_data" ]; then
# Move data
mv $HOMEDIR/$owner/mail/$domain $HOMEDIR/$user/mail/
+ if [ -d "/hdd/home/$owner/mail/$domain" ]; then
+ $BIN/v-move-folder-and-make-symlink /hdd/home/$owner/mail/$domain /hdd/home/$user/mail/$domain
+ fi
+
# Change ownership
find $HOMEDIR/$user/mail/$domain -user $owner \
-exec chown -h $user {} \;
diff --git a/bin/v-change-firewall-rule b/bin/v-change-firewall-rule
index d2502bce..aad2ec38 100755
--- a/bin/v-change-firewall-rule
+++ b/bin/v-change-firewall-rule
@@ -62,6 +62,8 @@ str="RULE='$rule' ACTION='$action' PROTOCOL='$protocol' PORT='$port_ext'"
str="$str IP='$ip' COMMENT='$comment' SUSPENDED='no'"
str="$str TIME='$time' DATE='$date'"
+oldvalues=$(grep "RULE='$rule'" $VESTA/data/firewall/rules.conf)
+
# Deleting old rule
sed -i "/RULE='$rule' /d" $VESTA/data/firewall/rules.conf
@@ -74,6 +76,14 @@ sort_fw_rules
# Updating system firewall
$BIN/v-update-firewall
+if [ "$WEB_SYSTEM" == 'nginx' ] || [ "$PROXY_SYSTEM" == 'nginx' ]; then
+ if [ "$port_ext" == "80,443" ] && [ "$action" == "DROP" ]; then
+ NEWIP=$ip
+ parse_object_kv_list_non_eval "$oldvalues"
+ sed -i "s|$IP|$NEWIP|g" /etc/nginx/conf.d/block-firewall.conf
+ systemctl restart nginx
+ fi
+fi
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-change-sys-config-value b/bin/v-change-sys-config-value
index 10657656..3681075c 100755
--- a/bin/v-change-sys-config-value
+++ b/bin/v-change-sys-config-value
@@ -28,6 +28,7 @@ PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
check_args '2' "$#" 'KEY VALUE'
is_format_valid 'key'
+format_no_quotes "$value" 'value'
#----------------------------------------------------------#
# Action #
diff --git a/bin/v-change-user-package b/bin/v-change-user-package
index d0de98db..1e088bcc 100755
--- a/bin/v-change-user-package
+++ b/bin/v-change-user-package
@@ -16,6 +16,7 @@ force=$3
# Includes
source $VESTA/func/main.sh
+source $VESTA/func/domain.sh
source $VESTA/conf/vesta.conf
is_package_avalable() {
@@ -23,7 +24,7 @@ is_package_avalable() {
usr_data=$(cat $USER_DATA/user.conf)
IFS=$'\n'
for key in $usr_data; do
- eval ${key%%=*}=${key#*=}
+ parse_object_kv_list_non_eval $key
done
WEB_DOMAINS='0'
@@ -35,7 +36,7 @@ is_package_avalable() {
pkg_data=$(cat $VESTA/data/packages/$package.pkg |grep -v TIME |\
grep -v DATE)
- eval $pkg_data
+ parse_object_kv_list_non_eval $pkg_data
# Checking usage agains package limits
if [ "$WEB_DOMAINS" != 'unlimited' ]; then
@@ -73,11 +74,15 @@ is_package_avalable() {
check_result $E_LIMIT "Package doesn't cover BANDWIDTH usage"
fi
fi
+
+ is_web_template_valid $WEB_TEMPLATE
+ is_dns_template_valid $DNS_TEMPLATE
+ is_proxy_template_valid $PROXY_TEMPLATE
}
change_user_package() {
- eval $(cat $USER_DATA/user.conf)
- eval $(cat $VESTA/data/packages/$package.pkg |egrep -v "TIME|DATE")
+ parse_object_kv_list_non_eval $(cat $USER_DATA/user.conf)
+ parse_object_kv_list_non_eval $(cat $VESTA/data/packages/$package.pkg |egrep -v "TIME|DATE")
echo "FNAME='$FNAME'
LNAME='$LNAME'
PACKAGE='$package'
diff --git a/bin/v-change-user-rkey b/bin/v-change-user-rkey
new file mode 100644
index 00000000..38777e4c
--- /dev/null
+++ b/bin/v-change-user-rkey
@@ -0,0 +1,60 @@
+#!/bin/bash
+# info: change user rkey
+# options: USER
+#
+# The function changes user's RKEY value.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument definition
+user=$1
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+if [ "$user" = "root" ]; then
+ check_result $E_FORBIDEN "Changing root password is forbiden"
+fi
+
+check_args '1' "$#" 'USER'
+is_format_valid 'user'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+hash=$(generate_password)
+d=$(date +%s)
+
+# Changing RKEY value
+update_user_value "$user" '$RKEY' "$hash"
+
+#check if RKEYEXP exists
+if [ -z "$(grep RKEYEXP $USER_DATA/user.conf)" ]; then
+ sed -i "s/^RKEY/RKEYEXP='$d'\nRKEY/g" $USER_DATA/user.conf
+else
+ update_user_value "$user" '$RKEYEXP' "$d"
+fi
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_history "changed rkey"
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-change-vesta-port b/bin/v-change-vesta-port
index 09cff31d..7ea7827e 100755
--- a/bin/v-change-vesta-port
+++ b/bin/v-change-vesta-port
@@ -41,12 +41,14 @@ is_int_format_valid "$port" 'port number'
#----------------------------------------------------------#
sed -i "s|$oldport;|$port;|g" $VESTA/nginx/conf/nginx.conf
+sed -i "s|$oldport ssl;|$port ssl;|g" $VESTA/nginx/conf/nginx.conf
if [ -f "/etc/roundcube/plugins/password/config.inc.php" ]; then
sed -i "s|'$oldport'|'$port'|g" /etc/roundcube/plugins/password/config.inc.php
fi
sed -i "s|'$oldport'|'$port'|g" $VESTA/data/firewall/rules.conf
$VESTA/bin/v-update-firewall
systemctl restart fail2ban.service
+sed -i "s| $oldport | $port |g" /etc/iptables.rules
systemctl restart vesta
#----------------------------------------------------------#
diff --git a/bin/v-change-wordpress-admin-passwords b/bin/v-change-wordpress-admin-passwords
new file mode 100644
index 00000000..bca23ad8
--- /dev/null
+++ b/bin/v-change-wordpress-admin-passwords
@@ -0,0 +1,201 @@
+#!/bin/bash
+# info: interactively delete or change WordPress admin passwords for a given domain
+# options: DOMAIN
+#
+# d → delete user (with content reassignment)
+# c → change password (random 10-char alnum)
+# s → skip
+# x → exit
+
+#----------------------------------------------------------#
+# Variable & Function #
+#----------------------------------------------------------#
+
+[ "$(whoami)" != "root" ] && { echo "You must be root to run this command."; exit 1; }
+source /etc/profile
+
+DOMAIN="$1"
+[ -z "$DOMAIN" ] && { echo "Usage: v-change-wp-admins-pass DOMAIN"; exit 1; }
+
+USER="$(/usr/local/vesta/bin/v-search-domain-owner "$DOMAIN")"
+[ -z "$USER" ] && { echo "Domain $DOMAIN does not exist."; exit 1; }
+
+WP_PATH="/home/$USER/web/$DOMAIN/public_html"
+[ ! -f "$WP_PATH/wp-config.php" ] && { echo "WordPress is not installed on this domain."; exit 1; }
+
+# WP-CLI wrapper
+if [ ! -z "$PHP" ]; then
+ WP_RUN="PHP=$PHP /usr/local/vesta/bin/v-run-wp-cli $DOMAIN --skip-plugins --skip-themes"
+else
+ WP_RUN="/usr/local/vesta/bin/v-run-wp-cli $DOMAIN --skip-plugins --skip-themes"
+fi
+
+# random 10-char password
+gen_pass() { tr -dc 'A-Za-z0-9' " || TARGET="$LOGIN"
+ while true; do
+ echo "-------------------------------------"
+ read -r -p "Action for \"$TARGET\" [d/c/s/x]? " ACT < /dev/tty
+ skip=0;
+ case "$ACT" in
+ [Dd]* )
+ # read -r -p "Really DELETE \"$TARGET\" ? (y/n, default: y) " CONF < /dev/tty
+ CONF="y"
+ if [[ ! "$CONF" =~ ^[Nn]$ ]]; then
+ # build an array of OTHER admin usernames
+ mapfile -t OTHER_USERS < <(echo "$ADMIN_LIST_CSV" | awk -F',' -v cur="$ID" '$1!=cur {print $2}')
+ if [ "${#OTHER_USERS[@]}" -eq 0 ]; then
+ echo "Cannot delete the only administrator account."
+ break
+ fi
+ if [ "$DEFAULT_USER" = "" ]; then
+ DEFAULT_USER="${OTHER_USERS[0]}"
+ fi
+ echo "Available admin usernames for reassignment: ${OTHER_USERS[*]}"
+ while true; do
+ read -r -p "Reassign content to which username? [default: $DEFAULT_USER, s: skip] " REASSIGN < /dev/tty
+ REASSIGN=${REASSIGN:-$DEFAULT_USER}
+ DEFAULT_USER=$REASSIGN
+ if printf '%s\n' "${OTHER_USERS[@]}" | grep -qx "$REASSIGN"; then
+ break
+ fi
+ if [[ "$REASSIGN" =~ ^[Ss]$ ]]; then
+ echo "Skipping reassignment."
+ skip=1;
+ break
+ fi
+ if [[ "$REASSIGN" =~ ^[0-9]+$ ]]; then
+ break
+ fi
+ echo "Invalid username. Please choose one of: ${OTHER_USERS[*]}"
+ done
+ if [ $skip -eq 1 ]; then
+ break
+ fi
+ # delete by username, reassign by username
+ RUN="$WP_RUN user delete $ID --reassign=$REASSIGN --yes --skip-plugins --skip-themes"
+ eval "$RUN"
+ if [ $? -eq 0 ]; then
+ echo "$TARGET deleted (content reassigned to $REASSIGN)."
+ else
+ cat /home/$USER/web/$DOMAIN/wp-cli-error.log
+ echo "Failed to delete $TARGET."
+ fi
+ else
+ echo "Deletion cancelled."
+ fi
+ break
+ ;;
+ [Cc]* )
+ NEW_PASS=$(gen_pass)
+ RUN="$WP_RUN user update $ID --user_pass=$NEW_PASS --skip-plugins --skip-themes"
+ eval "$RUN"
+ if [ $? -eq 0 ]; then
+ echo "Password for username '$TARGET' changed to: $NEW_PASS"
+ echo "Password for username '$TARGET' changed to: $NEW_PASS" >> /home/$USER/web/$DOMAIN/wp-admin-password-change.txt
+ chown $USER:$USER /home/$USER/web/$DOMAIN/wp-admin-password-change.txt
+ chmod 600 /home/$USER/web/$DOMAIN/wp-admin-password-change.txt
+ else
+ cat /home/$USER/web/$DOMAIN/wp-cli-error.log
+ echo "Failed to change password for $TARGET."
+ fi
+ break
+ ;;
+ [Ss]* )
+ echo "Skipping $TARGET."
+ break
+ ;;
+ [Xx]* )
+ echo "Exiting."
+ exit 0
+ ;;
+ * ) echo "Please answer d, c, s, or x." ;;
+ esac
+ done
+done <<< "$ADMIN_LIST_CSV"
+
+if [ -f /home/$USER/web/$DOMAIN/wp-admin-password-change.txt ]; then
+ echo ""
+ echo ""
+ echo "-------------------------------------"
+ echo "For website $DOMAIN - new wp-admin passwords have been set."
+ echo "-------------------------------------"
+ cat /home/$USER/web/$DOMAIN/wp-admin-password-change.txt
+ echo "-------------------------------------"
+ echo ""
+ echo ""
+ read -r -p "Do you want to save the new passwords to a file /home/$USER/web/$DOMAIN/wp-admin-password-change.txt ? (y/n, default: n) " SAVE_PASSWORDS < /dev/tty
+ if [ -z "$SAVE_PASSWORDS" ]; then
+ SAVE_PASSWORDS="n"
+ fi
+ if [[ $SAVE_PASSWORDS =~ ^[Nn]$ ]]; then
+ rm /home/$USER/web/$DOMAIN/wp-admin-password-change.txt
+ fi
+fi
+
+#----------------------------------------------------------#
+# flush cache and refresh all security salts #
+#----------------------------------------------------------#
+
+echo "-------------------------------------"
+echo
+echo "Flushing cache and refreshing salts..."
+
+RUN="$WP_RUN cache flush"
+eval "$RUN"
+RUN="$WP_RUN config shuffle-salts WP_CACHE_KEY_SALT --force"
+eval "$RUN"
+RUN="$WP_RUN config shuffle-salts"
+eval "$RUN"
+
+echo "Cache flushed and salts refreshed."
+
+echo
+echo "Done."
+
+exit 0
diff --git a/bin/v-check-api-key b/bin/v-check-api-key
index 8d0d409e..66284e69 100755
--- a/bin/v-check-api-key
+++ b/bin/v-check-api-key
@@ -19,6 +19,11 @@ time_n_date=$(date +'%T %F')
time=$(echo "$time_n_date" |cut -f 1 -d \ )
date=$(echo "$time_n_date" |cut -f 2 -d \ )
+if [[ -z $key || ${#key} -lt 16 ]]; then
+ echo "Error: not valid keys"
+ echo "$date $time api $ip failed to login" >> $VESTA/log/auth.log
+ exit 9
+fi
#----------------------------------------------------------#
# Action #
diff --git a/bin/v-check-vesta-license b/bin/v-check-vesta-license
index 7fa1a12c..18c7dab4 100755
--- a/bin/v-check-vesta-license
+++ b/bin/v-check-vesta-license
@@ -42,7 +42,7 @@ for str in $modules; do
license=$(echo "$str" |cut -f 2 -d \')
if [ ! -z "$license" ]; then
v_host='https://vestacp.com/checkout'
- answer=$(curl -s "$v_host/check.php?licence_key=$license&module=$module")
+ answer=$(curl --max-time 60 -s "$v_host/check.php?licence_key=$license&module=$module")
check_result $? "cant' connect to vestacp.com " 0
echo "$module $license $answer"
if [[ "$answer" != '0' ]]; then
diff --git a/bin/v-clean-garbage b/bin/v-clean-garbage
new file mode 100644
index 00000000..11e29122
--- /dev/null
+++ b/bin/v-clean-garbage
@@ -0,0 +1,133 @@
+#!/bin/bash
+# info: Clean all unnecessary files like logs
+# options: NONE
+#
+# The function is cleaning all unnecessary files like logs
+
+#----------------------------------------------------------#
+# Verifications & Variable & Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+echo "===== Before cleaning ====="
+df -h
+echo "==========================="
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# turn off tailf watcher process
+if [ -f "/usr/local/bin/tailf_apache_error.php" ]; then
+ kill $(ps aux | grep 'tailf_apache_error' | grep -v "grep tailf_apache_error" | awk '{print $2}')
+fi
+if [ -f "/usr/local/bin/tailf_exim.php" ]; then
+ kill $(ps aux | grep 'tailf_exim' | grep -v "grep tailf_exim" | awk '{print $2}')
+fi
+
+find /tmp/ -type f -mtime +7 -delete
+rm /var/backups/* > /dev/null 2>&1
+rm /var/cache/apt/archives/* > /dev/null 2>&1
+cd /var/log
+truncate -s 0 xferlog lastlog faillog btmp syslog;
+find /var/log/ -name "*.log" -not -path "/var/log/apt/*" -type f -exec truncate -s 0 {} \;
+find /var/log/ -name "*.err" -type f -exec truncate -s 0 {} \;
+find /var/log/ -name "errors" -type f -exec truncate -s 0 {} \;
+find /var/log/ -name "*.info" -type f -exec truncate -s 0 {} \;
+find /var/log/ -name "*.warn" -type f -exec truncate -s 0 {} \;
+find /var/log/ -type f -name "*.1" -delete
+find /var/log/ -type f -name "*.2" -delete
+find /var/log/ -type f -name "*.3" -delete
+find /var/log/ -type f -name "*.4" -delete
+find /var/log/ -type f -name "*.5" -delete
+find /var/log/ -type f -name "*.6" -delete
+find /var/log/ -type f -name "*.7" -delete
+find /var/log/ -type f -name "*.8" -delete
+find /var/log/ -type f -name "*.9" -delete
+find /var/log/ -name "*.gz" -type f -delete
+find /usr/local/vesta/log/ -type f -name "*.log" -exec truncate -s 0 {} \;
+find /usr/local/vesta/log/ -type f -not -name "*.log" -delete
+find /var/log/exim4/ -type f -exec truncate -s 0 {} \;
+truncate -s 0 /*.log > /dev/null 2>&1
+rm /panic-*.log > /dev/null 2>&1
+rm /var/log/panic-*.log > /dev/null 2>&1
+
+clean_home() {
+ nice -n 19 ionice -c 3 find $1/*/tmp/ -type f -delete > /dev/null 2>&1
+ find $1/ -name '.wp-cli' -type d -exec rm -rf {} \; > /dev/null 2>&1
+ find $1/*/web/*/public_html/wp-content/aiowps_backups/ -type f -not -name ".htaccess" -not -name "index.php" -not -name "index.html" -not -name "web.config" -delete > /dev/null 2>&1
+ find $1/*/web/*/public_html/wp-content/envato-backups/ -type f -not -name ".htaccess" -not -name "index.php" -not -name "index.html" -not -name "web.config" -delete > /dev/null 2>&1
+ find $1/*/web/*/public_html/wp-content/ai1wm-backups/ -type f -not -name ".htaccess" -not -name "index.php" -not -name "index.html" -not -name "web.config" -delete > /dev/null 2>&1
+ find $1/*/web/*/public_html/wp-content/wpvividbackups/ -type f -not -name ".htaccess" -not -name "index.php" -not -name "index.html" -not -name "web.config" -delete > /dev/null 2>&1
+ find $1/*/web/*/public_html/wp-content/updraft/ -type f -not -name ".htaccess" -not -name "index.php" -not -name "index.html" -not -name "web.config" -delete > /dev/null 2>&1
+ find $1/*/web/*/public_html/wp-content/plugins/ezpz-one-click-backup/backups/ -type f -not -name ".htaccess" -not -name "index.php" -not -name "index.html" -not -name "web.config" -delete > /dev/null 2>&1
+ find $1/*/web/*/public_html/wp-content/backups-dup-lite/ -type f -not -name ".htaccess" -not -name "index.php" -not -name "index.html" -not -name "web.config" -delete > /dev/null 2>&1
+ find $1/*/web/*/public_html/wp-content/cache/ -type f -not -name ".htaccess" -delete > /dev/null 2>&1
+ find $1/*/web/*/public_html/ -type f -name "*.wpress" -delete > /dev/null 2>&1
+ nice -n 19 ionice -c 3 find $1/*/tmp/ -type f -mtime +1 -delete > /dev/null 2>&1
+ nice -n 19 ionice -c 3 find $1/*/web/*/public_html/ -type f -name "error_log" -exec truncate -s 0 {} \;
+ nice -n 19 ionice -c 3 find $1/*/web/*/public_html/ -type f -name "error_log.txt" -exec truncate -s 0 {} \;
+ nice -n 19 ionice -c 3 find $1/ -type f -name "*.log" -exec truncate -s 0 {} \;
+}
+
+clean_home "/home"
+if [ -d "/hdd/home" ]; then
+ clean_home "/hdd/home"
+fi
+
+# Cleaning fail2ban database
+fail2ban_running=$(/usr/local/vesta/bin/v-list-sys-services | grep 'fail2ban' | grep -c 'running')
+if [ $fail2ban_running -eq 1 ]; then
+ systemctl stop fail2ban
+fi
+if [ -f "/var/lib/fail2ban/fail2ban.sqlite3" ]; then
+ rm /var/lib/fail2ban/fail2ban.sqlite3
+ if [ -f "/etc/nginx/conf.d/block.conf" ]; then
+ truncate -s 0 /etc/nginx/conf.d/block.conf
+ nginx_running=$(/usr/local/vesta/bin/v-list-sys-services | grep 'nginx' | grep -c 'running')
+ if [ $nginx_running -eq 1 ]; then
+ systemctl restart nginx
+ fi
+ fi
+fi
+if [ $fail2ban_running -eq 1 ]; then
+ systemctl start fail2ban
+fi
+
+# turn on tailf watcher process
+if [ -f "/usr/local/bin/tailf_apache_error.php" ]; then
+ nohup php /usr/local/bin/tailf_apache_error.php > /var/log/tailf_apache_error.log 2>&1 &
+fi
+if [ -f "/usr/local/bin/tailf_exim.php" ]; then
+ nohup php /usr/local/bin/tailf_exim.php > /var/log/tailf_exim.log 2>&1 &
+fi
+
+exim_installed=$(/usr/local/vesta/bin/v-list-sys-services | grep -c 'exim')
+if [ $exim_installed -gt 0 ]; then
+ systemctl restart exim4
+fi
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+echo ""
+echo "***** Garbage cleaned *****"
+echo ""
+echo "===== After cleaning ======"
+df -h
+echo "==========================="
+
+
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-clear-fail2ban b/bin/v-clear-fail2ban
new file mode 100644
index 00000000..ab3ab30c
--- /dev/null
+++ b/bin/v-clear-fail2ban
@@ -0,0 +1,59 @@
+#!/bin/bash
+# info: Clean fail2ban database
+# options: NONE
+#
+# The function is cleaning fail2ban database
+
+#----------------------------------------------------------#
+# Verifications & Variable & Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# check if fail2ban is installed
+fail2ban_installed=$(/usr/local/vesta/bin/v-list-sys-services | grep -c 'fail2ban')
+if [ $fail2ban_installed -eq 0 ]; then
+ echo "Fail2ban is not installed"
+ exit 1
+fi
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Cleaning fail2ban database
+fail2ban_running=$(/usr/local/vesta/bin/v-list-sys-services | grep 'fail2ban' | grep -c 'running')
+if [ $fail2ban_running -eq 1 ]; then
+ echo "== Stopping fail2ban"
+ systemctl stop fail2ban
+fi
+if [ -f "/var/lib/fail2ban/fail2ban.sqlite3" ]; then
+ echo "== Cleaning fail2ban database"
+ rm /var/lib/fail2ban/fail2ban.sqlite3
+ if [ -f "/etc/nginx/conf.d/block.conf" ]; then
+ echo "== Cleaning nginx block.conf"
+ truncate -s 0 /etc/nginx/conf.d/block.conf
+ nginx_running=$(/usr/local/vesta/bin/v-list-sys-services | grep 'nginx' | grep -c 'running')
+ if [ $nginx_running -eq 1 ]; then
+ echo "== Restarting nginx"
+ systemctl restart nginx
+ fi
+ fi
+fi
+if [ $fail2ban_running -eq 1 ]; then
+ echo "== Starting fail2ban"
+ systemctl start fail2ban
+fi
+
+echo "== Done, fail2ban database cleaned"
+
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-clone-website b/bin/v-clone-website
new file mode 100644
index 00000000..9bebbffd
--- /dev/null
+++ b/bin/v-clone-website
@@ -0,0 +1,467 @@
+#!/bin/bash
+# info: Migration tool that will copy whole site from one (sub)domain to another (sub)domain (on the same server)
+# options: FROM_DOMAIN TO_DOMAIN
+#
+# Migration tool that will copy whole site from one (sub)domain to another (sub)domain (on the same server), changing URL in database (it's careful with serialized arrays in database).
+# Useful for making staging copy in one command-line.
+# Automatic detection of WordPress, automaticaly read DB user, DB name, DB pass, automatic cloning to new database, automatic changing wp-config.php file.
+
+if [ $# -lt 2 ]; then
+ echo "USAGE: v-clone-website FROM_DOMAIN TO_DOMAIN"
+ echo "Available parameters:"
+ echo "--DATABASE_SUFIX=... (will be added to database name)"
+ echo "--TO_DATABASE=... (this will override --TO_DATABASE_NAME, --TO_DATABASE_USERNAME and --DATABASE_SUFIX)"
+ echo "--FROM_DATABASE_NAME=..."
+ echo "--FROM_DATABASE_USERNAME=..."
+ echo "--FROM_DATABASE_PASSWORD=..."
+ echo "--CONFIG_FILE=..."
+ echo "--TO_USER=..."
+ echo "--TO_DATABASE_NAME=..."
+ echo "--TO_DATABASE_USERNAME=..."
+ echo "--TO_DATABASE_PASSWORD=..."
+ echo "--SITE_SUBFOLDER=..."
+ echo "--EXCLUDE_UPLOADS=1 (or do not set it)"
+ exit 1
+fi
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+FROM_DOMAIN=$1
+TO_DOMAIN=$2
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner "$FROM_DOMAIN")
+if [ -z "$user" ]; then
+ echo "Error: domain $FROM_DOMAIN does not exists"
+ exit 2
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/db.sh
+source /usr/local/vesta/conf/vesta.conf
+
+FROM_DATABASE_NAME=''
+FROM_DATABASE_USERNAME=''
+FROM_DATABASE_PASSWORD=''
+FROM_CONFIG_FILE=''
+TO_DATABASE_NAME=''
+TO_DATABASE_USERNAME=''
+TO_DATABASE_PASSWORD=''
+DATABASE_SUFIX='_migrated'
+SITE_SUBFOLDER=''
+SEARCH_FOR_CONFIGS_DATABASE_NAME=''
+SEARCH_FOR_CONFIGS_DATABASE_USERNAME=''
+
+if [ ! -z "$MAX_DBUSER_LEN" ] && [ "$MAX_DBUSER_LEN" -ge 80 ]; then
+ DATABASE_SUFIX=''
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+# check_args '2' "$#" 'FROM_DOMAIN TO_DOMAIN'
+is_domain_format_valid "$FROM_DOMAIN"
+is_domain_format_valid "$TO_DOMAIN"
+
+FROM_USER=$user
+
+# take --parameters
+source /usr/local/vesta/func/handle_parameters.sh
+
+if [ -z "$SITE_SUBFOLDER" ]; then
+ r=$(/usr/local/vesta/bin/v-get-database-credentials-of-domain "$FROM_DOMAIN")
+else
+ r=$(/usr/local/vesta/bin/v-get-database-credentials-of-domain "$FROM_DOMAIN" "$SITE_SUBFOLDER")
+fi
+#echo $r
+#exit
+eval $r
+
+# take --parameters
+source /usr/local/vesta/func/handle_parameters.sh
+
+FROM_FOLDER=$SITE_FOLDER
+
+if [ ! -z "$CONFIG_FILE" ]; then
+ FROM_CONFIG_FILE=$CONFIG_FILE
+fi
+if [ ! -z "$FROM_CONFIG_FILE" ]; then
+ FROM_CONFIG_FILE_FULL_PATH="$FROM_FOLDER/$FROM_CONFIG_FILE"
+fi
+if [ ! -z "$CONFIG_FILE_FULL_PATH" ]; then
+ FROM_CONFIG_FILE_FULL_PATH=$CONFIG_FILE_FULL_PATH
+fi
+
+if [ ! -f "$FROM_CONFIG_FILE_FULL_PATH" ]; then
+ echo "Error: FROM_CONFIG_FILE_FULL_PATH $FROM_CONFIG_FILE_FULL_PATH does not exists"
+ exit 3
+fi
+
+IT_IS_WP=0
+if [ "$CMS_TYPE" = "wordpress" ]; then
+ IT_IS_WP=1
+fi
+
+if [ -z "$FROM_DATABASE_NAME" ]; then
+ FROM_DATABASE_NAME=$DATABASE_NAME
+fi
+if [ -z "$FROM_DATABASE_USERNAME" ]; then
+ FROM_DATABASE_USERNAME=$DATABASE_USERNAME
+fi
+if [ -z "$FROM_DATABASE_PASSWORD" ]; then
+ FROM_DATABASE_PASSWORD=$DATABASE_PASSWORD
+fi
+
+if [ -z "$FROM_DATABASE_NAME" ]; then
+ echo "Error: FROM_DATABASE_NAME is empty"
+ exit 4
+fi
+if [ -z "$FROM_DATABASE_USERNAME" ]; then
+ echo "Error: FROM_DATABASE_USERNAME is empty"
+ exit 5
+fi
+if [ -z "$FROM_DATABASE_PASSWORD" ]; then
+ echo "Error: FROM_DATABASE_PASSWORD is empty"
+ exit 6
+fi
+
+DB_EXISTS=$(check_if_database_exists "$user" "$FROM_DATABASE_NAME")
+if [ "$DB_EXISTS" = "no" ]; then
+ echo "Error: database $FROM_DATABASE_NAME does not exists"
+ exit 7
+fi
+
+FROM_DATABASE_NAME_WITHOUT_PREFIX=$(get_database_name_without_user_prefix "$FROM_USER" "$FROM_DATABASE_NAME")
+FROM_DATABASE_USERNAME_WITHOUT_PREFIX=$(get_database_name_without_user_prefix "$FROM_USER" "$FROM_DATABASE_USERNAME")
+
+FROM_DOMAIN_HAS_SSL=0
+if [ -f "/home/$FROM_USER/conf/web/ssl.$FROM_DOMAIN.ca" ]; then
+ FROM_DOMAIN_HAS_SSL=1
+fi
+
+FROM_DOMAIN_TPL=$(/usr/local/vesta/bin/v-list-web-domain "$FROM_USER" "$FROM_DOMAIN" | grep 'TEMPLATE:' | awk '{print $2}')
+FROM_DOMAIN_PROXY_TPL=$(/usr/local/vesta/bin/v-list-web-domain "$FROM_USER" "$FROM_DOMAIN" | grep 'PROXY:' | awk '{print $2}')
+FROM_DOMAIN_PROXY_EXT=$(/usr/local/vesta/bin/v-list-web-domain "$FROM_USER" "$FROM_DOMAIN" | grep 'PROXY EXT:' | cut -d ' ' -f8- | sed "s# #,#g")
+
+# ----------- TO -------------
+
+CREATE_TO_USER=0
+CREATE_TO_DOMAIN=0
+
+if [ -z "$TO_USER" ]; then
+ TO_USER=$(/usr/local/vesta/bin/v-search-domain-owner "$TO_DOMAIN")
+ if [ -z "$TO_USER" ]; then
+ TO_USER=$FROM_USER
+ CREATE_TO_DOMAIN=1
+ fi
+else
+ if [ ! -d "/home/$TO_USER" ]; then
+ CREATE_TO_USER=1
+ fi
+ if [ ! -d "/home/$TO_USER/web/$TO_DOMAIN/public_html" ]; then
+ CREATE_TO_DOMAIN=1
+ fi
+fi
+
+TO_FOLDER="/home/$TO_USER/web/$TO_DOMAIN/public_html"
+CHECK_PUBLIC_SHTML=$(/usr/local/vesta/bin/v-list-web-domain "$TO_USER" "$TO_DOMAIN" | grep 'SSL:' | grep -c 'single')
+if [ $CHECK_PUBLIC_SHTML -eq 1 ]; then
+ TO_FOLDER="/home/$TO_USER/web/$TO_DOMAIN/public_shtml"
+fi
+if [ ! -z "$SITE_SUBFOLDER" ]; then
+ TO_FOLDER="$TO_FOLDER/$SITE_SUBFOLDER"
+fi
+
+TO_CONFIG_FILE_FULL_PATH="$TO_FOLDER/$FROM_CONFIG_FILE"
+
+if [ ! -z "$MAX_DBUSER_LEN" ] && [ "$MAX_DBUSER_LEN" -ge 80 ] && [ -z "$DATABASE_SUFIX" ]; then
+ TO_DATABASE_NAME=$(echo "$TO_DOMAIN" | sed 's#\.#_#g')
+ TO_DATABASE_NAME="${TO_USER}_$TO_DATABASE_NAME"
+ TO_DATABASE_USERNAME=$TO_DATABASE_NAME
+else
+ LENGTH_OF_DATABASE_SUFIX=${#DATABASE_SUFIX}
+ if [ -z "$TO_DATABASE_NAME" ]; then
+ LENGTH_OF_TO_DATABASE_NAME=${#FROM_DATABASE_NAME}
+ START_FROM=$((LENGTH_OF_TO_DATABASE_NAME-LENGTH_OF_DATABASE_SUFIX))
+ CHECK_PREFIX=${FROM_DATABASE_NAME:START_FROM}
+ if [ "$CHECK_PREFIX" = "${DATABASE_SUFIX}" ]; then
+ TO_DATABASE_NAME="${TO_USER}_${FROM_DATABASE_NAME_WITHOUT_PREFIX}"
+ LENGTH_OF_TO_DATABASE_NAME=${#TO_DATABASE_NAME}
+ CUT_TO=$((LENGTH_OF_TO_DATABASE_NAME-LENGTH_OF_DATABASE_SUFIX))
+ TO_DATABASE_NAME=${TO_DATABASE_NAME:0:CUT_TO}
+ else
+ TO_DATABASE_NAME="${TO_USER}_${FROM_DATABASE_NAME_WITHOUT_PREFIX}${DATABASE_SUFIX}"
+ fi
+ fi
+ if [ -z "$TO_DATABASE_USERNAME" ]; then
+ LENGTH_OF_TO_DATABASE_USERNAME=${#FROM_DATABASE_USERNAME}
+ START_FROM=$((LENGTH_OF_TO_DATABASE_USERNAME-LENGTH_OF_DATABASE_SUFIX))
+ CHECK_PREFIX=${FROM_DATABASE_USERNAME:START_FROM}
+ if [ "$CHECK_PREFIX" = "${DATABASE_SUFIX}" ]; then
+ TO_DATABASE_USERNAME="${TO_USER}_${FROM_DATABASE_USERNAME_WITHOUT_PREFIX}"
+ LENGTH_OF_TO_DATABASE_USERNAME=${#TO_DATABASE_USERNAME}
+ CUT_TO=$((LENGTH_OF_TO_DATABASE_USERNAME-LENGTH_OF_DATABASE_SUFIX))
+ TO_DATABASE_USERNAME=${TO_DATABASE_USERNAME:0:CUT_TO}
+ else
+ TO_DATABASE_USERNAME="${TO_USER}_${FROM_DATABASE_USERNAME_WITHOUT_PREFIX}${DATABASE_SUFIX}"
+ fi
+ fi
+fi
+
+if [ ! -z "$TO_DATABASE" ]; then
+ TO_DATABASE_USERNAME=$TO_DATABASE
+ TO_DATABASE_NAME=$TO_DATABASE
+fi
+if [ -z "$TO_DATABASE_PASSWORD" ]; then
+ TO_DATABASE_PASSWORD=$FROM_DATABASE_PASSWORD
+fi
+if [ -z "$TO_DATABASE_NAME" ]; then
+ echo "Error: TO_DATABASE_NAME $TO_DATABASE_NAME is empty"
+ exit 10
+fi
+if [ -z "$TO_DATABASE_USERNAME" ]; then
+ echo "Error: TO_DATABASE_USERNAME $TO_DATABASE_USERNAME is empty"
+ exit 11
+fi
+if [ -z "$TO_DATABASE_PASSWORD" ]; then
+ echo "Error: TO_DATABASE_PASSWORD $TO_DATABASE_PASSWORD is empty"
+ exit 12
+fi
+
+TO_DATABASE_NAME_WITHOUT_PREFIX=$(get_database_name_without_user_prefix "$TO_USER" "$TO_DATABASE_NAME")
+TO_DATABASE_USERNAME_WITHOUT_PREFIX=$(get_database_name_without_user_prefix "$TO_USER" "$TO_DATABASE_USERNAME")
+
+
+TO_DOMAIN_HAS_SSL=0
+if [ -f "/home/$TO_USER/conf/web/ssl.$TO_DOMAIN.ca" ]; then
+ TO_DOMAIN_HAS_SSL=1
+fi
+SHOULD_INSTALL_SSL=0
+if [ $FROM_DOMAIN_HAS_SSL -eq 1 ] && [ $TO_DOMAIN_HAS_SSL -eq 0 ]; then
+ SHOULD_INSTALL_SSL=1
+fi
+
+FROM_FPM_VER=""
+if [[ $FROM_DOMAIN_TPL == "PHP-FPM-"* ]]; then
+ FROM_FPM_TPL_VER=${FROM_DOMAIN_TPL:8:2}
+ FROM_FPM_VER="${FROM_DOMAIN_TPL:8:1}.${FROM_DOMAIN_TPL:9:1}"
+fi
+
+# ----------- CHECK -------------
+
+if [ $IT_IS_WP -eq 0 ]; then
+ if [ ! -f "/root/Search-Replace-DB/srdb.cli.php" ]; then
+ if [ ! -f "/usr/bin/git" ]; then
+ apt-get update > /dev/null 2>&1
+ apt-get -y install git > /dev/null 2>&1
+ fi
+ cd /root
+ git clone https://github.com/interconnectit/Search-Replace-DB.git
+ fi
+fi
+
+CREATE_TO_DATABASE=0
+object=$(grep "DB='$TO_DATABASE_NAME'" $VESTA/data/users/$TO_USER/db.conf)
+if [ -z "$object" ]; then
+ CREATE_TO_DATABASE=1
+fi
+
+# ----------- PRINT -------------
+
+echo "==============================================================================="
+echo "FROM_DOMAIN = $FROM_DOMAIN"
+echo "TO_DOMAIN = $TO_DOMAIN"
+echo "FROM_USER = $FROM_USER"
+echo "TO_USER = $TO_USER"
+echo "SITE_SUBFOLDER = $SITE_SUBFOLDER"
+echo "FROM_FOLDER = $FROM_FOLDER"
+echo "TO_FOLDER = $TO_FOLDER"
+echo "CMS_TYPE = $CMS_TYPE"
+echo "IT_IS_WP = $IT_IS_WP"
+echo "CONFIG_FILE = $CONFIG_FILE"
+echo "FROM_CONFIG_FILE_FULL_PATH = $FROM_CONFIG_FILE_FULL_PATH"
+echo "TO_CONFIG_FILE_FULL_PATH = $TO_CONFIG_FILE_FULL_PATH"
+echo "FROM_DATABASE_NAME = $FROM_DATABASE_NAME"
+echo "TO_DATABASE_NAME = $TO_DATABASE_NAME"
+echo "FROM_DATABASE_USERNAME = $FROM_DATABASE_USERNAME"
+echo "TO_DATABASE_USERNAME = $TO_DATABASE_USERNAME"
+echo "FROM_DATABASE_PASSWORD = $FROM_DATABASE_PASSWORD"
+echo "TO_DATABASE_PASSWORD = $TO_DATABASE_PASSWORD"
+echo "FROM_DATABASE_NAME_WITHOUT_PREFIX = $FROM_DATABASE_NAME_WITHOUT_PREFIX"
+echo "TO_DATABASE_NAME_WITHOUT_PREFIX = $TO_DATABASE_NAME_WITHOUT_PREFIX"
+echo "FROM_DATABASE_USERNAME_WITHOUT_PREFIX = $FROM_DATABASE_USERNAME_WITHOUT_PREFIX"
+echo "TO_DATABASE_USERNAME_WITHOUT_PREFIX = $TO_DATABASE_USERNAME_WITHOUT_PREFIX"
+echo "DATABASE_SUFIX = $DATABASE_SUFIX"
+echo "CREATE_TO_USER = $CREATE_TO_USER"
+echo "CREATE_TO_DOMAIN = $CREATE_TO_DOMAIN"
+echo "CREATE_TO_DATABASE = $CREATE_TO_DATABASE"
+echo "SHOULD_INSTALL_SSL = $SHOULD_INSTALL_SSL"
+echo "FROM_DOMAIN_TPL = $FROM_DOMAIN_TPL"
+echo "FROM_FPM_VER = $FROM_FPM_VER"
+echo "FROM_DOMAIN_PROXY_TPL = $FROM_DOMAIN_PROXY_TPL"
+echo "FROM_DOMAIN_PROXY_EXT = $FROM_DOMAIN_PROXY_EXT"
+echo "SEARCH_FOR_CONFIGS_DATABASE_NAME = $SEARCH_FOR_CONFIGS_DATABASE_NAME"
+echo "SEARCH_FOR_CONFIGS_DATABASE_USERNAME = $SEARCH_FOR_CONFIGS_DATABASE_USERNAME"
+echo "EXCLUDE_UPLOADS = $EXCLUDE_UPLOADS"
+echo "==============================================================================="
+read -p "=== Press Enter to continue ==="
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+if [ $CREATE_TO_USER -eq 1 ]; then
+ pass=$(vesta_generate_pass 10)
+ echo "=== Create user $TO_USER, pass=$pass"
+ /usr/local/vesta/bin/v-add-user "$TO_USER" "$pass" "info@$TO_DOMAIN" "default" "Cloned" "site"
+fi
+
+if [ $CREATE_TO_DOMAIN -eq 1 ]; then
+ echo "=== Create domain $TO_DOMAIN"
+ /usr/local/vesta/bin/v-add-domain "$TO_USER" "$TO_DOMAIN"
+ rm $TO_FOLDER/index.html
+fi
+
+if [ $SHOULD_INSTALL_SSL -eq 1 ]; then
+ echo "=== Installing LetsEncrypt for domain $TO_DOMAIN"
+ /usr/local/vesta/bin/v-add-letsencrypt-domain "$TO_USER" "$TO_DOMAIN" "www.$TO_DOMAIN" "yes"
+ if [ $? -ne 0 ]; then
+ echo "=== LetsEncrypt installation failed"
+ fi
+fi
+
+if [ ! -z "$FROM_DOMAIN_TPL" ]; then
+ echo "=== Set $FROM_DOMAIN_TPL template to domain $TO_DOMAIN"
+ /usr/local/vesta/bin/v-change-web-domain-tpl "$TO_USER" "$TO_DOMAIN" "$FROM_DOMAIN_TPL" "yes"
+fi
+if [ "$SITE_SUBFOLDER" = ".." ]; then
+ if [ ! -z "$FROM_FPM_VER" ]; then
+ POOLD_FILE="/etc/php/$FROM_FPM_VER/fpm/pool.d/$TO_DOMAIN.conf"
+ echo "=== Removing public_html from open_basedir in $POOLD_FILE"
+ sed -i "s|/public_html:|:|g" $POOLD_FILE
+ sed -i "s|/public_shtml:|:|g" $POOLD_FILE
+ systemctl restart php${FROM_FPM_VER}-fpm
+ fi
+fi
+
+if [ ! -z "$FROM_DOMAIN_PROXY_TPL" ]; then
+ echo "=== Set $FROM_DOMAIN_PROXY_TPL proxy template to domain $TO_DOMAIN"
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$TO_USER" "$TO_DOMAIN" "$FROM_DOMAIN_PROXY_TPL" "$FROM_DOMAIN_PROXY_EXT" "yes"
+fi
+
+if [ $CREATE_TO_DATABASE -eq 1 ]; then
+ echo "=== Create database $TO_DATABASE_NAME"
+ /usr/local/vesta/bin/v-add-database "$TO_USER" "$TO_DATABASE_NAME_WITHOUT_PREFIX" "$TO_DATABASE_USERNAME_WITHOUT_PREFIX" "$TO_DATABASE_PASSWORD" 'mysql' 'localhost' 'utf8'
+fi
+
+echo "=== Dumping database $FROM_DATABASE_NAME"
+if [ -d "/root/temp" ]; then
+ rm -rf /root/temp
+fi
+mkdir -p /root/temp
+cd /root/temp
+mysqldump --max_allowed_packet=1024M $FROM_DATABASE_NAME > $FROM_DATABASE_NAME.sql
+echo "=== Importing to database $TO_DATABASE_NAME"
+mysql $TO_DATABASE_NAME < $FROM_DATABASE_NAME.sql
+rm $FROM_DATABASE_NAME.sql
+
+EXCLUDE=''
+if [ ! -z "$EXCLUDE_UPLOADS" ]; then
+ EXCLUDE="--exclude '/wp-content/uploads/*'"
+fi
+
+echo "=== Copying files from $FROM_FOLDER to folder $TO_FOLDER"
+if [ "$SITE_SUBFOLDER" != ".." ]; then
+ run="rsync -a --delete $EXCLUDE $FROM_FOLDER/ $TO_FOLDER/"
+ echo "====== Executing: $run"
+ eval $run
+else
+ run="rsync -a --delete $EXCLUDE --exclude 'logs/*' $FROM_FOLDER/ $TO_FOLDER/"
+ echo "====== Executing: $run"
+ eval $run
+fi
+echo "=== Chowning to $TO_USER:$TO_USER in folder $TO_FOLDER"
+chown -R $TO_USER:$TO_USER $TO_FOLDER
+
+replace_php_config_value "${FROM_DATABASE_NAME}" "${TO_DATABASE_NAME}" "$TO_CONFIG_FILE_FULL_PATH" "yes"
+replace_php_config_value "${FROM_DATABASE_USERNAME}" "${TO_DATABASE_USERNAME}" "$TO_CONFIG_FILE_FULL_PATH" "yes"
+replace_php_config_value "${FROM_DATABASE_PASSWORD}" "${TO_DATABASE_PASSWORD}" "$TO_CONFIG_FILE_FULL_PATH" "yes"
+
+echo "=== Replacing $FROM_DOMAIN to $TO_DOMAIN by searching in folder $TO_FOLDER"
+REGEXP_FROM_DOMAIN="${FROM_DOMAIN//\./\\.}"
+grep -rl "$REGEXP_FROM_DOMAIN" $TO_FOLDER | xargs sed -i "s#$REGEXP_FROM_DOMAIN#$TO_DOMAIN#g"
+if [ "$FROM_USER" != "$TO_USER" ]; then
+ echo "=== Replacing /home/$FROM_USER/ to /home/$TO_USER/ by searching in folder $TO_FOLDER"
+ grep -rl "/home/$FROM_USER/" $TO_FOLDER | xargs sed -i "s#/home/$FROM_USER/#/home/$TO_USER/#g"
+fi
+if [ ! -z "$SEARCH_FOR_CONFIGS_DATABASE_NAME" ]; then
+ echo "=== Replacing ${FROM_DATABASE_NAME} to ${TO_DATABASE_NAME} by searching in folder $TO_FOLDER [SEARCH_FOR_CONFIGS_DATABASE_NAME]"
+ grep -rl "${FROM_DATABASE_NAME}" $TO_FOLDER | xargs sed -i "s#${FROM_DATABASE_NAME}#${TO_DATABASE_NAME}#g"
+fi
+if [ ! -z "$SEARCH_FOR_CONFIGS_DATABASE_USERNAME" ]; then
+ DO_SEARCH_FOR_CONFIGS_DATABASE_USERNAME=1;
+ if [ ! -z "$SEARCH_FOR_CONFIGS_DATABASE_NAME" ] && [ "$SEARCH_FOR_CONFIGS_DATABASE_NAME" = "$SEARCH_FOR_CONFIGS_DATABASE_USERNAME" ]; then
+ DO_SEARCH_FOR_CONFIGS_DATABASE_USERNAME=0
+ fi
+ if [ $DO_SEARCH_FOR_CONFIGS_DATABASE_USERNAME -eq 1 ]; then
+ echo "=== Replacing ${FROM_DATABASE_USERNAME} to ${TO_DATABASE_USERNAME} by searching in folder $TO_FOLDER [SEARCH_FOR_CONFIGS_DATABASE_USERNAME]"
+ grep -rl "${FROM_DATABASE_USERNAME}" $TO_FOLDER | xargs sed -i "s#${FROM_DATABASE_USERNAME}#${TO_DATABASE_USERNAME}#g"
+ fi
+fi
+
+if [ $IT_IS_WP -eq 0 ]; then
+ echo "=== Replacing $FROM_DOMAIN to $TO_DOMAIN in database $TO_DATABASE_NAME"
+ php /root/Search-Replace-DB/srdb.cli.php -h localhost -n "$TO_DATABASE_NAME" -u "$TO_DATABASE_USERNAME" -p "$TO_DATABASE_PASSWORD" -s "$FROM_DOMAIN" -r "$TO_DOMAIN"
+ if [ "$FROM_USER" != "$TO_USER" ]; then
+ echo "=== Replacing /home/$FROM_USER/ to /home/$TO_USER/ in database $TO_DATABASE_NAME"
+ php /root/Search-Replace-DB/srdb.cli.php -h localhost -n "$TO_DATABASE_NAME" -u "$TO_DATABASE_USERNAME" -p "$TO_DATABASE_PASSWORD" -s "/home/$FROM_USER/" -r "/home/$TO_USER/"
+ fi
+else
+ echo "=== Replacing $FROM_DOMAIN to $TO_DOMAIN in database $TO_DATABASE_NAME"
+ /usr/local/vesta/bin/v-run-wp-cli $TO_DOMAIN search-replace "$FROM_DOMAIN" "$TO_DOMAIN" --precise --all-tables --skip-columns=guid --skip-plugins --skip-themes;
+ if [ "$FROM_USER" != "$TO_USER" ]; then
+ echo "=== Replacing /home/$FROM_USER/ to /home/$TO_USER/ in database $TO_DATABASE_NAME"
+ /usr/local/vesta/bin/v-run-wp-cli $TO_DOMAIN search-replace "/home/$FROM_USER/" "/home/$TO_USER/" --precise --all-tables --skip-columns=guid --skip-plugins --skip-themes;
+ fi
+ /usr/local/vesta/bin/v-run-wp-cli $TO_DOMAIN cache flush --skip-plugins --skip-themes;
+ /usr/local/vesta/bin/v-run-wp-cli $TO_DOMAIN config shuffle-salts WP_CACHE_KEY_SALT --force --skip-plugins --skip-themes;
+ /usr/local/vesta/bin/v-run-wp-cli $TO_DOMAIN config shuffle-salts --skip-plugins --skip-themes;
+fi
+
+# ----------- Update Wordfence WAF Path -------------
+
+# Path to .user.ini file in the new domain directory
+user_ini="/home/$TO_USER/web/$TO_DOMAIN/public_html/.user.ini"
+
+# Check if .user.ini exists
+if [ -f "$user_ini" ]; then
+ echo "Updating .user.ini with new path..."
+
+ # Change path from old domain to new domain
+ sed -i "s|/home/.*/public_html|/home/$TO_USER/web/$TO_DOMAIN/public_html|g" $user_ini
+
+ # Check if replacement was successful and update .user.ini
+ if [ $? -eq 0 ]; then
+ echo ".user.ini updated successfully."
+ else
+ echo "Failed to update .user.ini file."
+ fi
+fi
+
+echo "===== DONE ===="
+echo "You can visit http://$TO_DOMAIN/"
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-commander b/bin/v-commander
new file mode 100644
index 00000000..a7fbf454
--- /dev/null
+++ b/bin/v-commander
@@ -0,0 +1,634 @@
+#!/bin/bash
+
+numargs=$#
+
+SHOWHEADER=0
+if [ $numargs -eq 0 ]; then
+ SHOWHEADER=1
+fi
+if [ $numargs -eq 1 ] && [ "$1" = "q" ]; then
+ SHOWHEADER=1
+fi
+
+
+source /etc/profile
+PATH=$PATH:/usr/local/vesta/bin && export PATH
+if [ $SHOWHEADER -eq 1 ]; then
+ echo "======================= mvVesta-commander ================================"
+fi
+
+if [ -f /root/kernelupdate ]; then
+ rm /root/kernelupdate
+fi
+apt_updated=0
+apt_upgraded=0
+quit_on_empty=0
+
+if [ $SHOWHEADER -eq 1 ]; then
+ hostname
+ if [ -f "/root/current-status.txt" ]; then
+ echo "------------------ WAS LONG TIME AGO ------------------"
+ cat /root/current-status.txt
+ truncate -s 0 /root/current-status.txt
+ fi
+ echo -n 'Debian ' >> /root/current-status.txt && cat /etc/debian_version >> /root/current-status.txt
+ php -v | grep '^PHP' >> /root/current-status.txt
+ /usr/local/vesta/bin/v-list-sys-services >> /root/current-status.txt
+ /usr/local/vesta/bin/v-list-sys-web-status | grep "Server MPM:" >> /root/current-status.txt
+ w | grep 'load average' >> /root/current-status.txt
+ df -h | grep "/$" >> /root/current-status.txt
+
+ echo "------------------------ NOW ------------------------"
+ cat /root/current-status.txt
+ echo "-----------------------------------------------------"
+ echo "(press 'h' for help)"
+ echo ""
+fi
+
+check_status() {
+ echo "=============================================================="
+ hostname
+ echo "------------------------ WAS ------------------------"
+ cat /root/current-status.txt
+ echo "------------------------ NOW ------------------------"
+ hostname
+ echo -n 'Debian ' && cat /etc/debian_version
+ php -v | grep '^PHP'
+ /usr/local/vesta/bin/v-list-sys-services
+ /usr/local/vesta/bin/v-list-sys-web-status | grep "Server MPM:"
+ w | grep 'load average'
+ df -h | grep "/$"
+ echo "-----------------------------------------------------"
+}
+
+myhelp() {
+ echo "---------- Press: -----------"
+ echo "a = Activate Email rate limit"
+ echo "b = bash"
+ echo "c = check status"
+ echo "d = df -h"
+ echo "e = make sure Apache is in mpm_event"
+ echo "f = free -h"
+ echo "g = apt-get upgrade"
+ echo "h = help"
+ echo "m = install php-memcached"
+ echo "p = set version of php as default"
+ echo "q = quit"
+ echo "r = reboot"
+ echo "s = download sury.org apt-get key"
+ echo "n = download nginx gpg key"
+ echo "freexian = add Freexian repository"
+ echo "t = clean the trash"
+ echo "u = apt-get update"
+ echo "v = update myVesta"
+ echo "vo = update myVesta without 'apt-get update'"
+ echo "w = w"
+ echo "-----------------------------"
+ echo "inst v = install myVesta"
+ echo "inst p = install multi-php"
+ echo "inst pgw = install php-gate"
+ echo "inst r = install new Roundcube"
+ echo "inst memcached = install memcached"
+ echo "inst redis = install Redis"
+ echo "inst nginx-rate-limit = install nginx-rate-limit templates"
+ echo "dis fb = stop and disable fail2ban"
+ echo "dis dove = stop and disable dovecot"
+ echo "dis spam = stop and disable spamassassin"
+ echo "dis clam = stop and disable ClamAV"
+ echo "p 7.0 = set default php 7.0"
+ echo "p 7.3 = set default php 7.3"
+ echo "p 7.4 = set default php 7.4"
+ echo "p def = set proper default php"
+ echo "e def = set mpm_event if needed"
+ echo "m def = install php-memcached if needed"
+ echo "check fc = check if FreshClam is up"
+ echo "-----------------------------"
+ echo "enable-ssh-root-password-login = Allow root password authentication via SSH"
+ echo "id_rsa = generate id_rsa and id_rsa.pub if it does not exist and show id_rsa.pub"
+ echo "-----------------------------"
+}
+
+apt_update() {
+ echo "============================="
+ echo "== running: apt-get update"
+ release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+ if [ "$release" -lt 10 ]; then
+ apt-get update
+ else
+ apt-get update --allow-releaseinfo-change
+ fi
+ apt_updated=1
+}
+
+COUNTER=0
+HAS_PARAMETERS=0
+
+while true
+do
+
+ COUNTER=$((COUNTER + 1))
+ if [ $COUNTER -le $numargs ]; then
+ HAS_PARAMETERS=1
+ answer=$1
+ shift
+ else
+ if [ $HAS_PARAMETERS -eq 1 ]; then
+ exit;
+ fi
+ read -p 'What to do: ' answer
+ fi
+
+ if [ "$answer" = 'prompt' ] || [ "$answer" = 'PROMPT' ]; then
+ echo "============================="
+ echo "hostname: $HOSTNAME"
+ read -p 'What to do [or press Enter to continue]: ' answer
+ fi
+
+ if [ "$answer" = '' ] && [ $quit_on_empty -eq 1 ]; then
+ answer='q'
+ fi
+
+ if [ "$answer" = 'quit-on-empty' ]; then
+ echo "== the script will quit on next enter"
+ quit_on_empty=1
+ HAS_PARAMETERS=0
+ fi
+
+
+ if [ "$answer" = 'a' ] || [ "$answer" = 'A' ]; then
+ mv /etc/exim4/exim4.conf.template /etc/exim4/exim4.conf.template-backup
+ cp /usr/local/vesta/install/debian/12/exim/exim4.conf.template /etc/exim4/exim4.conf.template
+
+ touch /etc/exim4/limit_per_email_account_max_sent_emails_per_hour
+ touch /etc/exim4/limit_per_email_account_max_recipients
+ touch /etc/exim4/limit_per_hosting_account_max_sent_emails_per_hour
+ touch /etc/exim4/limit_per_hosting_account_max_recipients
+
+ check_grep=$(grep -c '#SPAMASSASSIN' /etc/exim4/exim4.conf.template-backup)
+ if [ "$check_grep" -eq 0 ]; then
+ sed -i "s|#SPAMASSASSIN|SPAMASSASSIN|g" /etc/exim4/exim4.conf.template
+ fi
+
+ check_grep=$(grep -c '#SPAM_SCORE' /etc/exim4/exim4.conf.template-backup)
+ if [ "$check_grep" -eq 0 ]; then
+ sed -i "s|#SPAM_SCORE|SPAM_SCORE|g" /etc/exim4/exim4.conf.template
+ fi
+
+ check_grep=$(grep -c '#CLAMD' /etc/exim4/exim4.conf.template-backup)
+ if [ "$check_grep" -eq 0 ]; then
+ sed -i "s|#CLAMD|CLAMD|g" /etc/exim4/exim4.conf.template
+ fi
+
+ systemctl restart exim4
+ echo "Email rate limit activated."
+ fi
+
+
+
+ if [ "$answer" = 'u' ] || [ "$answer" = 'U' ]; then
+ apt_update
+ fi
+
+ if [ "$answer" = 'g' ] || [ "$answer" = 'G' ]; then
+ echo "============================="
+ echo "== running: apt-get upgrade"
+
+ if [ $apt_upgraded -eq 0 ]; then
+ cp /var/log/apt/history.log /var/log/apt/history-`date +"%Y%m%d%H%M%S"`.log
+ truncate -s 0 /var/log/apt/history.log
+ fi
+
+ apt-get -y --with-new-pkgs upgrade
+ apt-get -y dist-upgrade
+ apt_upgraded=1
+
+ kernelupdate=$(grep -c 'linux-image-' /var/log/apt/history.log)
+ dbusupdate=$(grep -c ' dbus:a' /var/log/apt/history.log)
+ if [ $kernelupdate -gt 0 ] || [ $dbusupdate -gt 0 ] || [ -f "/run/reboot-required" ] || [ -f "/var/run/reboot-required" ]; then
+ touch /root/kernelupdate
+ echo "== kernel is updated, reboot is required!"
+ fi
+ fi
+
+ if [ "$answer" = 'c' ] || [ "$answer" = 'C' ]; then
+ check_status
+ fi
+
+ if [ "$answer" = 's' ] || [ "$answer" = 'S' ]; then
+ if [ -f "/etc/apt/trusted.gpg.d/php.gpg" ]; then
+ echo "============================="
+ echo "== renewing sury.org gpg key"
+ wget -nv -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
+ fi
+ fi
+
+ if [ "$answer" = 'n' ] || [ "$answer" = 'N' ]; then
+ if [ -f "/etc/apt/sources.list.d/nginx.list" ]; then
+ echo "============================="
+ echo "== renewing nginx gpg key"
+ apt-get update
+ apt-get -y install curl gnupg2 ca-certificates lsb-release debian-archive-keyring
+ curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
+ echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/debian `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list
+ fi
+ fi
+
+ if [ "$answer" = 'freexian' ] || [ "$answer" = 'FREEXIAN' ]; then
+ if [ "$release" -lt 11 ]; then
+ echo "============================="
+ echo "== adding Freexian repository"
+ apt-get update
+ apt-get install lsb-release
+ wget https://deb.freexian.com/extended-lts/pool/main/f/freexian-archive-keyring/freexian-archive-keyring_2022.06.08_all.deb && sudo dpkg -i freexian-archive-keyring_2022.06.08_all.deb
+ cat /etc/apt/sources.list
+ mv /etc/apt/sources.list /etc/apt/sources.list.old
+ echo "deb http://deb.freexian.com/extended-lts `lsb_release -cs` main contrib non-free" > /etc/apt/sources.list
+ rm /etc/apt/sources.list.d/hetzner*
+ else
+ echo "== Freexian is not supported on Debian 11 or higher"
+ fi
+ fi
+
+ if [ "$answer" = 'e def' ] || [ "$answer" = 'E DEF' ]; then
+ release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+ echo "============================="
+ echo "== checking if we need mpm_event mode"
+ echo "== detected Debian $release"
+ if [ "$release" -eq 10 ] || [ "$release" -eq 11 ] || [ -f "/root/switch-apache-to-event-mode.sh" ]; then
+ isevent=$(/usr/local/vesta/bin/v-list-sys-web-status | grep -c "Server MPM: event")
+ if [ $isevent -eq 0 ]; then
+ echo "== Apache should be switched to mpm_event mode"
+ answer='e'
+ else
+ echo "== Apache is already in mpm_event mode"
+ fi
+ fi
+
+ fi
+ if [ "$answer" = 'e' ] || [ "$answer" = 'E' ]; then
+ echo "============================="
+ echo "== switching to mpm_event mode"
+ apt-get -y remove libapache2-mod-php*
+ a2dismod ruid2
+ a2dismod suexec
+ a2dismod php5.6
+ a2dismod php7.0
+ a2dismod php7.1
+ a2dismod php7.2
+ a2dismod php7.3
+ a2dismod php7.4
+ a2dismod php8.0
+ a2dismod php8.1
+ a2dismod php8.2
+ a2dismod mpm_prefork
+ a2enmod mpm_event
+ systemctl restart apache2
+ fi
+
+ if [ "$answer" = 'dis fb' ] || [ "$answer" = 'DIS FB' ]; then
+ echo "============================="
+ echo "== disabling fail2ban"
+ systemctl stop fail2ban
+ systemctl disable fail2ban
+ systemctl status fail2ban
+ fi
+
+ if [ "$answer" = 'dis dove' ] || [ "$answer" = 'DIS DOVE' ]; then
+ echo "============================="
+ echo "== disabling dovecot"
+ systemctl stop dovecot.service
+ systemctl stop dovecot.socket
+ systemctl disable dovecot.service
+ fi
+
+ if [ "$answer" = 'dis clam' ] || [ "$answer" = 'DIS CLAM' ]; then
+ echo "============================="
+ echo "== disabling ClamAV"
+ systemctl stop clamav-daemon.service
+ systemctl disable clamav-daemon.service
+
+ systemctl stop clamav-daemon.socket
+ systemctl disable clamav-daemon.socket
+
+ systemctl stop clamav-freshclam.service
+ systemctl disable clamav-freshclam.service
+
+ sed -i "s/^CLAMD =/#CLAMD =/g" /etc/exim4/exim4.conf.template
+ systemctl restart exim4
+ fi
+
+ if [ "$answer" = 'dis spam' ] || [ "$answer" = 'DIS SPAM' ]; then
+ echo "============================="
+ echo "== disabling SpamAssassin"
+ release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+ if [ "$release" -lt 12 ]; then
+ systemctl stop spamassassin.service
+ systemctl disable spamassassin.service
+ else
+ systemctl stop spamd.service
+ systemctl disable spamd.service
+ fi
+
+ sed -i "s/^SPAMASSASSIN =/#SPAMASSASSIN =/g" /etc/exim4/exim4.conf.template
+ sed -i "s/^SPAM_SCORE =/#SPAM_SCORE =/g" /etc/exim4/exim4.conf.template
+ systemctl restart exim4
+ fi
+
+ if [ "$answer" = 'p' ] || [ "$answer" = 'P' ]; then
+ echo "============================="
+ echo "== changing default php version"
+ update-alternatives --config php
+ echo "--- NEW ---"
+ php -v | grep '^PHP'
+ fi
+
+ if [ "$answer" = 'p 7.0' ] || [ "$answer" = 'P 7.0' ]; then
+ echo "============================="
+ echo "== changing default php version to 7.0"
+ update-alternatives --set php /usr/bin/php7.0
+ echo "--- NEW ---"
+ php -v | grep '^PHP'
+ fi
+
+ if [ "$answer" = 'p 7.3' ] || [ "$answer" = 'P 7.3' ]; then
+ echo "============================="
+ echo "== changing default php version to 7.3"
+ update-alternatives --set php /usr/bin/php7.3
+ echo "--- NEW ---"
+ php -v | grep '^PHP'
+ fi
+
+ if [ "$answer" = 'p 7.4' ] || [ "$answer" = 'P 7.4' ]; then
+ echo "============================="
+ echo "== changing default php version to 7.4"
+ update-alternatives --set php /usr/bin/php7.4
+ echo "--- NEW ---"
+ php -v | grep '^PHP'
+ fi
+
+ if [ "$answer" = 'p def' ] || [ "$answer" = 'P DEF' ]; then
+ echo "============================="
+ echo "== checking if we need to change default php version"
+ automode=$(update-alternatives --display php | grep -c 'auto mode')
+ echo "============================="
+ if [ $automode -ge 1 ]; then
+ echo "=== php auto mode detected"
+ release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+ echo "== detected Debian $release"
+ if [ "$release" -eq 8 ]; then
+ echo "== set default php 5"
+ update-alternatives --set php /usr/bin/php5
+ fi
+ if [ "$release" -eq 9 ]; then
+ echo "== set default php 7.0"
+ update-alternatives --set php /usr/bin/php7.0
+ fi
+ if [ "$release" -eq 10 ]; then
+ echo "== set default php 7.3"
+ update-alternatives --set php /usr/bin/php7.3
+ fi
+ if [ "$release" -eq 11 ]; then
+ echo "== set default php 7.4"
+ update-alternatives --set php /usr/bin/php7.4
+ fi
+ echo "--- NEW ---"
+ php -v | grep '^PHP'
+ else
+ echo "== php is already in manual mode"
+ php -v | grep '^PHP'
+ fi
+ fi
+
+
+ if [ "$answer" = 'v' ] || [ "$answer" = 'V' ]; then
+ echo "============================="
+ echo "== updating myVesta"
+ if [ -f "/usr/local/vesta/bin/v-update-myvesta" ]; then
+ /usr/local/vesta/bin/v-update-myvesta
+ else
+ number_of_files=$(ls /var/cache/apt/archives/vesta_.* 2>/dev/null | wc -l)
+ if [ $number_of_files -gt 0 ]; then
+ rm /var/cache/apt/archives/vesta_* > /dev/null 2>&1
+ fi
+ apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" > /usr/local/vesta/log/update-$package.log 2>&1
+ apt-get install --reinstall vesta
+ fi
+ fi
+
+ if [ "$answer" = 'vo' ] || [ "$answer" = 'VO' ]; then
+ echo "============================="
+ echo "== updating myVesta (without 'apt-get update')"
+ number_of_files=$(ls /var/cache/apt/archives/vesta_.* 2>/dev/null | wc -l)
+ if [ $number_of_files -gt 0 ]; then
+ rm /var/cache/apt/archives/vesta_* > /dev/null 2>&1
+ fi
+ apt-get install --reinstall vesta
+ fi
+
+ if [ "$answer" = 'vor' ] || [ "$answer" = 'VOR' ]; then
+ echo "============================="
+ echo "== updating myVesta (without apt-get update and without reinstall)"
+ number_of_files=$(ls /var/cache/apt/archives/vesta_.* 2>/dev/null | wc -l)
+ if [ $number_of_files -gt 0 ]; then
+ rm /var/cache/apt/archives/vesta_* > /dev/null 2>&1
+ fi
+ apt-get install vesta
+ fi
+
+ if [ "$answer" = 't' ] || [ "$answer" = 'T' ]; then
+ echo "============================="
+ echo "== cleaning trash"
+ df -m
+ echo "------"
+ ps -Af | grep tailf | grep -v "grep tailf"
+ echo "------"
+ /usr/local/vesta/bin/v-clean-garbage
+ echo "--------------"
+ df -m
+ echo "--------------"
+ ps -Af | grep tailf | grep -v "grep tailf"
+ fi
+
+ if [ "$answer" = 'm def' ] || [ "$answer" = 'M DEF' ]; then
+ phpupdate=$(grep -c 'php' /var/log/apt/history.log)
+ if [ $phpupdate -gt 0 ]; then
+ answer='m'
+ fi
+ fi
+
+ if [ "$answer" = 'm' ] || [ "$answer" = 'M' ]; then
+ echo "============================="
+ echo "== installing php-memcache modules"
+ apt-get install -y $(systemctl --full --type service --all | grep "php...-fpm" | sed 's#●##g' | awk '{print $1}' | cut -c1-6 | xargs -n 1 printf "%s-memcache ")
+ apt-get install -y $(systemctl --full --type service --all | grep "php...-fpm" | sed 's#●##g' | awk '{print $1}' | cut -c1-6 | xargs -n 1 printf "%s-memcached ")
+ fi
+
+ if [ "$answer" = 'd' ] || [ "$answer" = 'D' ]; then
+ echo "============================="
+ echo "== running: df -h"
+ df -h
+ fi
+
+ if [ "$answer" = 'f' ] || [ "$answer" = 'F' ]; then
+ echo "============================="
+ echo "== running: free -h"
+ free -h
+ fi
+
+ if [ "$answer" = 'w' ] || [ "$answer" = 'W' ]; then
+ echo "== running: free -h"
+ w
+ fi
+
+ if [ "$answer" = 'inst p' ] || [ "$answer" = 'INST P' ]; then
+ echo "============================="
+ echo "== installing new PHP versions"
+ cd /root
+ wget -nv -O /root/vesta-inst-php.sh https://c.myvestacp.com/tools/multi-php-install.sh
+ chmod u+x ./vesta-inst-php.sh
+ mcedit ./vesta-inst-php.sh
+ sudo ./vesta-inst-php.sh
+ fi
+
+ if [ "$answer" = 'inst pgw' ] || [ "$answer" = 'INST PGW' ]; then
+ echo "============================="
+ echo "== Installing phpgate"
+ wget -nv http://dl.myvestacp.com/vesta/install-phpgate.sh -O /root/install-phpgate.sh
+ chmod u+x /root/install-phpgate.sh
+ /root/install-phpgate.sh
+ fi
+
+ if [ "$answer" = 'inst memcache' ] || [ "$answer" = 'inst memcached' ] || [ "$answer" = 'INST MEMCACHE' ] || [ "$answer" = 'INST MEMCACHED' ]; then
+ echo "============================="
+ echo "== Installing memcached"
+ memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
+ apt-get update
+ apt-get -y install memcached
+ apt-get -y install $(systemctl --full --type service --all | grep "php...-fpm" | sed 's#●##g' | awk '{print $1}' | cut -c1-6 | xargs -n 1 printf "%s-memcache ")
+ apt-get -y install $(systemctl --full --type service --all | grep "php...-fpm" | sed 's#●##g' | awk '{print $1}' | cut -c1-6 | xargs -n 1 printf "%s-memcached ")
+ if [ $memory -lt 15000000 ]; then
+ sed -i "s/-m 64/-m 256/" /etc/memcached.conf
+ else
+ sed -i "s/-m 64/-m 1024/" /etc/memcached.conf
+ fi
+ systemctl restart memcached
+ echo "== memcached installed."
+ echo "-----------------------"
+ fi
+
+ if [ "$answer" = 'inst redis' ] || [ "$answer" = 'INST REDIS' ]; then
+ echo "============================="
+ echo "== Installing Redis"
+ memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
+ apt-get update
+ apt-get install -y redis-server
+ apt-get install $(systemctl --full --type service --all | grep "php...-fpm" | sed 's#●##g' | awk '{print $1}' | cut -c1-6 | xargs -n 1 printf "%s-redis ")
+
+ sed -i "s|^supervised no|supervised systemd|g" /etc/redis/redis.conf
+ sed -i "s|^save |# save |g" /etc/redis/redis.conf
+ sed -i 's|^# save ""|save ""|g' /etc/redis/redis.conf
+ if [ $memory -lt 15000000 ]; then
+ sed -i "s|^# maxmemory .*|maxmemory 256m|g" /etc/redis/redis.conf
+ else
+ sed -i "s|^# maxmemory .*|maxmemory 1g|g" /etc/redis/redis.conf
+ fi
+ sed -i "s|^# maxmemory-policy .*|maxmemory-policy allkeys-lru|g" /etc/redis/redis.conf
+ systemctl restart redis
+ redis-cli info memory
+ echo "== Redis installed."
+ echo "-------------------"
+ fi
+
+ if [ "$answer" = 'inst nginx-rate-limit' ] || [ "$answer" = 'INST NGINX-RATE-LIMIT' ]; then
+ echo "============================="
+ echo "== Installing inst nginx-rate-limit templates"
+ curl -O https://c.myvestacp.com/tools/rate-limit-tpl/install_rate_limit_tpl.sh
+ bash install_rate_limit_tpl.sh
+ echo "== nginx-rate-limit templates installed."
+ echo "-------------------"
+ fi
+
+ if [ "$answer" = 'check fc' ] || [ "$answer" = 'CHECK FC' ]; then
+ echo "== Checking if FreshClam is up"
+ clamavup=$(/usr/local/vesta/bin/v-list-sys-services | grep 'clamav-daemon' | grep -c 'running')
+ freshclamdown=$(/usr/local/vesta/bin/v-list-sys-services | grep 'clamav-freshclam' | grep -c 'off')
+ if [ $clamavup -eq 1 ] && [ $freshclamdown -eq 1 ]; then
+ echo "== Starting FreshClam"
+ systemctl enable clamav-freshclam.service
+ systemctl start clamav-freshclam.service
+ fi
+ fi
+
+ if [ "$answer" = 'enable-ssh-root-password-login' ] || [ "$answer" = 'ENABLE-SSH-ROOT-PASSWORD-LOGIN' ]; then
+ sed -i "s|^PermitRootLogin .*|PermitRootLogin yes|g" /etc/ssh/sshd_config
+ sed -i "s|^#PermitRootLogin .*|PermitRootLogin yes|g" /etc/ssh/sshd_config
+ systemctl restart sshd
+ echo "--- New settings ---"
+ grep '^PermitRoot' /etc/ssh/sshd_config
+ echo "--------------------"
+ echo "Port 22 opened in Firewall for all IP addresses."
+ /usr/local/vesta/bin/v-unsuspend-firewall-rule "11"
+ echo "--------------------"
+ echo "Type 'passwd' in the terminal to set the root password."
+ echo "--------------------"
+ fi
+
+ if [ "$answer" = 'r' ] || [ "$answer" = 'R' ]; then
+ echo "============================="
+ echo "== Rebooting the server"
+ reboot
+ fi
+
+ if [ "$answer" = 'b' ] || [ "$answer" = 'B' ]; then
+ echo "============================="
+ echo "== Running bash"
+ bash
+ fi
+
+ if [ "$answer" = 'q' ] || [ "$answer" = 'Q' ]; then
+ echo "============================="
+ echo "== Exiting... bye bye :)"
+ exit 0
+ fi
+
+ if [ "$answer" = 'h' ] || [ "$answer" = 'H' ]; then
+ myhelp
+ fi
+
+ if [ "$answer" = 'inst v' ] || [ "$answer" = 'INST V' ]; then
+ echo "============================="
+ echo "== installing myVesta"
+ release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+ if [ "$release" -lt 10 ]; then
+ apt-get update
+ else
+ apt-get update --allow-releaseinfo-change
+ fi
+ apt-get -y --with-new-pkgs upgrade && apt-get -y dist-upgrade
+ apt-get -y install curl wget mc git sudo dnsutils screen
+ cd ~
+ curl -O http://c.myvestacp.com/vst-install-debian.sh
+ sudo bash vst-install-debian.sh
+ source /etc/profile
+ PATH=$PATH:/usr/local/vesta/bin && export PATH
+ fi
+
+ if [ "$answer" = 'inst r' ] || [ "$answer" = 'INST R' ]; then
+ echo "============================="
+ echo "== Installing new Roundcube"
+ wget -nv https://c.myvestacp.com/tools/install-new-roundcube.sh -O /root/install-new-roundcube.sh
+ chmod u+x /root/install-new-roundcube.sh
+ mcedit /root/install-new-roundcube.sh
+ /root/install-new-roundcube.sh
+ fi
+
+ if [ "$answer" = 'id_rsa' ] || [ "$answer" = 'ID_RSA' ]; then
+ if [ ! -f "/root/.ssh/id_rsa.pub" ]; then
+ ssh-keygen -q -t rsa -N '' -C "$HOSTNAME" -b 4096 -f /root/.ssh/id_rsa 2>/dev/null <<< y >/dev/null
+ fi
+ echo "=== YOUR id_rsa.pub IS BELOW ==="
+ cat /root/.ssh/id_rsa.pub
+ echo "======"
+ fi
+
+done
diff --git a/bin/v-copy-fs-file b/bin/v-copy-fs-file
index 792956ec..87447b40 100755
--- a/bin/v-copy-fs-file
+++ b/bin/v-copy-fs-file
@@ -43,7 +43,7 @@ fi
# Checking destination path
rpath=$(readlink -f "$dst_file")
if [ -z "$(echo $rpath |egrep "^/tmp|^$homedir")" ]; then
- echo "Error: ivalid destination path $dst_file"
+ echo "Error: invalid destination path $dst_file"
exit 2
fi
diff --git a/bin/v-deactivate-vesta-license b/bin/v-deactivate-vesta-license
index 5839aaad..4f80d0c4 100755
--- a/bin/v-deactivate-vesta-license
+++ b/bin/v-deactivate-vesta-license
@@ -35,7 +35,7 @@ check_args '2' "$#" 'MODULE LICENSE'
# Activating license
v_host='https://vestacp.com/checkout'
-answer=$(curl -s $v_host/cancel.php?licence_key=$license)
+answer=$(curl --max-time 60 -s $v_host/cancel.php?licence_key=$license)
check_result $? "cant' connect to vestacp.com " $E_CONNECT
# Checking server answer
diff --git a/bin/v-delete-database-of-domain b/bin/v-delete-database-of-domain
new file mode 100644
index 00000000..30fd18c0
--- /dev/null
+++ b/bin/v-delete-database-of-domain
@@ -0,0 +1,69 @@
+#!/bin/bash
+# info: delete database if domain has database
+# options: DOMAIN
+#
+# The function for deleting database if domain has database
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+RET=$OK
+
+# echo "================================="
+r=$(/usr/local/vesta/bin/v-get-database-credentials-of-domain $domain)
+# echo $r
+eval $r
+# echo "================================="
+
+if [ ! -z "$DATABASE_NAME" ]; then
+ echo "=== v-delete-database $USER $DATABASE_NAME"
+ /usr/local/vesta/bin/v-delete-database $USER $DATABASE_NAME
+ if [ $? -ne 0 ]; then
+ echo "=== v-delete-database failed"
+ RET=$E_NOTEXIST
+ fi
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+log_event "$RET" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-delete-domain b/bin/v-delete-domain
index b6294679..1ca3373b 100755
--- a/bin/v-delete-domain
+++ b/bin/v-delete-domain
@@ -37,9 +37,10 @@ is_object_unsuspended 'user' 'USER' "$user"
if [ ! -z "$WEB_SYSTEM" ]; then
str=$(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
if [ ! -z "$str" ]; then
+ $BIN/v-delete-database-of-domain $domain
domain_found='yes'
$BIN/v-delete-web-domain $user $domain 'no'
- check_result $? "can't suspend web" > /dev/null
+ check_result $? "can't delete web" > /dev/null
fi
fi
@@ -49,7 +50,7 @@ if [ ! -z "$DNS_SYSTEM" ]; then
if [ ! -z "$str" ]; then
domain_found='yes'
$BIN/v-delete-dns-domain $user $domain 'no'
- check_result $? "can't suspend dns" > /dev/null
+ check_result $? "can't delete dns" > /dev/null
fi
fi
@@ -59,7 +60,7 @@ if [ ! -z "$MAIL_SYSTEM" ]; then
if [ ! -z "$str" ]; then
domain_found='yes'
$BIN/v-delete-mail-domain $user $domain
- check_result $? "can't suspend mail" > /dev/null
+ check_result $? "can't delete mail" > /dev/null
fi
fi
diff --git a/bin/v-delete-firewall-ban b/bin/v-delete-firewall-ban
index 52f3403d..cb5b352c 100755
--- a/bin/v-delete-firewall-ban
+++ b/bin/v-delete-firewall-ban
@@ -53,6 +53,11 @@ $iptables -D fail2ban-$chain $b 2>/dev/null
# Changing permissions
chmod 660 $conf
+# nginx deny rules conf
+if [ "$chain" = "WEB" ] && [ -f "/etc/nginx/conf.d/block.conf" ]; then
+ sed -i "/deny $ip;/d" /etc/nginx/conf.d/block.conf
+ systemctl reload nginx
+fi
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-delete-firewall-rule b/bin/v-delete-firewall-rule
index 8f646644..10fd0fb9 100755
--- a/bin/v-delete-firewall-rule
+++ b/bin/v-delete-firewall-rule
@@ -34,12 +34,21 @@ is_object_valid '../../data/firewall/rules' 'RULE' "$rule"
# Action #
#----------------------------------------------------------#
+oldvalues=$(grep "RULE='$rule'" $VESTA/data/firewall/rules.conf)
+
# Deleting rule
sed -i "/RULE='$rule' /d" $VESTA/data/firewall/rules.conf
# Updating system firewall
$BIN/v-update-firewall
+if [ "$WEB_SYSTEM" == 'nginx' ] || [ "$PROXY_SYSTEM" == 'nginx' ]; then
+ parse_object_kv_list_non_eval "$oldvalues"
+ if [ "$PORT" == "80,443" ] && [ "$ACTION" == "DROP" ]; then
+ sed -i "\#$IP#d" /etc/nginx/conf.d/block-firewall.conf
+ systemctl restart nginx
+ fi
+fi
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-delete-inactive-wordpress-plugins-and-themes b/bin/v-delete-inactive-wordpress-plugins-and-themes
new file mode 100644
index 00000000..e9b1715c
--- /dev/null
+++ b/bin/v-delete-inactive-wordpress-plugins-and-themes
@@ -0,0 +1,165 @@
+#!/bin/bash
+# info: delete inactive WordPress plugins and themes
+# options: DOMAIN
+
+#----------------------------------------------------------#
+# Variable & Function #
+#----------------------------------------------------------#
+
+[ "$(whoami)" != "root" ] && { echo "You must be root to run this command."; exit 1; }
+source /etc/profile
+
+DOMAIN="$1"
+[ -z "$DOMAIN" ] && { echo "Usage: v-delete-inactive-wordpress-plugins-and-themes DOMAIN"; exit 1; }
+
+USER="$(/usr/local/vesta/bin/v-search-domain-owner "$DOMAIN")"
+[ -z "$USER" ] && { echo "Domain $DOMAIN does not exist."; exit 1; }
+
+WP_PATH="/home/$USER/web/$DOMAIN/public_html"
+[ ! -f "$WP_PATH/wp-config.php" ] && { echo "WordPress is not installed on this domain."; exit 1; }
+
+# WP-CLI wrapper
+if [ ! -z "$PHP" ]; then
+ WP_RUN="PHP=$PHP /usr/local/vesta/bin/v-run-wp-cli $DOMAIN --skip-plugins --skip-themes"
+else
+ WP_RUN="/usr/local/vesta/bin/v-run-wp-cli $DOMAIN --skip-plugins --skip-themes"
+fi
+
+quarantined=0;
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+cd "$WP_PATH" || exit 1
+echo "Inactive WordPress plugins for $DOMAIN:"
+echo "-------------------------------------"
+
+RUN="$WP_RUN plugin list --format=csv --skip-plugins --skip-themes"
+PLUGINS_LIST_CSV=$(eval "$RUN")
+return_code=$?
+
+if [ $return_code -ne 0 ]; then
+ echo "WP-CLI error:"
+ echo "return code: $return_code"
+ cat /home/$USER/web/$DOMAIN/wp-cli-error.log
+ exit $return_code
+fi
+
+PLUGINS_LIST_CSV=$(echo "$PLUGINS_LIST_CSV" | tail -n +2)
+
+DEACTIVATED_PLUGINS_LIST_CSV=""
+
+if [ ! -z "$PLUGINS_LIST_CSV" ]; then
+ printf "%-30s %-20s %-20s %-20s %-20s %-20s\n" "name" "status" "update" "version" "update_version" "auto_update"
+ while IFS=',' read -r NAME STATUS UPDATE VERSION UPDATE_VERSION AUTO_UPDATE; do
+ if [ "$STATUS" = "inactive" ]; then
+ printf "%-30s %-20s %-20s %-20s %-20s %-20s\n" "$NAME" "$STATUS" "$UPDATE" "$VERSION" "$UPDATE_VERSION" "$AUTO_UPDATE"
+ DEACTIVATED_PLUGINS_LIST_CSV="$DEACTIVATED_PLUGINS_LIST_CSV\n$NAME"
+ fi
+ done <<< "$PLUGINS_LIST_CSV"
+else
+ echo "No plugins found."
+fi
+
+if [ ! -z "$DEACTIVATED_PLUGINS_LIST_CSV" ]; then
+ echo ""
+ read -r -p "Do you want to move inactive plugins to quarantine? (y/n, default: y): " RESPONSE < /dev/tty
+ if [ "$RESPONSE" == "y" ] || [ "$RESPONSE" == "Y" ] || [ -z "$RESPONSE" ]; then
+ while IFS=',' read -r NAME STATUS UPDATE VERSION UPDATE_VERSION AUTO_UPDATE; do
+ if [ "$STATUS" = "inactive" ]; then
+ folder="/home/$USER/web/$DOMAIN/public_html/wp-content/plugins/$NAME"
+ file="/home/$USER/web/$DOMAIN/public_html/wp-content/plugins/$NAME.php"
+ if [ -d "$folder" ] || [ -f "$file" ]; then
+ destination_base_folder="/srv/wp-deactivated-plugins/$DOMAIN"
+ if [ -d "$folder" ]; then
+ source_path="$folder"
+ destination_path="$destination_base_folder/$NAME"
+ elif [ -f "$file" ]; then
+ source_path="$file"
+ destination_path="$destination_base_folder/$NAME.php"
+ fi
+ mkdir -p $destination_base_folder
+ chown $USER:$USER $destination_base_folder
+ mv $source_path $destination_path
+ if [ -d "$destination_path" ]; then
+ echo "= Folder $source_path moved to $destination_path"
+ quarantined=1;
+ fi
+ if [ -f "$destination_path" ]; then
+ echo "= File $source_path moved to $destination_path"
+ quarantined=1;
+ fi
+ else
+ echo "=== ERROR: Folder $folder or file $file not found - it does not exist?"
+ fi
+ fi
+ done <<< "$PLUGINS_LIST_CSV"
+ fi
+fi
+
+echo ""
+echo "Inactive WordPress themes for $DOMAIN:"
+echo "-------------------------------------"
+
+RUN="$WP_RUN theme list --format=csv --skip-plugins --skip-themes"
+THEMES_LIST_CSV=$(eval "$RUN")
+return_code=$?
+
+if [ $return_code -ne 0 ]; then
+ echo "WP-CLI error:"
+ echo "return code: $return_code"
+ cat /home/$USER/web/$DOMAIN/wp-cli-error.log
+ exit $return_code
+fi
+
+THEMES_LIST_CSV=$(echo "$THEMES_LIST_CSV" | tail -n +2)
+
+DEACTIVATED_THEMES_LIST_CSV=""
+
+if [ ! -z "$THEMES_LIST_CSV" ]; then
+ printf "%-30s %-20s %-20s %-20s %-20s %-20s\n" "name" "status" "update" "version" "update_version" "auto_update"
+ while IFS=',' read -r NAME STATUS UPDATE VERSION UPDATE_VERSION AUTO_UPDATE; do
+ if [ "$STATUS" = "inactive" ]; then
+ printf "%-30s %-20s %-20s %-20s %-20s %-20s\n" "$NAME" "$STATUS" "$UPDATE" "$VERSION" "$UPDATE_VERSION" "$AUTO_UPDATE"
+ DEACTIVATED_THEMES_LIST_CSV="$DEACTIVATED_THEMES_LIST_CSV\n$NAME"
+ fi
+ done <<< "$THEMES_LIST_CSV"
+else
+ echo "No themes found."
+fi
+
+if [ ! -z "$DEACTIVATED_THEMES_LIST_CSV" ]; then
+ echo ""
+ read -r -p "Do you want to move inactive themes to quarantine? (y/n, default: y): " RESPONSE < /dev/tty
+ if [ "$RESPONSE" == "y" ] || [ "$RESPONSE" == "Y" ] || [ -z "$RESPONSE" ]; then
+ while IFS=',' read -r NAME STATUS UPDATE VERSION UPDATE_VERSION AUTO_UPDATE; do
+ if [ "$STATUS" = "inactive" ]; then
+ folder="/home/$USER/web/$DOMAIN/public_html/wp-content/themes/$NAME"
+ if [ -d "$folder" ]; then
+ destination_base_folder="/srv/wp-deactivated-themes/$DOMAIN"
+ source_path="$folder"
+ destination_path="$destination_base_folder/$NAME"
+ mkdir -p $destination_base_folder
+ chown $USER:$USER $destination_base_folder
+ mv $source_path $destination_path
+ if [ -d "$destination_path" ]; then
+ echo "= Folder $source_path moved to $destination_path"
+ quarantined=1;
+ fi
+ else
+ echo "=== ERROR: Folder $folder not found - it does not exist?"
+ fi
+ fi
+ done <<< "$THEMES_LIST_CSV"
+ fi
+fi
+
+echo ""
+if [ $quarantined -eq 1 ]; then
+ echo "= All deactivated plugins and themes moved to quarantine."
+ echo "= You can find them in /srv/wp-deactivated-plugins/$DOMAIN and /srv/wp-deactivated-themes/$DOMAIN"
+else
+ echo "= No deactivated plugins or themes found."
+fi
+exit 0;
diff --git a/bin/v-delete-mail-account b/bin/v-delete-mail-account
index f0da423c..09c41b50 100755
--- a/bin/v-delete-mail-account
+++ b/bin/v-delete-mail-account
@@ -53,6 +53,7 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
sed -i "/^$account@$domain_idn:/d" $HOMEDIR/$user/conf/mail/$domain/aliases
sed -i "/^$account:/d" $HOMEDIR/$user/conf/mail/$domain/passwd
+ sed -i "/^$account:/d" $HOMEDIR/$user/conf/mail/$domain/accounts
rm -rf $HOMEDIR/$user/mail/$domain/$account
fi
diff --git a/bin/v-delete-mail-domain b/bin/v-delete-mail-domain
index ee727aa9..9be565bb 100755
--- a/bin/v-delete-mail-domain
+++ b/bin/v-delete-mail-domain
@@ -51,6 +51,9 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
rm -f /etc/$MAIL_SYSTEM/domains/$domain_idn
rm -rf $HOMEDIR/$user/conf/mail/$domain
rm -rf $HOMEDIR/$user/mail/$domain_idn
+ if [ -d "/hdd/home/$user/mail/$domain_idn" ]; then
+ rm -rf /hdd/home/$user/mail/$domain_idn
+ fi
fi
# Deleting dkim dns record
diff --git a/bin/v-delete-mail-domain-dkim b/bin/v-delete-mail-domain-dkim
index f11e48d4..7cfbab58 100755
--- a/bin/v-delete-mail-domain-dkim
+++ b/bin/v-delete-mail-domain-dkim
@@ -48,7 +48,7 @@ fi
# Deleting dns record
if [ ! -z "$DNS_SYSTEM" ] && [ -e "$USER_DATA/dns/$domain.conf" ]; then
records=$($BIN/v-list-dns-records $user $domain plain)
- dkim_records=$(echo "$records" |grep -w '_domainkey' | cut -f 1 -d ' ')
+ dkim_records=$(echo "$records" |grep -w '_domainkey' | awk '{print $1}')
for id in $dkim_records; do
$BIN/v-delete-dns-record $user $domain $id
done
diff --git a/bin/v-delete-mails b/bin/v-delete-mails
new file mode 100644
index 00000000..24ac68e5
--- /dev/null
+++ b/bin/v-delete-mails
@@ -0,0 +1,127 @@
+#!/bin/bash
+# info: delete old emails (by mtime) for user/domain/account, with optional scope
+# usage: v-delete-mails USER DOMAIN ACCOUNT MTIME_DAYS|all SCOPE
+# SCOPE: all – clean every Maildir folder (cur, new, tmp, custom subfolders)
+# trash – clean only Trash/Junk/Spam folders
+
+# load Vesta functions & config
+source "$VESTA/func/main.sh"
+source "$VESTA/conf/vesta.conf"
+
+# read arguments
+user="$1"
+domain="$2"
+account="$3"
+mtime="$4"
+scope="$5"
+
+# verify argument count
+check_args '5' "$#" 'USER DOMAIN ACCOUNT MTIME_DAYS|all SCOPE'
+
+# validate scope
+if [[ "$scope" != "all" && "$scope" != "trash" ]]; then
+ echo "ERROR: SCOPE must be 'all' or 'trash'."
+ exit 1
+fi
+
+# validate logical combinations
+if [[ "$user" == "all" ]]; then
+ if [[ "$domain" != "all" || "$account" != "all" ]]; then
+ echo "ERROR: When USER is 'all', both DOMAIN and ACCOUNT must be 'all'."
+ exit 1
+ fi
+elif [[ "$domain" == "all" && "$account" != "all" ]]; then
+ echo "ERROR: When DOMAIN is 'all', ACCOUNT must also be 'all'."
+ exit 1
+fi
+
+# build a detailed summary for the warning
+declare -a summary_parts
+if [[ "$user" == "all" ]]; then
+ summary_parts+=("all users")
+else
+ summary_parts+=("user '$user'")
+fi
+
+if [[ "$domain" == "all" ]]; then
+ summary_parts+=("all domains")
+else
+ summary_parts+=("domain '$domain'")
+fi
+
+if [[ "$account" == "all" ]]; then
+ summary_parts+=("all accounts")
+else
+ summary_parts+=("account '$account'")
+fi
+
+# join with commas
+summary=$(printf ", %s" "${summary_parts[@]}")
+summary=${summary:2}
+
+# only warn if any of them is 'all' or if mtime is 'all'
+if [[ "$mtime" == "all" || "$user" == "all" || "$domain" == "all" || "$account" == "all" ]]; then
+ echo "WARNING: This will delete emails older than '$mtime' days for ${summary}."
+ read -p "Are you sure? (yes/no): " confirm
+ [[ "$confirm" != "yes" ]] && { echo "Aborted."; exit 1; }
+fi
+
+# function to delete emails
+delete_emails() {
+ local u="$1" d="$2" a="$3"
+ local maildir="/home/$u/mail/$d/$a"
+
+ [[ ! -d "$maildir" ]] && return
+
+ echo "→ Cleaning '$a@$d' (user: $u), scope: $scope, mtime: $mtime"
+
+ # build find predicates
+ if [[ "$scope" == "all" ]]; then
+ folder_expr=( -path "*/cur/*" -o -path "*/new/*" -o -path "*/tmp/*" )
+ else
+ folder_expr=( -ipath "*/trash/*" -o -ipath "*/junk/*" -o -ipath "*/spam/*" )
+ fi
+
+ # assemble and run find
+ if [[ "$mtime" == "all" ]]; then
+ find "$maildir" -type f \( "${folder_expr[@]}" \) -print -delete 2>/dev/null
+ else
+ find "$maildir" -type f \( "${folder_expr[@]}" \) -mtime +"$mtime" -print -delete 2>/dev/null
+ fi
+}
+
+# collect users
+if [[ "$user" == "all" ]]; then
+ users=$(v-list-users plain | awk '{print $1}')
+else
+ users="$user"
+fi
+
+# iterate through users, domains, accounts
+for u in $users; do
+ if [[ "$domain" == "all" ]]; then
+ domains=$(v-list-mail-domains "$u" plain | awk '{print $1}')
+ else
+ domains="$domain"
+ fi
+
+ for d in $domains; do
+ if [[ "$account" == "all" ]]; then
+ accounts=$(v-list-mail-accounts "$u" "$d" plain | awk '{print $1}')
+ else
+ accounts="$account"
+ fi
+
+ for a in $accounts; do
+ delete_emails "$u" "$d" "$a"
+ done
+ done
+done
+
+# restart dovecot to refresh mailbox state
+systemctl restart dovecot
+
+# log the action (status first, then message)
+log_event "$OK" "Deleted emails (>$mtime days, scope=$scope) for $user $domain $account"
+
+exit 0
diff --git a/bin/v-delete-user b/bin/v-delete-user
index c452f0a0..cdf809eb 100755
--- a/bin/v-delete-user
+++ b/bin/v-delete-user
@@ -94,6 +94,9 @@ fi
# Deleting user directories
chattr -i $HOMEDIR/$user/conf
rm -rf $HOMEDIR/$user
+if [ -d "/hdd/home/$user" ]; then
+ rm -rf /hdd/home/$user
+fi
rm -f /var/spool/mail/$user
rm -f /var/spool/cron/$user
rm -f /var/spool/cron/crontabs/$user
diff --git a/bin/v-delete-web-domain b/bin/v-delete-web-domain
index 75399766..e64dd9a7 100755
--- a/bin/v-delete-web-domain
+++ b/bin/v-delete-web-domain
@@ -62,36 +62,24 @@ if [ -f "$fpmconf" ]; then
rm $fpmconf
echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
fi
-fpmconf="/etc/php/5.6/fpm/pool.d/$domain.conf"
-if [ -f "$fpmconf" ]; then
- rm $fpmconf
- echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
-fi
-fpmconf="/etc/php/7.0/fpm/pool.d/$domain.conf"
-if [ -f "$fpmconf" ]; then
- rm $fpmconf
- echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
-fi
-fpmconf="/etc/php/7.1/fpm/pool.d/$domain.conf"
-if [ -f "$fpmconf" ]; then
- rm $fpmconf
- echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
-fi
-fpmconf="/etc/php/7.2/fpm/pool.d/$domain.conf"
-if [ -f "$fpmconf" ]; then
- rm $fpmconf
- echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
-fi
-fpmconf="/etc/php/7.3/fpm/pool.d/$domain.conf"
-if [ -f "$fpmconf" ]; then
- rm $fpmconf
- echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
-fi
-fpmconf="/etc/php/7.4/fpm/pool.d/$domain.conf"
-if [ -f "$fpmconf" ]; then
- rm $fpmconf
- echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
-fi
+
+for PHPV in /etc/php/*; do
+ if [ -d "${PHPV}" ]; then
+ # PHPVER=$(basename ${PHPV})
+ POOLD="${PHPV}/fpm/pool.d"
+ fpmconf="$POOLD/$domain.conf"
+ if [ -f "$fpmconf" ]; then
+ rm $fpmconf
+ echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
+ fi
+ POOLD="${PHPV}/fpm/pool.d-ioncube"
+ fpmconf="$POOLD/$domain.conf"
+ if [ -f "$fpmconf" ]; then
+ rm $fpmconf
+ echo "Deleted: $fpmconf" >> /usr/local/vesta/log/system.log
+ fi
+ fi
+done
# Deleting domain from web.conf
sed -i "/DOMAIN='$domain'/ d" $USER_DATA/web.conf
@@ -142,6 +130,9 @@ rm -f /var/log/$WEB_SYSTEM/domains/$domain.error*
# Deleting directory
rm -rf $HOMEDIR/$user/web/$domain
+if [ -d "/hdd/home/$user/web/$domain" ]; then
+ rm -rf /hdd/home/$user/web/$domain
+fi
#----------------------------------------------------------#
diff --git a/bin/v-delete-web-domain-ssl b/bin/v-delete-web-domain-ssl
index 05e8c940..30272928 100755
--- a/bin/v-delete-web-domain-ssl
+++ b/bin/v-delete-web-domain-ssl
@@ -57,8 +57,14 @@ fi
# Deleting old certificate
tmpdir=$(mktemp -p $HOMEDIR/$user/web/$domain/private -d)
-rm -f $HOMEDIR/$user/conf/web/ssl.$domain.*
-mv $USER_DATA/ssl/$domain.* $tmpdir
+rm -f $HOMEDIR/$user/conf/web/ssl.$domain.ca
+rm -f $HOMEDIR/$user/conf/web/ssl.$domain.crt
+rm -f $HOMEDIR/$user/conf/web/ssl.$domain.key
+rm -f $HOMEDIR/$user/conf/web/ssl.$domain.pem
+mv $USER_DATA/ssl/$domain.ca $tmpdir
+mv $USER_DATA/ssl/$domain.crt $tmpdir
+mv $USER_DATA/ssl/$domain.key $tmpdir
+mv $USER_DATA/ssl/$domain.pem $tmpdir
chown -R $user:$user $tmpdir
diff --git a/bin/v-delete-wordpress-uploads-php-files b/bin/v-delete-wordpress-uploads-php-files
new file mode 100644
index 00000000..ce72c0c4
--- /dev/null
+++ b/bin/v-delete-wordpress-uploads-php-files
@@ -0,0 +1,64 @@
+#!/bin/bash
+# info: delete PHP files from WordPress uploads folder
+# options: DOMAIN
+
+#----------------------------------------------------------#
+# Variable & Function #
+#----------------------------------------------------------#
+
+[ "$(whoami)" != "root" ] && { echo "You must be root to run this command."; exit 1; }
+source /etc/profile
+
+DOMAIN="$1"
+[ -z "$DOMAIN" ] && { echo "Usage: v-delete-wordpress-uploads-php-files DOMAIN"; exit 1; }
+
+USER="$(/usr/local/vesta/bin/v-search-domain-owner "$DOMAIN")"
+[ -z "$USER" ] && { echo "Domain $DOMAIN does not exist."; exit 1; }
+
+WP_PATH="/home/$USER/web/$DOMAIN/public_html"
+[ ! -f "$WP_PATH/wp-config.php" ] && { echo "WordPress is not installed on this domain."; exit 1; }
+
+quarantined=0;
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+cd "$WP_PATH" || exit 1
+
+files=$(find wp-content/uploads/ -type f -name "*.php")
+
+if [ -z "$files" ]; then
+ echo "= No PHP files found in WordPress uploads folder."
+ exit 0;
+fi
+
+echo "= Found PHP files in WordPress uploads folder for domain $DOMAIN :"
+echo "-------------------------------------"
+echo "$files"
+echo "-------------------------------------"
+
+read -r -p "Do you want to move these files to quarantine? (y/n, default: y): " RESPONSE < /dev/tty
+if [ "$RESPONSE" == "y" ] || [ "$RESPONSE" == "Y" ] || [ -z "$RESPONSE" ]; then
+ for file in $files; do
+ source_file="/home/$USER/web/$DOMAIN/public_html/$file"
+ destination_file="/srv/wp-uploads-php-files-quarantine/$DOMAIN/$file"
+ destination_folder=$(dirname "$destination_file")
+ mkdir -p "$destination_folder"
+ chown $USER:$USER "$destination_folder"
+ mv "$source_file" "$destination_file"
+ echo "= File $source_file moved to $destination_file"
+ quarantined=1;
+ done
+ chown -R $USER:$USER "/srv/wp-uploads-php-files-quarantine/$DOMAIN"
+fi
+
+echo ""
+if [ $quarantined -eq 1 ]; then
+ echo "= All PHP files moved to quarantine."
+ echo "= You can find them in /srv/wp-uploads-php-files-quarantine/$DOMAIN"
+else
+ echo "= No PHP files found in WordPress uploads folder."
+fi
+
+exit 0;
\ No newline at end of file
diff --git a/bin/v-desinfect-wordpress b/bin/v-desinfect-wordpress
new file mode 100644
index 00000000..51ee217e
--- /dev/null
+++ b/bin/v-desinfect-wordpress
@@ -0,0 +1,86 @@
+#!/bin/bash
+# info: disinfect a WordPress site with several maintenance commands
+# options: DOMAIN
+
+# -------------------------------------------------------- #
+# variables and checks #
+# -------------------------------------------------------- #
+
+if [ "$(whoami)" != "root" ]; then
+ echo "You must be root to run this command."
+ exit 1
+fi
+
+# make sure all Vesta helper scripts are reachable
+export PATH="/usr/local/vesta/bin:$PATH"
+source /etc/profile
+
+domain="$1"
+if [ -z "$domain" ]; then
+ echo "Usage: v-desinfect-wp DOMAIN"
+ exit 1
+fi
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner "$domain")
+if [ -z "$user" ]; then
+ echo "Domain $domain does not exist."
+ exit 1
+fi
+
+if [ ! -f "/usr/local/vesta/bin/v-wf-malware-hyperscan-with-remediate" ]; then
+ echo "= WordFence CLI is not installed. Installing..."
+ /usr/local/vesta/bin/v-install-wordfence-cli
+fi
+
+# absolute paths to maintenance scripts, in desired order
+declare -a tasks=(
+ "/usr/local/vesta/bin/v-change-database-password-for-wordpress"
+ "/usr/local/vesta/bin/v-change-wordpress-admin-passwords"
+ "/usr/local/vesta/bin/v-fix-wordpress-core"
+ "/usr/local/vesta/bin/v-delete-inactive-wordpress-plugins-and-themes"
+ "/usr/local/vesta/bin/v-delete-wordpress-uploads-php-files"
+ "/usr/local/vesta/bin/v-wf-malware-hyperscan-with-remediate"
+ "INTERACTIVE=1 /usr/local/vesta/bin/v-wf-malware-hyperscan-with-remediate"
+)
+
+# -------------------------------------------------------- #
+# execution strategy #
+# -------------------------------------------------------- #
+
+echo
+read -r -p "Run all maintenance steps automatically? (y/n) " run_all < /dev/tty
+
+if [[ "$run_all" =~ ^[Yy]$ ]]; then
+ echo "Running all maintenance steps for $domain"
+ automatic=true
+else
+ echo
+ echo "Selective mode. You will be asked for each step."
+ automatic=false
+fi
+
+for cmd in "${tasks[@]}"; do
+ if [ ! -x "$cmd" ]; then
+ echo "Command $cmd not found or not executable, skipping."
+ continue
+ fi
+
+ if [ "$automatic" = false ]; then
+ while true; do
+ read -r -p "Run $(basename "$cmd") for $domain? (y/n) " yn < /dev/tty
+ case "$yn" in
+ [Yy]* ) break ;;
+ [Nn]* ) echo "Skipping $(basename "$cmd")."; continue 2 ;;
+ * ) echo "Please answer y or n." ;;
+ esac
+ done
+ fi
+
+ echo
+ echo "=== $(basename "$cmd") $domain ==="
+ "$cmd" "$domain"
+done
+
+echo
+echo "Done."
+exit 0
diff --git a/bin/v-df-snapshot-diff b/bin/v-df-snapshot-diff
new file mode 100644
index 00000000..ee427bd2
--- /dev/null
+++ b/bin/v-df-snapshot-diff
@@ -0,0 +1,102 @@
+#!/bin/bash
+# info: Make a diff between two snapshots of the disk usage
+# options: FILE1 FILE2
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Let's declare three associative arrays
+declare -A FILE1
+declare -A FILE2
+declare -A FILED
+
+file1=$1
+file2=$2
+
+if [[ ! "$file1" =~ ^/usr/local/vesta/data/df/snapshot-.*\.txt$ ]]; then
+ file1="/usr/local/vesta/data/df/$file1"
+fi
+
+if [[ ! "$file2" =~ ^/usr/local/vesta/data/df/snapshot-.*\.txt$ ]]; then
+ file2="/usr/local/vesta/data/df/$file2"
+fi
+
+if [ ! -f "$file1" ]; then
+ echo "File $file1 not found"
+ exit 1
+fi
+
+if [ ! -f "$file2" ]; then
+ echo "File $file2 not found"
+ exit 1
+fi
+
+timestamp=$(date +%Y-%m-%d-%H-%M-%S)
+mkdir -p /usr/local/vesta/data/df-diff
+file0="/usr/local/vesta/data/df-diff/diff-$timestamp.txt"
+file0s="/usr/local/vesta/data/df-diff/diff-size-sorted-$timestamp.txt"
+file0f="/usr/local/vesta/data/df-diff/diff-folder-sorted-$timestamp.txt"
+touch $file0
+
+# Let's load the first file and fill the array FILE1
+while IFS=$'\t' read SIZE DIRECTORY; do
+ # Skip blank lines or lines that are not in the correct format
+ [[ -z "$DIRECTORY" ]] && continue
+ [[ "$DIRECTORY" = "total" ]] && continue
+ # Insert values into the array
+ FILE1["$DIRECTORY"]="$SIZE"
+done < "$file1"
+
+# Let's load the second file and fill the array FILE2
+while IFS=$'\t' read SIZE DIRECTORY; do
+ # Skip blank lines or lines that are not in the correct format
+ [[ -z "$DIRECTORY" ]] && continue
+ [[ "$DIRECTORY" = "total" ]] && continue
+ # Insert values into the array
+ FILE2["$DIRECTORY"]="$SIZE"
+done < "$file2"
+
+# We iterate through FILE1 and look for the matching key in FILE2
+for k in "${!FILE1[@]}"; do
+ if [[ -v FILE2["$k"] ]]; then
+ # If there is the same folder (KEY) in FILE2
+ DIFF=$(( ${FILE2[$k]} - ${FILE1[$k]} ))
+ FILED["$k"]=$DIFF
+ echo -e "${DIFF}\t${k}" >> $file0
+ else
+ # If the folder (KEY) is not found in FILE2
+ FILED["$k"]=${FILE1["$k"]}
+ echo -e "${FILE1["$k"]}\t${k}" >> $file0
+ fi
+done
+
+# sorted by size
+sort -nr -k1,1 $file0 > $file0s
+
+# sorted by folders
+while IFS=$'\t' read SIZE DIRECTORY; do
+ [[ -z "$DIRECTORY" ]] && continue
+ [[ "$DIRECTORY" = "total" ]] && continue
+ echo -e "$DIRECTORY\t${FILED["$DIRECTORY"]}" >> $file0f
+done < "$file2"
+
+chmod 600 $file0 $file0s $file0f
+chown root:root $file0 $file0s $file0f
+
+echo "Done."
+echo "You can do:"
+echo "mcview $file0"
+echo "mcview $file0s"
+echo "mcview $file0f"
+echo "--------------------------------"
+echo "Here is the first 30 lines of the diff, sorted by size (descending, in MB):"
+head -n 30 $file0s
+echo "--------------------------------"
+echo "Here is the first 30 lines of the diff, sorted by folders (in MB):"
+head -n 30 $file0f
+echo "--------------------------------"
+
+exit 0
diff --git a/bin/v-df-snapshot-logs-cleaner b/bin/v-df-snapshot-logs-cleaner
new file mode 100644
index 00000000..63275034
--- /dev/null
+++ b/bin/v-df-snapshot-logs-cleaner
@@ -0,0 +1,11 @@
+#!/bin/bash
+# info: Clean up old snapshots of the disk usage
+# options: NONE
+
+folder="/usr/local/vesta/data/df"
+mkdir -p $folder
+find $folder -type f -mtime +30 -delete
+
+folder="/usr/local/vesta/data/df-diff"
+mkdir -p $folder
+find $folder -type f -mtime +30 -delete
diff --git a/bin/v-df-snapshot-make b/bin/v-df-snapshot-make
new file mode 100644
index 00000000..985aab15
--- /dev/null
+++ b/bin/v-df-snapshot-make
@@ -0,0 +1,52 @@
+#!/bin/bash
+# info: Make a snapshot of the disk usage
+# options: NONE
+
+folder="/usr/local/vesta/data/df"
+
+mkdir -p $folder
+timestamp=$(date +%Y-%m-%d-%H-%M-%S)
+
+du --max-depth=1 -m -x / > $folder/snapshot-$timestamp.txt
+
+du --max-depth=6 -m -x /home > $folder/snapshot-temp.txt
+for i in {2..7}; do
+ while IFS= read -r line; do
+ count=0
+ for (( j=0; j<${#line}; j++ )); do
+ if [[ ${line:j:1} == "/" ]]; then
+ ((count++))
+ fi
+ done
+ if [ $count -eq $i ]; then
+ printf '%s\n' "$line" >> $folder/snapshot-$timestamp.txt
+ fi
+ done < $folder/snapshot-temp.txt
+done
+rm $folder/snapshot-temp.txt
+
+if [ -d "/hdd" ]; then
+ du --max-depth=7 -m -x /hdd > $folder/snapshot-temp.txt
+ for i in {1..8}; do
+ while IFS= read -r line; do
+ count=0
+ for (( j=0; j<${#line}; j++ )); do
+ if [[ ${line:j:1} == "/" ]]; then
+ ((count++))
+ fi
+ done
+ if [ $count -eq $i ]; then
+ printf '%s\n' "$line" >> $folder/snapshot-$timestamp.txt
+ fi
+ done < $folder/snapshot-temp.txt
+ done
+ rm $folder/snapshot-temp.txt
+fi
+
+du --max-depth=1 -m -x /var/lib/mysql >> $folder/snapshot-$timestamp.txt
+du --max-depth=1 -m -x /var/log >> $folder/snapshot-$timestamp.txt
+
+chmod 600 $folder/snapshot-$timestamp.txt
+chown root:root $folder/snapshot-$timestamp.txt
+
+exit 0
diff --git a/bin/v-edit-domain-php-ini b/bin/v-edit-domain-php-ini
new file mode 100644
index 00000000..9eadfcee
--- /dev/null
+++ b/bin/v-edit-domain-php-ini
@@ -0,0 +1,90 @@
+#!/bin/bash
+# info: Edit php.ini for certain domain
+# options: DOMAIN
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+SILENT_MODE=1
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/domain.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ # echo "User doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ # echo "Domain doesn't exist";
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+fpm_ver=$(/usr/local/vesta/bin/v-get-php-version-of-domain $domain)
+
+if [ -z "$fpm_ver" ]; then
+ echo "PHP version for domain $domain could not be determined."
+ exit 1
+fi
+
+config_file="/etc/php/${fpm_ver}/fpm/pool.d/${domain}.conf"
+
+if command -v mcedit >/dev/null; then
+ mcedit "$config_file"
+else
+ nano "$config_file"
+fi
+
+echo "Restarting PHP-FPM service for PHP version ${fpm_ver}"
+systemctl restart php${fpm_ver}-fpm
+if [ $? -ne 0 ]; then
+ systemctl status php${fpm_ver}-fpm
+ echo "========================="
+ echo ""
+ echo "ERROR: php${fpm_ver}-fpm restart failed - please re-run the command and fix the problem !!!"
+ echo ""
+ exit $E_RESTART;
+else
+ echo "The PHP-FPM service for PHP version ${fpm_ver} has been restarted successfully."
+fi
+echo ""
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit 0;
diff --git a/bin/v-edit-php-ini b/bin/v-edit-php-ini
new file mode 100644
index 00000000..0155e6bb
--- /dev/null
+++ b/bin/v-edit-php-ini
@@ -0,0 +1,70 @@
+#!/bin/bash
+# info: Edit php.ini for a specific PHP version
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Includes
+source $VESTA/func/main.sh
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# List available PHP versions and store them into an array
+mapfile -t php_versions < <(/usr/local/vesta/bin/v-list-php)
+
+echo "Available PHP versions:"
+PS3="Please select the PHP version you want to edit php.ini for: "
+
+select php_version in "${php_versions[@]}"; do
+ if [[ -n $php_version ]]; then
+ break
+ else
+ echo "Invalid choice. Please try again."
+ fi
+done
+
+# Define path to the php.ini file
+php_ini_path="/etc/php/${php_version}/fpm/php.ini"
+
+# Check if php.ini exists for the selected version
+if [[ ! -f "$php_ini_path" ]]; then
+ echo "The php.ini file for the selected PHP version ($php_version) does not exist."
+ exit 1
+fi
+
+# Determine the text editor to use
+if command -v mcedit >/dev/null 2>&1; then
+ editor_cmd="mcedit"
+elif command -v nano >/dev/null 2>&1; then
+ editor_cmd="nano"
+else
+ echo "No supported text editor found. Please install 'mcedit' or 'nano'."
+ exit 1
+fi
+
+# Open php.ini for the chosen PHP version in the selected editor
+echo "Opening $php_ini_path in editor $editor_cmd..."
+$editor_cmd "$php_ini_path"
+
+# Restart the PHP-FPM service for the selected version
+echo "Restarting the PHP-FPM service for PHP version $php_version..."
+systemctl restart php${php_version}-fpm
+if [ $? -ne 0 ]; then
+ systemctl status php${php_version}-fpm
+ echo "========================="
+ echo ""
+ echo "ERROR: php${php_version}-fpm restart failed - please re-run the command and fix the problem !!!"
+ echo ""
+ exit $E_RESTART;
+else
+ echo "The PHP-FPM service for PHP version ${php_version} has been restarted successfully."
+fi
+
+#----------------------------------------------------------#
+# Exit #
+#----------------------------------------------------------#
+
+exit 0;
diff --git a/bin/v-ensure-poold-folders-not-empty b/bin/v-ensure-poold-folders-not-empty
new file mode 100644
index 00000000..cb89765f
--- /dev/null
+++ b/bin/v-ensure-poold-folders-not-empty
@@ -0,0 +1,31 @@
+#!/bin/bash
+# info: ensure that pool.d folders are not empty
+# options:
+#
+# The function ensure that pool.d folders are not empty
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/func/domain.sh
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+ensure_poold_folders_not_empty
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-extract-fs-archive b/bin/v-extract-fs-archive
index ec70baba..1ea608af 100755
--- a/bin/v-extract-fs-archive
+++ b/bin/v-extract-fs-archive
@@ -82,7 +82,7 @@ fi
# Extracting ziped archive
if [ ! -z "$(echo $src_file |grep -i '.zip')" ]; then
sudo -u $user mkdir -p "$dst_dir" >/dev/null 2>&1
- sudo -u $user unzip "$src_file" -d "$dst_dir" >/dev/null 2>&1
+ sudo -u $user unzip -o "$src_file" -d "$dst_dir" >/dev/null 2>&1
rc=$?
fi
diff --git a/bin/v-file-replace-string b/bin/v-file-replace-string
new file mode 100644
index 00000000..271cc50c
--- /dev/null
+++ b/bin/v-file-replace-string
@@ -0,0 +1,17 @@
+#!/usr/bin/php
+> $arg; fi; done' _
+
+if [ -f "/tmp/patched" ]; then
+ rm /tmp/patched
+
+ echo "== Restarting all PHP-FPM services"
+ systemctl --full --type service --all | grep "php...-fpm" | sed 's#●##g' | awk '{print $1}' | xargs systemctl restart
+
+ echo "=== Everything done."
+else
+ echo "=== Everything is already correct."
+fi
+
+exit 0;
diff --git a/bin/v-fix-user-permissions b/bin/v-fix-user-permissions
new file mode 100644
index 00000000..47690477
--- /dev/null
+++ b/bin/v-fix-user-permissions
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# info:
+# This script will fix files permissions for desired user (if ownership is lost or files have wrong chmod)
+
+# options: user
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ] && [ "$whoami" != "admin" ] ; then
+ echo "You must be root or admin to execute this script";
+ exit 1;
+fi
+
+# Argument definition
+user=$1
+
+# Includes
+source $VESTA/func/main.sh
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'USER'
+is_format_valid 'user'
+is_object_valid 'user' 'USER' "$user"
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+find /home/$user/conf/mail/ -type d -exec chown Debian-exim:mail {} \;
+find /home/$user/conf/mail/*/ -type f -exec chown Debian-exim:mail {} \;
+find /home/$user/conf/mail/*/ -name "passwd" -type f -exec chown dovecot:mail {} \;
+
+find /home/$user/mail/ -type d -exec chown $user:mail {} \;
+find /home/$user/mail/*/ -type d -exec chown $user:mail {} \;
+find /home/$user/mail/*/ -type f -exec chown $user:mail {} \;
+find /home/$user/mail/*/ -type d -exec chmod u+rwx {} \;
+find /home/$user/mail/*/ -type d -exec chmod g+rwx {} \;
+find /home/$user/mail/*/ -type f -exec chmod u+rw {} \;
+find /home/$user/mail/*/ -type f -exec chmod g+rw {} \;
+find /home/$user/mail/*/ -maxdepth 1 -type d -exec chmod g-rwx {} \;
+
+find /home/$user/conf/dns/ -type f -exec chown root:bind {} \;
+find /home/$user/conf/ -type d -exec chown root:root {} \;
+
+for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
+ /usr/local/vesta/bin/v-fix-website-permissions $domain $user
+ echo "--------------------------------"
+done
+
+echo "Done, permissions fixed for user: $user"
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-fix-website-permissions b/bin/v-fix-website-permissions
new file mode 100644
index 00000000..50b143c8
--- /dev/null
+++ b/bin/v-fix-website-permissions
@@ -0,0 +1,161 @@
+#!/bin/bash
+# info: Fixing chown and chmod permissions for a website
+# options: DOMAIN [USER]
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Argument definition
+domain=$1
+
+# Check if number of arguments is 2
+if [ $# -eq 2 ]; then
+ user=$2
+else
+ user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+fi
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/conf/vesta.conf
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ echo "Error: Folder /home/$user doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "Error: Folder /home/$user/web/$domain/public_html doesn't exist";
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Going to domain directory
+cd /home/$USER/web/$domain
+
+# Ownership check
+if [ -z "$SKIP_OWNERSHIP_CHECK" ] && [ -f "public_html/index.php" ]; then
+ owner=$(stat -c '%U' "public_html/index.php")
+ if [ "$owner" = "root" ] || [ "$owner" = "www-data" ]; then
+ echo "Skipping permission fix for $domain, because v-lock-wordpress is used (index.php is owned by $owner)"
+ exit 1
+ fi
+fi
+
+echo "Updating permissions and ownership for /home/$USER/web/$domain/"
+
+php_chmod_allowed=1
+if [ -f "/home/php_chmod_disabled" ]; then
+ php_chmod_allowed=0
+fi
+if [ -f "/home/$USER/php_chmod_disabled" ]; then
+ php_chmod_allowed=0
+fi
+if [ -f "/home/$USER/web/php_chmod_disabled" ]; then
+ php_chmod_allowed=0
+fi
+if [ -f "/home/$USER/web/$domain/php_chmod_disabled" ]; then
+ php_chmod_allowed=0
+fi
+
+# === General files and directories permissions ===
+if [ "$php_chmod_allowed" -eq 1 ]; then
+ # New way of fixing permissions
+ # Fixing permissions
+ find public_html/ -type d ! -perm 755 -exec chmod 755 {} +
+ find public_html/ -type f ! \( -name "*.php" -o -name "*.env" \) ! -perm 644 -exec chmod 644 {} +
+
+ # Fixing ownership
+ find public_html/ -type d ! -user $USER -exec chown $USER:$USER {} +
+ find public_html/ -type f ! \( -name "*.php" -o -name "*.env" \) ! -user $USER -exec chown $USER:$USER {} +
+else
+ # Old way of fixing permissions
+ # Fixing permissions
+ find public_html/ -type d ! -perm 755 -exec chmod 755 {} +
+ find public_html/ -type f ! -perm 644 -exec chmod 644 {} +
+
+ # Fixing ownership
+ find public_html/ -type d ! -user $USER -exec chown $USER:$USER {} +
+ find public_html/ -type f ! -user $USER -exec chown $USER:$USER {} +
+fi
+
+# === PHP and .env permissions ===
+if [ "$php_chmod_allowed" -eq 1 ]; then
+ php_chmod="600"
+
+ if [ "$WEB_SYSTEM" = 'nginx' ]; then
+ php_chmod="644"
+ fi
+
+ if [ -f "/home/php_chmod" ]; then
+ php_chmod=$(cat /home/php_chmod)
+ fi
+ if [ -f "/home/$USER/php_chmod" ]; then
+ php_chmod=$(cat /home/$USER/php_chmod)
+ fi
+ if [ -f "/home/$USER/web/php_chmod" ]; then
+ php_chmod=$(cat /home/$USER/web/php_chmod)
+ fi
+ if [ -f "/home/$USER/web/$domain/php_chmod" ]; then
+ php_chmod=$(cat /home/$USER/web/$domain/php_chmod)
+ fi
+
+ # Setting chmod 600 for all .php and .env files
+ echo "= Setting chmod $php_chmod for all .php and .env files"
+ # Fixing permissions
+ find -type f \( -name "*.php" -o -name "*.env" \) ! -perm $php_chmod -exec chmod $php_chmod {} +
+ # Fixing ownership
+ find -type f \( -name "*.php" -o -name "*.env" \) ! -user $USER -exec chown $USER:$USER {} +
+fi
+
+# === Symlinks ownership ===
+symlink_chown_allowed=1
+if [ -f "/home/symlink_chown_disabled" ]; then
+ symlink_chown_allowed=0
+fi
+if [ -f "/home/$USER/symlink_chown_disabled" ]; then
+ symlink_chown_allowed=0
+fi
+if [ -f "/home/$USER/web/symlink_chown_disabled" ]; then
+ symlink_chown_allowed=0
+fi
+if [ -f "/home/$USER/web/$domain/symlink_chown_disabled" ]; then
+ symlink_chown_allowed=0
+fi
+
+if [ "$symlink_chown_allowed" -eq 1 ]; then
+ find -type l ! -user $USER -exec chown -h $USER:$USER {} +
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+echo "Permissions for $domain have been successfully updated."
+
+exit 0
diff --git a/bin/v-fix-website-permissions-for-all-websites b/bin/v-fix-website-permissions-for-all-websites
new file mode 100644
index 00000000..9b1501bd
--- /dev/null
+++ b/bin/v-fix-website-permissions-for-all-websites
@@ -0,0 +1,41 @@
+#!/bin/bash
+# info: fix website permissions for all websites
+# options:
+#
+# The command is used for fixing website permissions for all websites on the server.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Importing system variables
+source /etc/profile
+
+# Includes
+source $VESTA/func/main.sh
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
+ if [ ! -f "/usr/local/vesta/data/users/$user/user.conf" ]; then
+ continue;
+ fi
+
+ for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
+ /usr/local/vesta/bin/v-fix-website-permissions $domain $user
+ echo "--------------------------------"
+ done
+
+done
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-fix-website-permissions-for-all-websites-only-php b/bin/v-fix-website-permissions-for-all-websites-only-php
new file mode 100644
index 00000000..a89d2416
--- /dev/null
+++ b/bin/v-fix-website-permissions-for-all-websites-only-php
@@ -0,0 +1,44 @@
+#!/bin/bash
+# info: fix website permissions for all websites
+# options:
+#
+# The command is used for fixing website permissions for all websites on the server.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Importing system variables
+source /etc/profile
+
+# Includes
+source $VESTA/func/main.sh
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+touch /usr/local/vesta/log/fix-website-permissions-for-all-websites-only-php.log
+truncate -s 0 /usr/local/vesta/log/fix-website-permissions-for-all-websites-only-php.log
+
+for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
+ if [ ! -f "/usr/local/vesta/data/users/$user/user.conf" ]; then
+ continue;
+ fi
+
+ for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
+ /usr/local/vesta/bin/v-fix-website-permissions-only-php $domain $user >> /usr/local/vesta/log/fix-website-permissions-for-all-websites-only-php.log 2>&1
+ echo "--------------------------------" >> /usr/local/vesta/log/fix-website-permissions-for-all-websites-only-php.log
+ done
+
+done
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-fix-website-permissions-only-php b/bin/v-fix-website-permissions-only-php
new file mode 100644
index 00000000..cf548e6b
--- /dev/null
+++ b/bin/v-fix-website-permissions-only-php
@@ -0,0 +1,121 @@
+#!/bin/bash
+# info: Fixing PHP and .env permissions and ownership for a website
+# options: DOMAIN [USER]
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Argument definition
+domain=$1
+
+# Check if number of arguments is 2
+if [ $# -eq 2 ]; then
+ user=$2
+else
+ user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+fi
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/conf/vesta.conf
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ echo "Error: Folder /home/$user doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "Error: Folder /home/$user/web/$domain/public_html doesn't exist";
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Going to domain directory
+cd /home/$USER/web/$domain
+
+# Ownership check
+if [ -z "$SKIP_OWNERSHIP_CHECK" ] && [ -f "public_html/index.php" ]; then
+ owner=$(stat -c '%U' "public_html/index.php")
+ if [ "$owner" = "root" ] || [ "$owner" = "www-data" ]; then
+ echo "Skipping permission fix for $domain, because v-lock-wordpress is used (index.php is owned by $owner)"
+ exit 1
+ fi
+fi
+
+echo "Updating PHP and .env permissions and ownership for /home/$USER/web/$domain/"
+
+php_chmod_allowed=1
+if [ -f "/home/php_chmod_disabled" ]; then
+ php_chmod_allowed=0
+fi
+if [ -f "/home/$USER/php_chmod_disabled" ]; then
+ php_chmod_allowed=0
+fi
+if [ -f "/home/$USER/web/php_chmod_disabled" ]; then
+ php_chmod_allowed=0
+fi
+if [ -f "/home/$USER/web/$domain/php_chmod_disabled" ]; then
+ php_chmod_allowed=0
+fi
+
+# === PHP and .env permissions ===
+if [ "$php_chmod_allowed" -eq 1 ]; then
+ php_chmod="600"
+
+ if [ "$WEB_SYSTEM" = 'nginx' ]; then
+ php_chmod="644"
+ fi
+
+ if [ -f "/home/php_chmod" ]; then
+ php_chmod=$(cat /home/php_chmod)
+ fi
+ if [ -f "/home/$USER/php_chmod" ]; then
+ php_chmod=$(cat /home/$USER/php_chmod)
+ fi
+ if [ -f "/home/$USER/web/php_chmod" ]; then
+ php_chmod=$(cat /home/$USER/web/php_chmod)
+ fi
+ if [ -f "/home/$USER/web/$domain/php_chmod" ]; then
+ php_chmod=$(cat /home/$USER/web/$domain/php_chmod)
+ fi
+
+ # Setting chmod 600 for all .php and .env files
+ echo "= Setting chmod $php_chmod for all .php and .env files"
+ # Fixing permissions
+ find -type f \( -name "*.php" -o -name "*.env" \) ! -perm $php_chmod -exec chmod $php_chmod {} +
+ # Fixing ownership
+ find -type f \( -name "*.php" -o -name "*.env" \) ! -user $USER -exec chown $USER:$USER {} +
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+echo "PHP and .env permissions and ownership for $domain have been successfully updated."
+
+exit 0
diff --git a/bin/v-fix-wordpress-core b/bin/v-fix-wordpress-core
new file mode 100644
index 00000000..2bcd6c34
--- /dev/null
+++ b/bin/v-fix-wordpress-core
@@ -0,0 +1,115 @@
+#!/bin/bash
+# info: fix compromised wp-admin and wp-includes
+# options: DOMAIN [CACHE_DIR]
+#
+# Replaces wp-admin and wp-includes with clean copies that match
+# the WordPress core version detected on the site.
+#
+# Example:
+# v-fix-wp-core example.com
+# v-fix-wp-core example.com /srv/wp-cache
+
+#----------------------------------------------------------#
+# Variable & Function #
+#----------------------------------------------------------#
+
+# Arguments
+DOMAIN="$1"
+CACHE_DIR="${2-/srv/wp-cache}" # default cache location
+
+QUARANTINE_DIR="/srv/wp-quarantine"
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+check_args '1' "$#" 'DOMAIN [CACHE_DIR]'
+is_format_valid 'domain'
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+TMP_DIR="$(mktemp -d /tmp/wpfix.XXXXXX)" # temp workspace
+trap 'rm -rf "$TMP_DIR"' EXIT
+
+# 1etermine WP version
+if [ -z "$PHP" ]; then
+ WP_VERSION="$(/usr/local/vesta/bin/v-run-wp-cli "$DOMAIN" core version | tr -d '[:space:]')"
+else
+ WP_VERSION="$(PHP=$PHP /usr/local/vesta/bin/v-run-wp-cli "$DOMAIN" core version | tr -d '[:space:]')"
+fi
+
+check_result $? "cannot detect WP version" > /dev/null
+if [ -z "$WP_VERSION" ]; then
+ check_result 1 "empty WP version string"
+fi
+echo "Detected WordPress version $WP_VERSION"
+
+# 2ind site owner and path
+USER="$(/usr/local/vesta/bin/v-search-domain-owner "$DOMAIN")"
+check_result $? "cannot find domain owner" > /dev/null
+SITE_PATH="/home/$USER/web/$DOMAIN/public_html"
+if [ ! -d "$SITE_PATH" ]; then
+ check_result 1 "site path $SITE_PATH does not exist"
+fi
+
+# ensure cached core is present
+CACHE_PATH="$CACHE_DIR/$WP_VERSION"
+if [ ! -d "$CACHE_PATH/wp-admin" ] || [ ! -d "$CACHE_PATH/wp-includes" ]; then
+ echo "Cache for $WP_VERSION missing, downloading ZIP..."
+
+ mkdir -p "$CACHE_PATH"
+ ZIP_URL="https://wordpress.org/wordpress-${WP_VERSION}.zip"
+ ZIP_FILE="$TMP_DIR/wp.zip"
+
+ curl -fSL "$ZIP_URL" -o "$ZIP_FILE"
+ check_result $? "download failed" > /dev/null
+
+ unzip -q "$ZIP_FILE" -d "$TMP_DIR"
+ check_result $? "unzip failed" > /dev/null
+
+ mv "$TMP_DIR/wordpress/wp-admin" "$CACHE_PATH/"
+ mv "$TMP_DIR/wordpress/wp-includes" "$CACHE_PATH/"
+ cp "$TMP_DIR/wordpress"/*.php "$CACHE_PATH/"
+fi
+
+# backup current core folders
+TIMESTAMP="$(date +%Y%m%d%H%M%S)"
+BACKUP_DIR="$QUARANTINE_DIR/$DOMAIN/backup-core-$TIMESTAMP"
+mkdir -p "$BACKUP_DIR"
+mv "$SITE_PATH/wp-admin" "$BACKUP_DIR/"
+mv "$SITE_PATH/wp-includes" "$BACKUP_DIR/"
+
+for f in "$SITE_PATH"/*.php; do
+ [[ $(basename "$f") == "wp-config.php" ]] && continue
+ mv "$f" "$BACKUP_DIR/"
+done
+if [ -f "$SITE_PATH/.user.ini" ]; then
+ mv "$SITE_PATH/.user.ini" "$BACKUP_DIR/"
+fi
+
+# chown -R www-data:www-data "$BACKUP_DIR"
+check_result $? "backup failed" > /dev/null
+echo "Old core folders moved to $BACKUP_DIR"
+
+# deploy clean core
+rsync -a --delete "$CACHE_PATH/wp-admin/" "$SITE_PATH/wp-admin/"
+rsync -a --delete "$CACHE_PATH/wp-includes/" "$SITE_PATH/wp-includes/"
+check_result $? "rsync failed" > /dev/null
+
+for corephp in "$CACHE_PATH"/*.php; do
+ base=$(basename "$corephp")
+ [ "$base" = "wp-config.php" ] && continue
+ rsync -a "$corephp" "$SITE_PATH/$base"
+done
+
+# fix permissions
+SKIP_OWNERSHIP_CHECK=1 /usr/local/vesta/bin/v-fix-website-permissions $DOMAIN
+# chown -R www-data:www-data "$BACKUP_DIR"
+
+echo "Done, core WP files, wp-admin and wp-includes replaced for $DOMAIN"
+exit
diff --git a/bin/v-generate-api-key b/bin/v-generate-api-key
index ba60b92f..c6221cc6 100755
--- a/bin/v-generate-api-key
+++ b/bin/v-generate-api-key
@@ -23,6 +23,7 @@ HASH=$(keygen)
if [ ! -d ${KEYS} ]; then
mkdir ${KEYS}
+ chmod 0770 ${KEYS}
fi
if [[ -e ${KEYS}${HASH} ]] ; then
diff --git a/bin/v-generate-ssl-cert b/bin/v-generate-ssl-cert
index 9f75f9d8..394c6625 100755
--- a/bin/v-generate-ssl-cert
+++ b/bin/v-generate-ssl-cert
@@ -67,7 +67,7 @@ fi
args_usage='DOMAIN EMAIL COUNTRY STATE CITY ORG UNIT [ALIASES] [FORMAT]'
check_args '7' "$#" "$args_usage"
-is_format_valid 'domain_alias' 'format'
+is_format_valid 'domain' 'alias' 'format'
#----------------------------------------------------------#
diff --git a/bin/v-get-database-credentials-of-domain b/bin/v-get-database-credentials-of-domain
new file mode 100644
index 00000000..cb5729b0
--- /dev/null
+++ b/bin/v-get-database-credentials-of-domain
@@ -0,0 +1,181 @@
+#!/bin/bash
+
+# info: get database credentials and other basic data of domain
+# options: DOMAIN [SUBFOLDER]
+#
+# The function get database credentials and other basic data of domain.
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Argument definition
+DOMAIN=$1
+SUBFOLDER=''
+if [ $# -gt 1 ]; then
+ SUBFOLDER=$2
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/db.sh
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN [SUBFOLDER]'
+is_domain_format_valid "$DOMAIN"
+
+USER=$(/usr/local/vesta/bin/v-search-domain-owner "$DOMAIN")
+if [ -z "$USER" ]; then
+ echo "Error: domain $DOMAIN does not exists"
+ exit 2
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+PUBLIC_HTML='public_html';
+CHECK_PUBLIC_SHTML=$(/usr/local/vesta/bin/v-list-web-domain "$USER" "$DOMAIN" | grep 'SSL:' | grep -c 'single')
+if [ $CHECK_PUBLIC_SHTML -eq 1 ]; then
+ PUBLIC_HTML='public_shtml';
+fi
+SITE_FOLDER="/home/$USER/web/$DOMAIN/$PUBLIC_HTML"
+
+if [ ! -z "$SUBFOLDER" ]; then
+ SITE_FOLDER="${SITE_FOLDER}/${SUBFOLDER}"
+fi
+
+CMS_TYPE=''
+
+if [ -f "$SITE_FOLDER/wp-config.php" ]; then
+ CMS_TYPE='wordpress'
+ CONFIG_FILE="wp-config.php"
+ CONFIG_FILE_FULL_PATH="$SITE_FOLDER/$CONFIG_FILE"
+fi
+if [ -f "$SITE_FOLDER/configuration.php" ]; then
+ CMS_TYPE='joomla'
+ CONFIG_FILE="configuration.php"
+ CONFIG_FILE_FULL_PATH="$SITE_FOLDER/$CONFIG_FILE"
+fi
+if [ -f "$SITE_FOLDER/system/engine/model.php" ]; then
+ check_grep=$(grep -c 'OpenCart' $SITE_FOLDER/system/engine/model.php)
+ if [ "$check_grep" -gt 0 ]; then
+ CMS_TYPE='opencart'
+ CONFIG_FILE="$PUBLIC_HTML/config.php"
+ SUBFOLDER='..'
+ SITE_FOLDER="${SITE_FOLDER}/.."
+ CONFIG_FILE_FULL_PATH="$SITE_FOLDER/$CONFIG_FILE"
+ fi
+fi
+
+if [ "$CMS_TYPE" = "wordpress" ]; then
+ CONFIG_FILE_FULL_PATH_BACKUP="${CONFIG_FILE_FULL_PATH}_backup"
+ cp $CONFIG_FILE_FULL_PATH $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|//.*$||g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|\"|'|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|('|( '|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|');|' );|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ DATABASE_NAME=$(grep 'DB_NAME' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $3}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_USERNAME=$(grep 'DB_USER' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $3}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_PASSWORD=$(grep 'DB_PASSWORD' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $3}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_HOSTNAME=$(grep 'DB_HOST' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $3}' | sed -e "s/^'//" -e "s/'$//")
+ rm $CONFIG_FILE_FULL_PATH_BACKUP
+fi
+
+if [ "$CMS_TYPE" = "joomla" ]; then
+ CONFIG_FILE_FULL_PATH_BACKUP="${CONFIG_FILE_FULL_PATH}_backup"
+ cp $CONFIG_FILE_FULL_PATH $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|//.*$||g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|='|= '|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|= '| = '|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s| =| =|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|';$|'|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ DATABASE_NAME=$(grep 'public $db ' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $4}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_USERNAME=$(grep 'public $user ' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $4}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_PASSWORD=$(grep 'public $password ' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $4}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_HOSTNAME=$(grep 'public $host ' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $4}' | sed -e "s/^'//" -e "s/'$//")
+ rm $CONFIG_FILE_FULL_PATH_BACKUP
+fi
+
+if [ "$CMS_TYPE" = "opencart" ]; then
+ CONFIG_FILE_FULL_PATH_BACKUP="${CONFIG_FILE_FULL_PATH}_backup"
+ cp $CONFIG_FILE_FULL_PATH $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|//.*$||g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|('|( '|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ sed -i "s|');|' );|g" $CONFIG_FILE_FULL_PATH_BACKUP
+ DATABASE_NAME=$(grep 'DB_DATABASE' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $3}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_USERNAME=$(grep 'DB_USERNAME' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $3}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_PASSWORD=$(grep 'DB_PASSWORD' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $3}' | sed -e "s/^'//" -e "s/'$//")
+ DATABASE_HOSTNAME=$(grep 'DB_HOST' $CONFIG_FILE_FULL_PATH_BACKUP | awk '{print $3}' | sed -e "s/^'//" -e "s/'$//")
+ rm $CONFIG_FILE_FULL_PATH_BACKUP
+fi
+
+
+if [ ! -z "$DATABASE_NAME" ]; then
+ DATABASE_NAME_WITHOUT_USER_PREFIX=$(get_database_name_without_user_prefix "$USER" "$DATABASE_NAME")
+fi
+if [ ! -z "$DATABASE_USERNAME" ]; then
+ DATABASE_USERNAME_WITHOUT_USER_PREFIX=$(get_database_name_without_user_prefix "$USER" "$DATABASE_USERNAME")
+fi
+
+DATABASE_NAME_WITHOUT_USER_PREFIX=$(escape_shell_quote $DATABASE_NAME_WITHOUT_USER_PREFIX)
+echo "DATABASE_NAME_WITHOUT_USER_PREFIX=$DATABASE_NAME_WITHOUT_USER_PREFIX"
+
+DATABASE_USERNAME_WITHOUT_USER_PREFIX=$(escape_shell_quote $DATABASE_USERNAME_WITHOUT_USER_PREFIX)
+echo "DATABASE_USERNAME_WITHOUT_USER_PREFIX=$DATABASE_USERNAME_WITHOUT_USER_PREFIX"
+
+DATABASE_NAME=$(escape_shell_quote $DATABASE_NAME)
+echo "DATABASE_NAME=$DATABASE_NAME"
+
+DATABASE_USERNAME=$(escape_shell_quote $DATABASE_USERNAME)
+echo "DATABASE_USERNAME=$DATABASE_USERNAME"
+
+DATABASE_PASSWORD=$(escape_shell_quote $DATABASE_PASSWORD)
+echo "DATABASE_PASSWORD=$DATABASE_PASSWORD"
+
+DATABASE_HOSTNAME=$(escape_shell_quote $DATABASE_HOSTNAME)
+echo "DATABASE_HOSTNAME=$DATABASE_HOSTNAME"
+
+CONFIG_FILE_FULL_PATH=$(escape_shell_quote $CONFIG_FILE_FULL_PATH)
+echo "CONFIG_FILE_FULL_PATH=$CONFIG_FILE_FULL_PATH"
+
+CONFIG_FILE=$(escape_shell_quote $CONFIG_FILE)
+echo "CONFIG_FILE=$CONFIG_FILE"
+
+CMS_TYPE=$(escape_shell_quote $CMS_TYPE)
+echo "CMS_TYPE=$CMS_TYPE"
+
+SITE_FOLDER=$(escape_shell_quote $SITE_FOLDER)
+echo "SITE_FOLDER=$SITE_FOLDER"
+
+SUBFOLDER=$(escape_shell_quote $SUBFOLDER)
+echo "SITE_SUBFOLDER=$SUBFOLDER"
+
+USER=$(escape_shell_quote $USER)
+echo "SITE_USER=$USER"
+
+if [ "$CMS_TYPE" = "'opencart'" ]; then
+ echo "SEARCH_FOR_CONFIGS_DATABASE_NAME=1"
+ echo "SEARCH_FOR_CONFIGS_DATABASE_USERNAME=1"
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-get-dns-config b/bin/v-get-dns-config
new file mode 100644
index 00000000..d759c489
--- /dev/null
+++ b/bin/v-get-dns-config
@@ -0,0 +1,70 @@
+#!/bin/bash
+# info: Get domain DNS config.db file content
+# options: DOMAIN
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+SILENT_MODE=1
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/domain.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ # echo "User doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ # echo "Domain doesn't exist";
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+DNS_FILE="/home/$user/conf/dns/$domain.db"
+
+if [ -f "$DNS_FILE" ]; then
+ cat "$DNS_FILE"
+else
+ echo "DNS configuration file for $domain does not exist."
+ exit 1
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit 0;
diff --git a/bin/v-get-php-version-of-domain b/bin/v-get-php-version-of-domain
new file mode 100644
index 00000000..c87b4e4c
--- /dev/null
+++ b/bin/v-get-php-version-of-domain
@@ -0,0 +1,72 @@
+#!/bin/bash
+# info: Check PHP version used for certain domain
+# options: DOMAIN
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+SILENT_MODE=1
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/domain.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ # echo "User doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ # echo "Domain doesn't exist";
+ exit 1;
+fi
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+
+TPL=$(/usr/local/vesta/bin/v-list-web-domain $user $domain shell | grep 'TEMPLATE:' | awk '{print $2}')
+if [[ $TPL == "PHP-FPM-"* ]]; then
+ fpm_tpl_ver=${TPL:8:2}
+ fpm_ver="${TPL:8:1}.${TPL:9:1}"
+ echo "$fpm_ver"
+ exit 0;
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit 1;
diff --git a/bin/v-get-user-salt b/bin/v-get-user-salt
index 08ee5a9c..b99a684a 100755
--- a/bin/v-get-user-salt
+++ b/bin/v-get-user-salt
@@ -61,7 +61,7 @@ check_args '1' "$#" 'USER [IP] [SALT]'
is_format_valid 'user'
# Checking user
-if [ ! -d "$VESTA/data/users/$user" ] && [ "$user" != 'root' ]; then
+if [ ! -d "$VESTA/data/users/$user" ]; then
echo "Error: password missmatch"
echo "$date $time $user $ip failed to login" >> $VESTA/log/auth.log
exit 9
diff --git a/bin/v-grep b/bin/v-grep
new file mode 100644
index 00000000..9ea821e5
--- /dev/null
+++ b/bin/v-grep
@@ -0,0 +1,27 @@
+#!/bin/bash
+# info: calling myvesta_grep PHP function
+# options: PARAMETERS
+#
+# The function is calling myVesta PHP replacement for GNU 'grep' command (but without regular expression)
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+
+if [ "$1" == "--stdin" ] && [ -p /dev/stdin ]; then
+ STDIN=$(cat -)
+ if [ ! -z "$STDIN" ]; then
+ shift;
+ echo "$STDIN" | php /usr/local/vesta/func/bash-to-php-interpreter.php '--stdin' 'myvesta_grep' "$@"
+ exit $?
+ fi
+fi
+
+if [ "$1" == "--stdin" ]; then
+ shift;
+ php /usr/local/vesta/func/bash-to-php-interpreter.php '--stdin' 'myvesta_grep' "$@"
+else
+ php /usr/local/vesta/func/bash-to-php-interpreter.php 'myvesta_grep' "$@"
+fi
+exit $?
diff --git a/src/deb/for-download/tools/cpanel-import.sh b/bin/v-import-cpanel-backup
similarity index 81%
rename from src/deb/for-download/tools/cpanel-import.sh
rename to bin/v-import-cpanel-backup
index fc3c7352..43e8c3bf 100644
--- a/src/deb/for-download/tools/cpanel-import.sh
+++ b/bin/v-import-cpanel-backup
@@ -7,7 +7,6 @@
# This script can import databases and database users and password,
# Import domains, subdomains and website files
# This script import also mail accounts and mails into accounts if previous cpanel run dovecot
-# Mail password not are restored this was reset by new one.
###########
# If you need restore main database user read line 160 or above
###########
@@ -156,8 +155,17 @@ for sk_dbr in $sk_db_list
grep -w $sk_dbr server_dbs
if [ $? == "1" ]; then
echo " Create and restore ${sk_dbr} "
+ sed -i "s/utf8mb4_unicode_520_ci/utf8mb4_unicode_ci/g" mysql/${sk_dbr}.create
+ sed -i "s/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g" mysql/${sk_dbr}.create
+ if grep -q ' enable the sandbox mode ' mysql/${sk_dbr}.create; then
+ v-sed '/*!999999\- enable the sandbox mode */' '' mysql/${sk_dbr}.create
+ fi
mysql < mysql/${sk_dbr}.create
sed -i "s/utf8mb4_unicode_520_ci/utf8mb4_unicode_ci/g" mysql/${sk_dbr}.sql
+ sed -i "s/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g" mysql/${sk_dbr}.sql
+ if grep -q ' enable the sandbox mode ' mysql/${sk_dbr}.sql; then
+ v-sed '/*!999999\- enable the sandbox mode */' '' mysql/${sk_dbr}.sql
+ fi
mysql ${sk_dbr} < mysql/${sk_dbr}.sql
else
echo "Error: Cant restore database $sk_dbr alredy exists in mysql server"
@@ -253,6 +261,11 @@ rm -f sk_sds2 sk_sds
##################
# mail
+
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
tput setaf 2
echo "Start Restoring Mails"
tput sgr0
@@ -262,19 +275,29 @@ cd $sk_mdir
for sk_maild in $(ls -1)
do
if [[ "$sk_maild" != "cur" && "$sk_maild" != "new" && "$sk_maild" != "tmp" ]]; then
- if [ -d "$sk_maild" ]; then
- for sk_mail_account in $(ls $sk_maild/)
- do
-
- echo "Create and restore mail account: $sk_mail_account@$sk_maild"
- sk_mail_pass1=$(generate_password)
- /usr/local/vesta/bin/v-add-mail-account $sk_cp_user $sk_maild $sk_mail_account $sk_mail_pass1
- mv ${sk_maild}/${sk_mail_account} /home/${sk_cp_user}/mail/${sk_maild}
- chown ${sk_cp_user}:mail -R /home/${sk_cp_user}/mail/${sk_maild}
- find /home/${sk_cp_user}/mail/${sk_maild} -type f -name 'dovecot*' -delete
- echo "${sk_mail_account}@${sk_maild} | $sk_mail_pass1" >> /root/sk_mail_password_${sk_cp_user}-${sk_cod}
- done
- fi
+ if [ -d "$sk_maild" ]; then
+ for sk_mail_account in $(ls $sk_maild/)
+ do
+ echo "Create and restore mail account: $sk_mail_account@$sk_maild"
+ sk_mail_pass1=$(generate_password)
+ /usr/local/vesta/bin/v-add-mail-account $sk_cp_user $sk_maild $sk_mail_account $sk_mail_pass1
+ mv ${sk_maild}/${sk_mail_account} /home/${sk_cp_user}/mail/${sk_maild}
+ chown ${sk_cp_user}:mail -R /home/${sk_cp_user}/mail/${sk_maild}
+ find /home/${sk_cp_user}/mail/${sk_maild} -type f -name 'dovecot*' -delete
+ if [ -f "${sk_importer_in}/homedir/etc/${sk_maild}/shadow" ]; then
+ echo "Set password for ${sk_mail_account}@${sk_maild}"
+ pass=$(grep "^${sk_mail_account}:" ${sk_importer_in}/homedir/etc/${sk_maild}/shadow | awk -F ":" '{print $2}')
+ newline="${sk_mail_account}:{SHA512-CRYPT}$pass:${sk_cp_user}:mail::/home/${sk_cp_user}:0"
+ newline2="ACCOUNT='${sk_mail_account}' ALIAS='' AUTOREPLY='no' FWD='' FWD_ONLY='' MD5='{SHA512-CRYPT}$pass' QUOTA='unlimited' U_DISK='0' SUSPENDED='no' TIME='$time' DATE='$date'"
+ escaped=$(printf '%s\n' "$newline" | sed -e 's/[\/&]/\\&/g')
+ escaped2=$(printf '%s\n' "$newline2" | sed -e 's/[\/&]/\\&/g')
+ sed -i "s/^${sk_mail_account}:.*/$escaped/g" /home/${sk_cp_user}/conf/mail/${sk_maild}/passwd
+ sed -i "s/^ACCOUNT='${sk_mail_account}.*/$escaped2/g" /usr/local/vesta/data/users/${sk_cp_user}/mail/${sk_maild}.conf
+ else
+ echo "${sk_mail_account}@${sk_maild} | $sk_mail_pass1" >> /root/sk_mail_password_${sk_cp_user}-${sk_cod}
+ fi
+ done
+ fi
#else
# this only detect default dirs account new, cur, tmp etc
# maybe can do something with this, but on most cpanel default account have only spam.
@@ -351,7 +374,9 @@ tput setaf 4
echo "##############################"
echo "cPanel Backup restored"
echo "Review your content and report any fail"
-echo "I reset mail password not posible restore it yet."
-echo "Check your new passwords runing: cat /root/sk_mail_password_${sk_cp_user}-${sk_cod}"
+if [ -f "/root/sk_mail_password_${sk_cp_user}-${sk_cod}" ]; then
+ echo "I reset mail password not posible restore it yet."
+ echo "Check your new passwords runing: cat /root/sk_mail_password_${sk_cp_user}-${sk_cod}"
+fi
echo "##############################"
tput sgr0
diff --git a/bin/v-insert-dns-domain b/bin/v-insert-dns-domain
index b767b576..9e6874df 100755
--- a/bin/v-insert-dns-domain
+++ b/bin/v-insert-dns-domain
@@ -50,7 +50,7 @@ if [ "$flush" = 'records' ]; then
fi
# Flush domain
-if [ "$flush" ! = 'no' ]; then
+if [ "$flush" != 'no' ]; then
sed -i "/DOMAIN='$DOMAIN'/d" $USER_DATA/dns.conf 2> /dev/null
fi
diff --git a/bin/v-install-unsigned-ssl b/bin/v-install-unsigned-ssl
new file mode 100644
index 00000000..9ac2f188
--- /dev/null
+++ b/bin/v-install-unsigned-ssl
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+# info: install unsigned SSL to domain
+# options: DOMAIN [RESTART]
+#
+# The function install unsigned SSL to domain
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Argument definition
+if [ $# -lt 1 ]; then
+ echo "usage: v-install-unsigned-ssl DOMAIN [RESTART]"
+ exit 1
+fi
+
+domain=$1
+
+if [ $# -lt 2 ]; then
+ restart='yes'
+else
+ restart=$2
+fi
+
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/domain.sh
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+
+if [ ! -d "/home/$user" ]; then
+ echo "User doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "Domain doesn't exist";
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+if [ -f "/home/$user/conf/web/ssl.$domain.crt" ]; then
+ /usr/local/vesta/bin/v-delete-web-domain-ssl "$user" "$domain"
+fi
+
+release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+
+email="info@$domain"
+
+TMPLOC="/home/$user/tmp/$domain"
+mkdir $TMPLOC
+
+# Generating SSL certificate
+/usr/local/vesta/bin/v-generate-ssl-cert $domain $email 'US' 'California' 'San Francisco' 'myVesta Control Panel' 'IT' "www.$domain" > $TMPLOC/vst.pem
+
+# Parsing certificate file
+crt_end=$(grep -n "END CERTIFICATE-" $TMPLOC/vst.pem |cut -f 1 -d:)
+if [ "$release" -lt 12 ]; then
+ key_start=$(grep -n "BEGIN RSA" $TMPLOC/vst.pem |cut -f 1 -d:)
+ key_end=$(grep -n "END RSA" $TMPLOC/vst.pem |cut -f 1 -d:)
+else
+ key_start=$(grep -n "BEGIN PRIVATE KEY" $TMPLOC/vst.pem |cut -f 1 -d:)
+ key_end=$(grep -n "END PRIVATE KEY" $TMPLOC/vst.pem |cut -f 1 -d:)
+fi
+
+# Adding SSL certificate
+cd $TMPLOC
+sed -n "1,${crt_end}p" $TMPLOC/vst.pem > $TMPLOC/$domain.crt
+sed -n "$key_start,${key_end}p" $TMPLOC/vst.pem > $TMPLOC/$domain.key
+chmod 666 $TMPLOC/*
+
+USER_DATA="/usr/local/vesta/data/users/$user";
+get_domain_values 'web'
+
+if [[ $SSL == 'no' ]]
+then
+ #Configure SSL and install the cert
+ /usr/local/vesta/bin/v-add-web-domain-ssl $user $domain $TMPLOC "same" "$restart"
+else
+ #Replace the existing cert with the new one
+ /usr/local/vesta/bin/v-change-web-domain-sslcert $user $domain $TMPLOC "$restart"
+fi
+
+rm -rf $TMPLOC
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+
+exit
diff --git a/bin/v-install-wordfence-cli b/bin/v-install-wordfence-cli
new file mode 100644
index 00000000..fc6ca0b5
--- /dev/null
+++ b/bin/v-install-wordfence-cli
@@ -0,0 +1,37 @@
+#!/bin/bash
+# info: Script for installing WordFence CLI
+# options: NONE
+
+if ! command -v git &> /dev/null; then
+ echo "= Git is not installed. Installing..."
+ apt-get update > /dev/null 2>&1
+ apt-get install -y git
+fi
+
+cd /root
+
+if [ ! -d "myvesta-wordfence-cli" ]; then
+ git clone https://github.com/isscbta/myvesta-wordfence-cli.git
+ cd ~/myvesta-wordfence-cli/
+else
+ cd ~/myvesta-wordfence-cli/
+ git pull
+fi
+
+echo ""
+echo "----------------------------------------------------------------"
+echo ""
+echo "Which Docker container do you want to install for WordFence CLI?"
+echo "1. WordFence CLI official Docker container"
+echo "2. WordFence CLI Docker container maintained by myVesta"
+read -r -p "Enter your choice: " choice < /dev/tty
+
+if [ "$choice" == "1" ]; then
+ bash wf-cli-install.sh
+fi
+
+if [ "$choice" == "2" ]; then
+ bash wf-cli-install-our-image.sh
+fi
+
+exit 0;
diff --git a/bin/v-install-wordpress b/bin/v-install-wordpress
new file mode 100644
index 00000000..25e38f3e
--- /dev/null
+++ b/bin/v-install-wordpress
@@ -0,0 +1,188 @@
+#!/bin/bash
+# info: WordPress installer in one command line
+# options: DOMAIN [DB_NAME] [EMAIL]
+#
+# Credits to Luka Paunović for wp-cli implememtation
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/db.sh
+source /usr/local/vesta/conf/vesta.conf
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+if [[ $(is_package_full 'DATABASES') = *reached* ]]; then
+ echo "Database limit is reached. Delete database or upgrade user package."
+ exit
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN [DB_NAME] [EMAIL]'
+is_format_valid 'domain' 'database' 'email'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+# take --parameters
+source /usr/local/vesta/func/handle_parameters.sh
+
+if [ -z "$database" ]; then
+ if [ ! -z "$MAX_DBUSER_LEN" ] && [ "$MAX_DBUSER_LEN" -ge 80 ]; then
+ database=$(echo "$domain" | sed 's#\.#_#g')
+ else
+ database="wp"
+ fi
+fi
+
+# Convert domain to IDN if available
+if command -v idn2 >/dev/null 2>&1; then
+ database=$(idn2 "$database")
+ idn_domain=$(idn2 "$domain")
+elif command -v idn >/dev/null 2>&1; then
+ database=$(idn "$database")
+ idn_domain=$(idn "$domain")
+fi
+
+if [ -z "$email" ]; then
+ email="info@$idn_domain";
+fi
+
+if [ ! -d "/home/$user" ]; then
+ echo "= Error: Folder /home/$user doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "= Error: Folder /home/$user/web/$domain/public_html doesn't exist";
+ exit 1;
+fi
+
+DBUSERSUF="$database";
+DBUSERSUFB="$database";
+DBUSER=$user\_$DBUSERSUFB;
+DB_EXISTS=$(check_if_database_exists "$user" "$DBUSER")
+
+if [ "$DB_EXISTS" = "yes" ]; then
+ i=1;
+ while [ $i -lt 99 ]; do
+ i=$((i+1));
+ DBUSERSUF="${DBUSERSUFB}${i}";
+ DBUSER=$user\_$DBUSERSUF;
+ DB_EXISTS=$(check_if_database_exists "$user" "$DBUSER")
+ if [ "$DB_EXISTS" = "no" ]; then
+ break;
+ fi
+ done
+fi
+
+PASSWDDB=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+PROTOCOL='https'
+
+if [ ! -f "/home/$user/conf/web/ssl.$domain.ca" ]; then
+ echo "== Trying to install LetsEncrypt for domain $domain"
+ /usr/local/vesta/bin/v-add-letsencrypt-domain "$user" "$domain" "www.$domain" "yes"
+fi
+
+if [ ! -z "$FORCE_HTTP" ]; then
+ # Switch to http:// only if --FORCE_HTTP parameter is set
+ echo "== Force http://"
+ PROTOCOL='http'
+fi
+
+TPL_CHANGED=0;
+
+if [ "$WEB_SYSTEM" != 'nginx' ]; then
+ if [ "$PROTOCOL" = "https" ]; then
+ if [ -f "/usr/local/vesta/data/templates/web/nginx/force-https-firewall-wordpress.stpl" ] && [ $TPL_CHANGED -eq 0 ]; then
+ TPL_CHANGED=1;
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "force-https-firewall-wordpress" "jpeg,jpg,png,gif,bmp,ico,svg,tif,tiff,css,js,ttf,otf,webp,txt,csv,rtf,doc,docx,xls,xlsx,ppt,pptx,odf,odp,ods,odt,pdf,psd,ai,eot,eps,ps,zip,tar,tgz,gz,rar,bz2,7z,aac,m4a,mp3,mp4,ogg,wav,wma,3gp,avi,flv,m4v,mkv,mov,mpeg,mpg,wmv,exe,iso,dmg,swf,woff,woff2" "yes"
+ fi
+ if [ -f "/usr/local/vesta/data/templates/web/nginx/force-https.stpl" ] && [ $TPL_CHANGED -eq 0 ]; then
+ TPL_CHANGED=1;
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "force-https" "jpeg,jpg,png,gif,bmp,ico,svg,tif,tiff,css,js,ttf,otf,webp,txt,csv,rtf,doc,docx,xls,xlsx,ppt,pptx,odf,odp,ods,odt,pdf,psd,ai,eot,eps,ps,zip,tar,tgz,gz,rar,bz2,7z,aac,m4a,mp3,mp4,ogg,wav,wma,3gp,avi,flv,m4v,mkv,mov,mpeg,mpg,wmv,exe,iso,dmg,swf,woff,woff2" "yes"
+ fi
+ fi
+ if [ "$PROTOCOL" = "http" ]; then
+ if [ -f "/usr/local/vesta/data/templates/web/nginx/hosting-firewall-wordpress.stpl" ] && [ $TPL_CHANGED -eq 0 ]; then
+ TPL_CHANGED=1;
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "hosting-firewall-wordpress" "jpeg,jpg,png,gif,bmp,ico,svg,tif,tiff,css,js,ttf,otf,webp,txt,csv,rtf,doc,docx,xls,xlsx,ppt,pptx,odf,odp,ods,odt,pdf,psd,ai,eot,eps,ps,zip,tar,tgz,gz,rar,bz2,7z,aac,m4a,mp3,mp4,ogg,wav,wma,3gp,avi,flv,m4v,mkv,mov,mpeg,mpg,wmv,exe,iso,dmg,swf,woff,woff2" "yes"
+ fi
+ fi
+fi
+
+/usr/local/vesta/bin/v-add-database "$user" "$DBUSERSUF" "$DBUSERSUF" "$PASSWDDB" "mysql"
+
+WORKINGDIR="/home/$user/web/$domain/public_html"
+rm -rf $WORKINGDIR/*
+cd $WORKINGDIR
+
+/usr/local/vesta/bin/v-run-wp-cli $domain core download
+if [ ! -f "$WORKINGDIR/index.php" ]; then
+ echo "= WordPress installation failed: WordPress core download failed."
+ exit 1;
+fi
+
+/usr/local/vesta/bin/v-run-wp-cli $domain core config --dbname=$DBUSER --dbuser=$DBUSER --dbpass=$PASSWDDB
+if [ ! -f "$WORKINGDIR/wp-config.php" ]; then
+ echo "= WordPress installation failed: WordPress core config failed, wp-config.php not found."
+ exit 1;
+fi
+
+password=$(LC_CTYPE=C tr -dc A-Za-z0-9_\!\@\#\$\%\^\&\*\(\)-+= < /dev/urandom | head -c 12)
+
+wpadmin=$(echo "$domain" | sed 's#\.#_#g')_4dm1n
+
+/usr/local/vesta/bin/v-run-wp-cli $domain core install --url="$domain" --title="$domain" --admin_user="$wpadmin" --admin_password="$password" --admin_email="$email" --path=$WORKINGDIR
+
+mysql -u$DBUSER -p$PASSWDDB -e "USE $DBUSER; update wp_options set option_value = '$PROTOCOL://$domain' where option_name = 'siteurl'; update wp_options set option_value = '$PROTOCOL://$domain' where option_name = 'home';"
+
+echo "================================================================="
+echo "Your WordPress installation is complete."
+echo ""
+echo "Website URL: $PROTOCOL://$domain/"
+echo ""
+echo "WordPress admin login: $PROTOCOL://$domain/wp-admin/"
+echo "Username: $wpadmin"
+echo "Password: $password"
+echo ""
+echo "================================================================="
+
+chown -R $user:$user $WORKINGDIR
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+echo "v-install-wordpress: Done."
+
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-install-wp-cli b/bin/v-install-wp-cli
new file mode 100644
index 00000000..17df71e8
--- /dev/null
+++ b/bin/v-install-wp-cli
@@ -0,0 +1,27 @@
+#!/bin/bash
+# info: Download WP CLI
+# options: NONE
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+echo "= Installing WP CLI by downloading phar file..."
+wget -nv https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/local/bin/wp
+chmod +x /usr/local/bin/wp
+
+if [ -f "/usr/local/bin/wp" ]; then
+ echo "= WP CLI installed successfully."
+ echo "= Usage: v-run-wp-cli DOMAIN WP_CLI_COMMAND"
+ exit 0;
+else
+ echo "= WP CLI installation failed."
+ echo "= Please install it manually."
+ exit 1;
+fi
diff --git a/bin/v-install-wp-cli-myvesta b/bin/v-install-wp-cli-myvesta
new file mode 100644
index 00000000..b65479f6
--- /dev/null
+++ b/bin/v-install-wp-cli-myvesta
@@ -0,0 +1,79 @@
+#!/bin/bash
+# info: Download myVesta WP CLI
+# options: NONE
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+if [ ! -f "/usr/local/bin/composer" ]; then
+ echo "= Composer is not installed. Installing..."
+ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+ php composer-setup.php --install-dir=/usr/local/bin --filename=composer
+ php -r "unlink('composer-setup.php');"
+ echo "= Composer installed successfully."
+fi
+
+if [ -d "/usr/local/bin/wp-cli" ]; then
+ echo "= Removing old myVesta WP CLI..."
+ rm -rf /usr/local/bin/wp-cli
+fi
+
+echo "= Installing myVesta WP CLI..."
+
+cd /usr/local/bin
+git clone https://github.com/wp-cli/wp-cli.git
+
+chown -R www-data:www-data wp-cli
+
+ver_ge() {
+ # usage: ver_ge 7.2 5.6 --> returns true if $1 is greater than or equal to $2
+ [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
+}
+
+current_php_version=$(readlink -f /usr/bin/php | grep -oP 'php\K[0-9]+\.[0-9]+')
+
+php_versions=$(/usr/local/vesta/bin/v-list-php)
+for php_version in $php_versions; do
+ if ver_ge "$php_version" "7.2"; then
+ oldest_allowed_php_version=$php_version
+ break
+ fi
+done
+
+echo "= Setting PHP version to $oldest_allowed_php_version"
+update-alternatives --set php /usr/bin/php$oldest_allowed_php_version
+
+cd wp-cli/
+sudo -H -u www-data composer install
+
+echo "= Installing search-replace-command package..."
+sudo -H -u www-data WP_CLI_PACKAGES_DIR=/usr/local/bin/wp-cli/packages php /usr/local/bin/wp-cli/php/boot-fs.php package install wp-cli/search-replace-command
+
+echo "= Setting PHP version to $current_php_version"
+update-alternatives --set php /usr/bin/php$current_php_version
+
+# Fix terminal columns issue for WP CLI
+echo "= Fixing terminal columns issue for WP CLI..."
+/usr/local/vesta/bin/v-sed '$columns = 80;' "if (file_exists('/usr/local/bin/wp-cli/COLUMNS')) \$columns=intval(file_get_contents('/usr/local/bin/wp-cli/COLUMNS')); else \$columns = 80;" '/usr/local/bin/wp-cli/vendor/wp-cli/php-cli-tools/lib/cli/Shell.php'
+
+echo ""
+
+if [ -f "/usr/local/bin/wp-cli/php/boot-fs.php" ]; then
+ echo "= myVesta WP CLI installed successfully."
+ echo "= Usage: v-run-wp-cli-myvesta DOMAIN WP_CLI_COMMAND"
+ exit 0;
+else
+ echo "= myVesta WP CLI installation failed."
+ echo "= Please install it manually."
+ exit 1;
+fi
diff --git a/bin/v-list-php b/bin/v-list-php
new file mode 100644
index 00000000..846e40de
--- /dev/null
+++ b/bin/v-list-php
@@ -0,0 +1,76 @@
+#!/bin/bash
+# info: list of installed php versions
+# options: [FORMAT]
+#
+# The function for obtaining the list of installed PHP versions.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument definition
+format=${1-shell}
+
+# Includes
+source $VESTA/func/main.sh
+
+# JSON list function
+json_list() {
+ counter=$(echo "$phpversions" | wc -l)
+ i=1
+ echo '['
+ for phpversion in $phpversions; do
+ if [ "$i" -lt "$counter" ]; then
+ echo -e "\t\"$phpversion\","
+ else
+ echo -e "\t\"$phpversion\""
+ fi
+ (( ++i))
+ done
+ echo "]"
+}
+
+# shell list function
+shell_list() {
+ for phpversion in $phpversions; do
+ echo "$phpversion"
+ done
+}
+
+# PLAIN list function
+plain_list() {
+ for phpversion in $phpversions; do
+ echo "$phpversion"
+ done
+}
+
+# CSV list function
+csv_list() {
+ for phpversion in $phpversions; do
+ echo "$phpversion"
+ done
+}
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Obtaining the list of installed PHP-FPM versions
+phpversions=$(find /etc/php/ -type d -name 'fpm' | sed "s|/etc/php/||" | sed "s|/fpm||" | sort)
+
+# Listing data
+case $format in
+ json) json_list ;;
+ plain) plain_list ;;
+ csv) csv_list ;;
+ shell) shell_list ;;
+esac
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-list-php-apache b/bin/v-list-php-apache
new file mode 100644
index 00000000..e2e431b1
--- /dev/null
+++ b/bin/v-list-php-apache
@@ -0,0 +1,91 @@
+#!/bin/bash
+# info: list of installed php versions that have Apache template.
+# options: [FORMAT]
+#
+# The function obtains the list of installed PHP versions that have Apache template.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument definition
+format=${1-shell}
+
+# Includes
+source $VESTA/func/main.sh
+
+# JSON list function
+json_list() {
+ counter=$(echo "$phpversions" | wc -l)
+ i=1
+ echo '['
+ for phpversion in $phpversions; do
+ if [ "$i" -lt "$counter" ]; then
+ echo -e "\t\"$phpversion\","
+ else
+ echo -e "\t\"$phpversion\""
+ fi
+ (( ++i))
+ done
+ echo "]"
+}
+
+# shell list function
+shell_list() {
+ for phpversion in $phpversions; do
+ echo "$phpversion"
+ done
+}
+
+# PLAIN list function
+plain_list() {
+ for phpversion in $phpversions; do
+ echo "$phpversion"
+ done
+}
+
+# CSV list function
+csv_list() {
+ for phpversion in $phpversions; do
+ echo "$phpversion"
+ done
+}
+
+echo_phpversions_list() {
+ for element in "${phpversions_list[@]}"; do
+ echo "$element"
+ done
+}
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Obtaining the list of installed PHP-FPM versions
+fpmphpversions=$(/usr/local/vesta/bin/v-list-php)
+
+for phpversion in $fpmphpversions; do
+ phpversiontpl=${phpversion//./}
+ tpl="/usr/local/vesta/data/templates/web/apache2/PHP-FPM-$phpversiontpl.tpl"
+ if [ -f "$tpl" ]; then
+ phpversions_list+=("$phpversion")
+ fi
+done
+
+phpversions=$(echo_phpversions_list)
+
+# Listing data
+case $format in
+ json) json_list ;;
+ plain) plain_list ;;
+ csv) csv_list ;;
+ shell) shell_list ;;
+esac
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-list-sys-config b/bin/v-list-sys-config
index 127f2176..a0fdbbbc 100755
--- a/bin/v-list-sys-config
+++ b/bin/v-list-sys-config
@@ -54,7 +54,8 @@ json_list() {
"SOFTACULOUS": "'$SOFTACULOUS'",
"MAX_DBUSER_LEN": "'$MAX_DBUSER_LEN'",
"MAIL_CERTIFICATE": "'$MAIL_CERTIFICATE'",
- "VESTA_CERTIFICATE": "'$VESTA_CERTIFICATE'"
+ "VESTA_CERTIFICATE": "'$VESTA_CERTIFICATE'",
+ "DISABLE_IP_CHECK": "'$DISABLE_IP_CHECK'"
}
}'
}
diff --git a/bin/v-list-sys-services b/bin/v-list-sys-services
index 3718c171..d23a92a7 100755
--- a/bin/v-list-sys-services
+++ b/bin/v-list-sys-services
@@ -18,6 +18,8 @@ source $VESTA/conf/vesta.conf
export PATH=$PATH:/sbin
+debug=0
+
# JSON list function
json_list() {
IFS=$'\n'
@@ -50,6 +52,9 @@ shell_list() {
echo "---- ----- --- --- ------"
while read str; do
eval $str
+ if [ "$STATE" = "stopped" ]; then
+ STATE='off'
+ fi
echo "$NAME $STATE $CPU $MEM $RTIME"
done < <(echo -e "$data" |grep NAME)
}
@@ -77,8 +82,17 @@ csv_list() {
get_srv_state() {
srv=$1
name=${2-$1}
+ procfolder=$4
+ procfile=$5
state='running'
+ mem=0
+ cpu=0
+ rtime="0"
+ if [ $debug -eq 1 ]; then
+ echo "---------------------"
+ echo "$srv = $name"
+ fi
# Searching related pids
if [ -z $3 ]; then
pids=$(pidof $name |tr ' ' '|')
@@ -88,10 +102,23 @@ get_srv_state() {
if [ -z "$pids" ] && [ "$name" != 'nginx' ]; then
pids=$(pgrep $name |tr '\n' '|')
fi
+ if [ "$name" = 'elasticsearch' ]; then
+ pids=$(ps -Af | grep 'elasticsearch' | grep -v 'grep' | awk '{print $2}' | tr '\n' '|')
+ fi
+ if [ "$name" = 'vesta-nginx' ]; then
+ pids=$(ps -Af | grep 'vesta/nginx' | grep -v 'grep' | awk '{print $2}' | tr '\n' '|')
+ fi
+ if [ "$name" = 'vesta-php' ]; then
+ pids=$(ps -Af | grep 'vesta/php' | grep -v 'grep' | awk '{print $2}' | tr '\n' '|')
+ fi
+ if [ $debug -eq 1 ]; then
+ echo "pids = $pids"
+ fi
# Checking pid
- if [ ! -z "$pids" ]; then
+ if [ -n "$pids" ]; then
pid=$(echo "$pids" |cut -f 1 -d '|')
+ pids=${pids%|}
pids=$(egrep "$pids" $tmp_file)
# Calculating CPU usage
@@ -103,7 +130,22 @@ get_srv_state() {
# Searching pid file
pid_file=''
- if [ -e "/var/run/$srv.pid" ]; then
+ if [ ! -z "$procfolder" ]; then
+ if [ -f "/var/run/$procfolder/$srv.pid" ]; then
+ pid_file="/var/run/$procfolder/$srv.pid"
+ fi
+ fi
+ if [ -z "$pid_file" ] && [ ! -z "$procfolder" ] && [ ! -z "$procfile" ]; then
+ if [ -f "/var/run/$procfolder/$procfile.pid" ]; then
+ pid_file="/var/run/$procfolder/$procfile.pid"
+ fi
+ fi
+ if [ -z "$pid_file" ] && [ -z "$procfolder" ] && [ ! -z "$procfile" ]; then
+ if [ -f "/var/run/$procfile.pid" ]; then
+ pid_file="/var/run/$procfile.pid"
+ fi
+ fi
+ if [ -z "$pid_file" ] && [ -e "/var/run/$srv.pid" ]; then
pid_file="/var/run/$srv.pid"
fi
if [ -z "$pid_file" ] && [ -e "/var/run/$srv/$srv.pid" ]; then
@@ -112,18 +154,31 @@ get_srv_state() {
if [ -z "$pid_file" ] && [ -e "/var/run/$name/$name.pid" ]; then
pid_file="/var/run/$name/$name.pid"
fi
+ if [ -z "$pid_file" ] && [ -f "/var/run/$name.pid" ]; then
+ pid_file="/var/run/$name.pid"
+ fi
if [ -z "$pid_file" ] && [ -e "/proc/$pid" ]; then
pid_file="/proc/$pid"
fi
+ if [ $debug -eq 1 ]; then
+ echo "$srv = $name = $pid_file"
+ fi
# Calculating uptime
- if [ ! -z "$pid_file" ]; then
+ if [ -n "$pid_file" ]; then
mtime=$(stat -c "%Y" $pid_file)
rtime=$((ctime - mtime))
rtime=$((rtime / 60))
else
rtime=0
fi
+ if [ "$pid_file" = "/proc/$pid" ]; then
+ if [ $debug -eq 1 ]; then
+ echo "getting pid lifetime via ps"
+ fi
+ rtime=$(ps -p $pid -o etimes | tail -n 1 | awk '{print $1}')
+ rtime=$((rtime / 60))
+ fi
else
state='stopped'
mem=0
@@ -151,14 +206,6 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'remote' ]; then
data="$data MEM='$mem' RTIME='$rtime'"
fi
-# Checking WEB Backend
-if [ ! -z "$WEB_BACKEND" ] && [ "$WEB_BACKEND" != 'remote' ]; then
- proc_name=$(ls /usr/sbin/php*fpm* | rev | cut -d'/' -f 1 | rev)
- get_srv_state $proc_name
- data="$data\nNAME='$WEB_BACKEND' SYSTEM='backend server' STATE='$state'"
- data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
-fi
-
# Checking WEB Proxy
if [ ! -z "$PROXY_SYSTEM" ] && [ "$PROXY_SYSTEM" != 'remote' ]; then
get_srv_state $PROXY_SYSTEM
@@ -166,6 +213,18 @@ if [ ! -z "$PROXY_SYSTEM" ] && [ "$PROXY_SYSTEM" != 'remote' ]; then
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
+# Checking WEB Backend
+if [ "$WEB_BACKEND" != 'remote' ]; then
+ php_versions=$(ls /usr/sbin/php*fpm* | cut -d'/' -f4 | sed 's|php-fpm||')
+ for version in $php_versions; do
+ proc_name="php-fpm${version}"
+ service_name="php${version}-fpm"
+ get_srv_state "$service_name" "$proc_name" '' 'php'
+ data="$data\nNAME='$service_name' SYSTEM='backend server' STATE='$state'"
+ data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
+ done
+fi
+
# DNS
service=$DNS_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'remote' ]; then
@@ -177,14 +236,22 @@ fi
# Checking MAIL system
if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'remote' ]; then
- get_srv_state $MAIL_SYSTEM
+ if [ "$MAIL_SYSTEM" = "exim4" ]; then
+ get_srv_state "$MAIL_SYSTEM" "$MAIL_SYSTEM" '' 'exim4' 'exim'
+ else
+ get_srv_state $MAIL_SYSTEM
+ fi
data="$data\nNAME='$MAIL_SYSTEM' SYSTEM='mail server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
# Checking MAIL IMAP
if [ ! -z "$IMAP_SYSTEM" ] && [ "$IMAP_SYSTEM" != 'remote' ]; then
- get_srv_state $IMAP_SYSTEM
+ if [ "$IMAP_SYSTEM" = "dovecot" ]; then
+ get_srv_state "$IMAP_SYSTEM" "$IMAP_SYSTEM" '' 'dovecot' 'master'
+ else
+ get_srv_state $IMAP_SYSTEM
+ fi
data="$data\nNAME='$IMAP_SYSTEM' SYSTEM='pop/imap server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
@@ -200,11 +267,19 @@ if [ ! -z "$ANTIVIRUS_SYSTEM" ] && [ "$ANTIVIRUS_SYSTEM" != 'remote' ]; then
if [ "$ANTIVIRUS_SYSTEM" == 'clamav-daemon' ];then
proc_name='clamd'
fi
- get_srv_state $ANTIVIRUS_SYSTEM $proc_name
+ get_srv_state $ANTIVIRUS_SYSTEM $proc_name '' 'clamav' 'clamd'
fi
data="$data\nNAME='$ANTIVIRUS_SYSTEM' SYSTEM='email antivirus'"
data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'"
proc_name=''
+ if [ ! -d "/etc/sysconfig" ]; then
+ if [ "$ANTIVIRUS_SYSTEM" == 'clamav-daemon' ];then
+ get_srv_state "clamav-freshclam" "freshclam"
+ data="$data\nNAME='clamav-freshclam' SYSTEM='email antivirus updater'"
+ data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'"
+ proc_name=''
+ fi
+ fi
fi
# Checking MAIL ANTISPAM
@@ -220,6 +295,16 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'remote' ]; then
proc_name=''
service="$db"
if [ "$service" = 'mysql' ]; then
+ proc_name='mysqld'
+ release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+ if [ "$release" -gt 10 ] && [ ! -f "/etc/apt/sources.list.d/mysql.list" ]; then
+ service='mariadb'
+ proc_name='mariadbd'
+ fi
+ if [ -f "/etc/apt/sources.list.d/mariadb.list" ]; then
+ service='mariadb'
+ proc_name='mariadbd'
+ fi
if [ -d "/etc/sysconfig" ]; then
service='mysqld'
proc_name='mysqld'
@@ -238,7 +323,7 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'remote' ]; then
proc_name='postgres'
fi
fi
- get_srv_state $service $proc_name
+ get_srv_state $service $proc_name '' 'mysqld' 'mysqld'
data="$data\nNAME='$service' SYSTEM='database server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
proc_name=''
@@ -254,11 +339,28 @@ fi
# Checking CRON system
if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'remote' ]; then
- get_srv_state $CRON_SYSTEM
+ get_srv_state "$CRON_SYSTEM" "$CRON_SYSTEM" '' '' 'crond'
data="$data\nNAME='$CRON_SYSTEM' SYSTEM='job scheduler' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
+# Checking SSH daemon
+if [ -e "/etc/ssh/sshd_config" ]; then
+ get_srv_state 'ssh' 'ssh' '' '' 'sshd'
+ data="$data\nNAME='ssh' SYSTEM='SSH Access' STATE='$state'"
+ data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
+fi
+
+# Checking Vesta nginx
+get_srv_state 'vesta' 'vesta-nginx' '' '' 'vesta-nginx'
+data="$data\nNAME='vesta-nginx' SYSTEM='Vesta nginx service' STATE='$state'"
+data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
+
+# Checking Vesta php-fpm
+get_srv_state 'vesta' 'vesta-php' '' '' 'vesta-php'
+data="$data\nNAME='vesta-php' SYSTEM='Vesta php service' STATE='$state'"
+data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
+
# Checking FIREWALL system
if [ ! -z "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != 'remote' ]; then
state="stopped"
@@ -272,11 +374,33 @@ fi
# Checking FIREWALL Fail2ban extention
if [ ! -z "$FIREWALL_EXTENSION" ]; then
- get_srv_state $FIREWALL_EXTENSION fail2ban-server script
+ get_srv_state "$FIREWALL_EXTENSION" 'fail2ban-server' 'script'
data="$data\nNAME='$FIREWALL_EXTENSION' SYSTEM='brute-force monitor'"
data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'"
fi
+# Checking ElasticSearch
+if [ -d "/etc/elasticsearch" ]; then
+ get_srv_state 'elasticsearch'
+ data="$data\nNAME='elasticsearch' SYSTEM='ElasticSearch' STATE='$state'"
+ data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
+fi
+
+# Checking Redis
+if [ -d "/etc/redis" ]; then
+ get_srv_state 'redis' 'redis-server' '' 'redis' 'redis-server'
+ data="$data\nNAME='redis' SYSTEM='Redis' STATE='$state'"
+ data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
+fi
+
+# Checking Memcached
+if [ -f "/etc/memcached.conf" ]; then
+ get_srv_state 'memcached'
+ data="$data\nNAME='memcached' SYSTEM='Memcached' STATE='$state'"
+ data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
+fi
+
+
# Listing data
case $format in
json) json_list ;;
diff --git a/bin/v-list-user-log b/bin/v-list-user-log
index ca317f7d..6be9f9ae 100755
--- a/bin/v-list-user-log
+++ b/bin/v-list-user-log
@@ -12,6 +12,7 @@
# Argument definition
user=$1
format=${2-shell}
+limit=${3-300}
# Includes
source $VESTA/func/main.sh
@@ -34,6 +35,9 @@ json_list() {
"TIME": "'$TIME'",
"DATE": "'$DATE'"
}'
+ if [ "$limit" -gt 0 ] && [ "$i" = "$limit" ]; then
+ break;
+ fi
if [ "$i" -lt "$objects" ]; then
echo ','
else
@@ -83,7 +87,7 @@ csv_list() {
# Verifications #
#----------------------------------------------------------#
-check_args '1' "$#" 'USER [FORMAT]'
+check_args '1' "$#" 'USER [FORMAT] [LIMIT]'
is_format_valid 'user'
is_object_valid 'user' 'USER' "$user"
@@ -93,7 +97,7 @@ is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Parsing history log
-logs=$(tail -n 300 $USER_DATA/history.log 2>/dev/null)
+logs=$(tail -n $limit $USER_DATA/history.log | tac)
case $format in
json) json_list ;;
diff --git a/bin/v-lock-wordpress b/bin/v-lock-wordpress
new file mode 100644
index 00000000..36852781
--- /dev/null
+++ b/bin/v-lock-wordpress
@@ -0,0 +1,93 @@
+#!/bin/bash
+# info: Lock WordPress files if they are potentially infected (somewhere) by PHP malware, in order to stop further infection
+# options: DOMAIN
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+unlock_folder() {
+ chown -R $user:$user $1/
+
+ # block .php execution inside folder
+ cat <$1/.htaccess
+RewriteEngine on
+RewriteRule ^.*\.(?:php[1-6]?|pht|phtml?)$ - [NC,F]
+EOF
+
+ chown root:root $1/.htaccess
+}
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ echo "User doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "Domain doesn't exist";
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+cd /home/$user/web/$domain
+
+# lock files
+chown -R www-data:www-data public_html/
+
+# set correct chmod just in case
+find public_html/ -type d -exec chmod 755 {} +
+find public_html/ -type f -exec chmod 644 {} +
+
+# unlock /wp-content/uploads/ for uploading
+if [ -d "/home/$user/web/$domain/public_html/wp-content/uploads" ]; then
+ unlock_folder "public_html/wp-content/uploads"
+fi
+
+# unlock /wp-content/cache/ for caching
+if [ -d "/home/$user/web/$domain/public_html/wp-content/cache" ]; then
+ unlock_folder "public_html/wp-content/cache"
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+echo "v-lock-wordpress: Done."
+
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-log-failed-login b/bin/v-log-failed-login
new file mode 100644
index 00000000..66b9b808
--- /dev/null
+++ b/bin/v-log-failed-login
@@ -0,0 +1,31 @@
+#!/bin/bash
+# info: log failed login attempt
+# options: USER [IP]
+#
+# The function log failed login attempt
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument definition
+user=$1
+ip=${2-127.0.0.1}
+
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+echo "$date $time $user $ip failed to login" >> $VESTA/log/auth.log
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit 0
diff --git a/bin/v-make-ip-ssl b/bin/v-make-ip-ssl
new file mode 100644
index 00000000..25c1b10f
--- /dev/null
+++ b/bin/v-make-ip-ssl
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+# info: Copy host SSL as IP SSL
+# options: USER DOMAIN
+#
+# The function check if specific (sub)domain is marked as main host for specific IP, get its SSL and put it as IP SSL in /usr/local/vesta/ssl/
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Argument definition
+user=$1
+domain=$2
+
+# Importing system environment
+source /etc/profile
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'USER DOMAIN'
+is_format_valid 'user' 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+if [ ! -f "/etc/exim4/virtual/helo_data" ]; then
+ exit 1
+fi
+
+echo "Script ran with: $user $domain" >> /usr/local/vesta/log/v-make-ip-ssl.log
+
+grepr=$(grep -c ": $domain$" /etc/exim4/virtual/helo_data)
+if [ $grepr -ge 1 ]; then
+ ip=$(grep ": $domain$" /etc/exim4/virtual/helo_data | awk -F: '{print $1}')
+ if [ ! -z "$ip" ]; then
+ echo "Processinng $domain" >> /usr/local/vesta/log/v-make-ip-ssl.log
+ echo "IP = $ip" >> /usr/local/vesta/log/v-make-ip-ssl.log
+ cp /home/$user/conf/web/ssl.$domain.pem /usr/local/vesta/ssl/$ip.crt
+ cp /home/$user/conf/web/ssl.$domain.key /usr/local/vesta/ssl/$ip.key
+
+ exim_user="exim";
+ check_exim_username=$(grep -c '^Debian-exim:' /etc/passwd)
+ if [ "$check_exim_username" -eq 1 ]; then
+ exim_user="Debian-exim"
+ fi
+
+ # Assign exim permissions
+ chown $exim_user:mail /usr/local/vesta/ssl/$ip.crt
+ chown $exim_user:mail /usr/local/vesta/ssl/$ip.key
+
+ service exim4 restart
+ service dovecot restart
+ echo "Done." >> /usr/local/vesta/log/v-make-ip-ssl.log
+ fi
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-make-main-apache-log b/bin/v-make-main-apache-log
new file mode 100644
index 00000000..6a6dfadd
--- /dev/null
+++ b/bin/v-make-main-apache-log
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+touch /var/log/apache2/time.log
+# truncate -s 0 /var/log/apache2/time.log
+chmod 0640 /var/log/apache2/time.log
+chown root:adm /var/log/apache2/time.log
+find /home/*/conf/web/ -type f \( -name "apache2.conf" -or -name "sapache2.conf" -or -name "*.apache2.conf" -or -name "*.apache2.ssl.conf" \) -exec grep -L "time\.log" {} \; | xargs sed -i 's|ServerName |CustomLog /var/log/apache2/time.log time\n ServerName |g'
+find /usr/local/vesta/data/templates/web/apache2 -type f \( -name "*.tpl" -or -name "*.stpl" \) -exec grep -L "time\.log" {} \; | xargs sed -i 's|ServerName |CustomLog /var/log/apache2/time.log time\n ServerName |g'
+if ! /usr/local/vesta/bin/v-grep 'LogFormat "%t %v %a %D %r %>s \"%{User-Agent}i\"" time' '/etc/apache2/apache2.conf' '-q'; then
+ sed -i 's|LogFormat "%b" bytes|LogFormat "%b" bytes\nLogFormat "%t %v %a %D %r %>s \\\"%{User-Agent}i\\\" pid=%P" time|g' /etc/apache2/apache2.conf
+fi
+systemctl restart apache2
+
+wget -nv http://dl.myvestacp.com/vesta/apache_requests_analyzer/analyze-traffic.php -O /root/analyze-traffic.php
diff --git a/bin/v-make-separated-ip-for-email b/bin/v-make-separated-ip-for-email
new file mode 100644
index 00000000..15e42c05
--- /dev/null
+++ b/bin/v-make-separated-ip-for-email
@@ -0,0 +1,234 @@
+ #!/bin/bash
+
+# info: add new ip and makes email to be sent via that IP only for SMTP authenticated users
+# options: MAIL_HOSTNAME MAIL_IP
+#
+# The function add new ip, add new host for mail, try to generate letsencrypt for it, and makes email to be sent via that IP only for SMTP authenticated users
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+MAIL_HOSTNAME=$1
+MAIL_IP=$2
+
+if [ $# -gt 2 ]; then
+ NETMASK=$3
+else
+ NETMASK='255.255.255.192'
+fi
+
+if [ $# -gt 3 ]; then
+ INTERFACE=$4
+else
+ INTERFACE='eth0'
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'MAIL_HOSTNAME MAIL_IP [NETMASK] [INTERFACE]'
+is_domain_format_valid "$MAIL_HOSTNAME"
+is_ip_format_valid "$MAIL_IP"
+
+HOST_USER=$($VESTA/bin/v-search-domain-owner "$HOSTNAME")
+if [ -z "$HOST_USER" ]; then
+ echo "Error: hostname $HOSTNAME is not created as web domain"
+ exit 4
+fi
+
+HOST_IP=$($VESTA/bin/v-list-web-domain "$HOST_USER" "$HOSTNAME" | grep 'IP:' | awk '{print $2}')
+
+echo "HOSTNAME : $HOSTNAME"
+echo "HOSTNAME IP : $HOST_IP"
+echo "MAIL HOSTNAME: $MAIL_HOSTNAME"
+echo "MAIL_IP : $MAIL_IP"
+if [ $# -gt 2 ]; then
+ echo "NETMASK : $NETMASK"
+fi
+if [ $# -gt 3 ]; then
+ echo "INTERFACE : $INTERFACE"
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+if [ ! -f "/usr/local/vesta/data/ips/$MAIL_IP" ]; then
+ echo "=== Adding IP $MAIL_IP with netmask $NETMASK on interface $INTERFACE"
+ $VESTA/bin/v-add-sys-ip "$MAIL_IP" "$NETMASK" "$INTERFACE" 'admin' 'dedicated' '' ''
+fi
+
+MAIL_USER=$($VESTA/bin/v-search-domain-owner "$MAIL_HOSTNAME")
+if [ -z "$MAIL_USER" ]; then
+ MAIL_USER=$HOST_USER
+ echo "=== Creating (sub)domain $MAIL_HOSTNAME"
+ $VESTA/bin/v-add-domain "$MAIL_USER" "$MAIL_HOSTNAME" "$MAIL_IP" 'yes'
+ echo "=== Deleting www from (sub)domain $MAIL_HOSTNAME"
+ www_host="www.$MAIL_HOSTNAME"
+ $VESTA/bin/v-delete-web-domain-alias "$MAIL_USER" "$MAIL_HOSTNAME" "$www_host" 'no'
+ $VESTA/bin/v-delete-dns-on-web-alias "$MAIL_USER" "$MAIL_HOSTNAME" "$www_host" 'no'
+else
+ CURRENT_MAIL_IP=$($VESTA/bin/v-list-web-domain "$MAIL_USER" "$MAIL_HOSTNAME" | grep 'IP:' | awk '{print $2}')
+ if [ "$CURRENT_MAIL_IP" != "$MAIL_IP" ]; then
+ echo "=== Switching (sub)domain $MAIL_HOSTNAME to IP: $MAIL_IP"
+ $VESTA/bin/v-change-web-domain-ip "$MAIL_USER" "$MAIL_HOSTNAME" "$MAIL_IP" 'yes'
+ $VESTA/bin/v-change-dns-domain-ip "$MAIL_USER" "$MAIL_HOSTNAME" "$MAIL_IP" 'yes'
+ fi
+fi
+
+if [ -f "/home/$MAIL_USER/conf/web/ssl.$MAIL_HOSTNAME.ca" ]; then
+ echo "=== Signed SSL already installed"
+else
+ echo "=== Installing LetsEncrypt for (sub)domain $MAIL_HOSTNAME"
+ $VESTA/bin/v-add-letsencrypt-domain "$MAIL_USER" "$MAIL_HOSTNAME" "" "yes"
+ if [ $? -ne 0 ]; then
+ echo "=== LetsEncrypt installation failed"
+ fi
+fi
+
+if [ ! -d "/etc/exim4/virtual" ]; then
+ echo "=== Creating /etc/exim4/virtual directory"
+ mkdir -p /etc/exim4/virtual
+ echo "$HOST_IP: $HOSTNAME" > /etc/exim4/virtual/helo_data
+ echo "$HOSTNAME: $HOST_IP" > /etc/exim4/virtual/interfaces
+ length=$(wc -c /dev/null 2>&1
+ length=$(wc -c /dev/null 2>&1
+fi
+check_grep1=$(grep -c "^$MAIL_IP:" /etc/exim4/virtual/helo_data)
+check_grep2=$(grep -c ": $MAIL_HOSTNAME" /etc/exim4/virtual/helo_data)
+if [ "$check_grep1" -eq 0 ] && [ "$check_grep2" -eq 0 ]; then
+ echo "=== Adding $MAIL_IP: $MAIL_HOSTNAME to /etc/exim4/virtual/helo_data"
+ echo "" >> /etc/exim4/virtual/helo_data
+ echo "$MAIL_IP: $MAIL_HOSTNAME" >> /etc/exim4/virtual/helo_data
+ length=$(wc -c /dev/null 2>&1
+fi
+check_grep1=$(grep -c "^$MAIL_HOSTNAME:" /etc/exim4/virtual/interfaces)
+check_grep2=$(grep -c ": $MAIL_IP" /etc/exim4/virtual/interfaces)
+if [ "$check_grep1" -eq 0 ] && [ "$check_grep2" -eq 0 ]; then
+ echo "=== Adding $MAIL_HOSTNAME: $MAIL_IP to /etc/exim4/virtual/interfaces"
+ echo "" >> /etc/exim4/virtual/interfaces
+ echo "$MAIL_HOSTNAME: $MAIL_IP" >> /etc/exim4/virtual/interfaces
+ length=$(wc -c /dev/null 2>&1
+fi
+
+echo "=== Generating IP SSL for hostname $HOSTNAME"
+$VESTA/bin/v-make-ip-ssl "$HOST_USER" "$HOSTNAME"
+echo "=== Generating IP SSL for mail hostname $MAIL_HOSTNAME"
+$VESTA/bin/v-make-ip-ssl "$MAIL_USER" "$MAIL_HOSTNAME"
+
+check_grep=$(grep -c 'smtp_active_hostname' /etc/exim4/exim4.conf.template)
+if [ "$check_grep" -eq 0 ]; then
+ echo "=== patching exim4.conf.template"
+ mv /etc/exim4/exim4.conf.template /etc/exim4/exim4.conf.template-backup
+ cp /usr/local/vesta/install/debian/12/exim/exim4.conf.template /etc/exim4/exim4.conf.template
+
+ eximversion=$(exim4 --version | grep '^Exim version ' | awk '{print $3}')
+ if (( $(echo "$eximversion < 4.96" | bc -l) )); then
+ cp /usr/local/vesta/install/debian/12/exim/exim4.conf.template.without-srs /etc/exim4/exim4.conf.template
+ sed -i "s|message_linelength_limit|#message_linelength_limit|g" /etc/exim4/exim4.conf.template
+ fi
+
+ if (( $(echo "$eximversion < 4.94" | bc -l) )); then
+ sed -i "s|smtputf8_advertise_hosts|#smtputf8_advertise_hosts|g" /etc/exim4/exim4.conf.template
+ fi
+
+ sed -i "s|FIRSTIP|$HOST_IP|g" /etc/exim4/exim4.conf.template
+ sed -i "s|SECONDIP|$MAIL_IP|g" /etc/exim4/exim4.conf.template
+ sed -i "s|FIRSTHOST|$HOSTNAME|g" /etc/exim4/exim4.conf.template
+ sed -i "s|SECONDHOST|$MAIL_HOSTNAME|g" /etc/exim4/exim4.conf.template
+ sed -i "s|#local_interfaces|local_interfaces|g" /etc/exim4/exim4.conf.template
+ sed -i "s|#smtp_active_hostname|smtp_active_hostname|g" /etc/exim4/exim4.conf.template
+ sed -i "s|#smtp_banner|smtp_banner|g" /etc/exim4/exim4.conf.template
+ sed -i "s|#interface =|interface =|g" /etc/exim4/exim4.conf.template
+ sed -i "s|#helo_data =|helo_data =|g" /etc/exim4/exim4.conf.template
+ /usr/local/vesta/bin/v-sed 'tls_certificate = /usr/local/vesta/ssl/certificate.crt' 'tls_certificate = /usr/local/vesta/ssl/$received_ip_address.crt' '/etc/exim4/exim4.conf.template'
+ /usr/local/vesta/bin/v-sed 'tls_privatekey = /usr/local/vesta/ssl/certificate.key' 'tls_privatekey = /usr/local/vesta/ssl/$received_ip_address.key' '/etc/exim4/exim4.conf.template'
+ touch /etc/exim4/limit_per_email_account_max_sent_emails_per_hour
+ touch /etc/exim4/limit_per_email_account_max_recipients
+ touch /etc/exim4/limit_per_hosting_account_max_sent_emails_per_hour
+ touch /etc/exim4/limit_per_hosting_account_max_recipients
+ check_grep=$(grep -c '#SPAMASSASSIN' /etc/exim4/exim4.conf.template-backup)
+ if [ "$check_grep" -eq 0 ]; then
+ sed -i "s|#SPAMASSASSIN|SPAMASSASSIN|g" /etc/exim4/exim4.conf.template
+ fi
+ check_grep=$(grep -c '#SPAM_SCORE' /etc/exim4/exim4.conf.template-backup)
+ if [ "$check_grep" -eq 0 ]; then
+ sed -i "s|#SPAM_SCORE|SPAM_SCORE|g" /etc/exim4/exim4.conf.template
+ fi
+ check_grep=$(grep -c '#CLAMD' /etc/exim4/exim4.conf.template-backup)
+ if [ "$check_grep" -eq 0 ]; then
+ sed -i "s|#CLAMD|CLAMD|g" /etc/exim4/exim4.conf.template
+ fi
+ systemctl restart exim4
+ if [ $? -ne 0 ]; then
+ systemctl status exim4
+ cp /etc/exim4/exim4.conf.template-backup /etc/exim4/exim4.conf.template
+ systemctl restart exim4
+ echo "=== Patching failed, old exim conf returned, exim4 restarted again."
+ exit 1
+ fi
+ echo "=== Patching successful"
+else
+ echo "=== exim4.conf.template already patched"
+fi
+
+check_grep=$(grep -c 'v-make-ip-ssl' /usr/local/vesta/conf/vesta.conf)
+if [ "$check_grep" -eq 0 ]; then
+ echo "=== Set UPDATE_SSL_SCRIPT to 'v-make-ip-ssl'"
+ echo "UPDATE_SSL_SCRIPT='/usr/local/vesta/bin/v-make-ip-ssl'" >> /usr/local/vesta/conf/vesta.conf
+else
+ echo "=== Value UPDATE_SSL_SCRIPT is already 'v-make-ip-ssl'"
+fi
+
+check_grep=$(grep -c "ip4:$MAIL_IP" /usr/local/vesta/data/templates/dns/default.tpl)
+if [ "$check_grep" -eq 0 ]; then
+ echo "=== Adding IP to SPF"
+ sed -i "s|ip4:%ip%|ip4:%ip% ip4:$MAIL_IP|g" /usr/local/vesta/data/templates/dns/default.tpl
+ NOTFOUNDVAL="ip4:$MAIL_IP"
+ OLDVAL="ip4:$HOST_IP"
+ NEWVAL="ip4:$HOST_IP ip4:$MAIL_IP"
+ find /usr/local/vesta/data/users/*/dns/ -type f -exec grep -L "$NOTFOUNDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g"
+ find /home/*/conf/dns/ -type f -exec grep -L "$NOTFOUNDVAL" {} \; | xargs sed -i "s|$OLDVAL|$NEWVAL|g"
+ service bind9 reload
+fi
+
+echo "=== Done!"
+
+ptr=$(dig +short -x $MAIL_IP)
+ptr_len=${#ptr}
+ptr_len=$((ptr_len-1))
+ptr=${ptr:0:ptr_len}
+if [ "$ptr" != "$MAIL_HOSTNAME" ]; then
+ echo "=============================================================================="
+ echo "WARNING:"
+ echo "PTR record (reverse DNS) for IP $MAIL_IP is $ptr"
+ echo "PTR record (reverse DNS) for IP $MAIL_IP should be $MAIL_HOSTNAME"
+ echo "=============================================================================="
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-make-separated-ip-for-email-domain b/bin/v-make-separated-ip-for-email-domain
new file mode 100644
index 00000000..8f92e6d0
--- /dev/null
+++ b/bin/v-make-separated-ip-for-email-domain
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# info: Switch domain to send emails from desired IP
+# options: DOMAIN IP
+#
+# The function switch domain to send emails from desired IP
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+DOMAIN=$1
+IP=$2
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'DOMAIN IP'
+is_domain_format_valid "$DOMAIN"
+is_ip_format_valid "$IP"
+
+if [ ! -d "/etc/exim4/virtual" ]; then
+ /usr/local/vesta/bin/v-make-separated-ip-for-email "$DOMAIN" "$IP"
+fi
+
+HOST_USER=$($VESTA/bin/v-search-domain-owner "$HOSTNAME")
+if [ -z "$HOST_USER" ]; then
+ echo "Error: hostname $HOSTNAME is not created as web domain"
+ exit 2
+fi
+
+HOST_IP=$($VESTA/bin/v-list-web-domain "$HOST_USER" "$HOSTNAME" | grep 'IP:' | awk '{print $2}')
+
+# echo "HOSTNAME : $HOSTNAME"
+# echo "HOSTNAME IP : $HOST_IP"
+
+check_grep=$(grep -c "^$IP:" /etc/exim4/virtual/helo_data)
+if [ "$check_grep" -eq 0 ]; then
+ /usr/local/vesta/bin/v-make-separated-ip-for-email "$DOMAIN" "$IP"
+fi
+
+USER=$($VESTA/bin/v-search-domain-owner "$DOMAIN")
+if [ -z "$USER" ]; then
+ echo "Error: hostname $DOMAIN is not created as web domain"
+ exit 4
+fi
+
+echo "=== patching exim4.conf.template"
+NEWVALUE=" interface = \${lookup{\$sender_address_domain}lsearch{/etc/exim4/virtual/interfaces} {\$value}{$HOST_IP}}"
+sed -i "s#^ interface = .*#$NEWVALUE#g" /etc/exim4/exim4.conf.template
+NEWVALUE=" helo_data = \"\${lookup{\$sending_ip_address}lsearch{/etc/exim4/virtual/helo_data}{\$value}{$HOSTNAME}}\""
+sed -i "s#^ helo_data = .*#$NEWVALUE#g" /etc/exim4/exim4.conf.template
+
+service exim4 restart
+
+check_grep=$(grep -c "^$DOMAIN:" /etc/exim4/virtual/interfaces)
+if [ "$check_grep" -eq 1 ]; then
+ echo "=== Changing $DOMAIN: $IP in /etc/exim4/virtual/interfaces"
+ sed -i "s#^$DOMAIN: .*#$DOMAIN: $IP#g" /etc/exim4/virtual/interfaces
+else
+ echo "=== Adding $DOMAIN: $IP to /etc/exim4/virtual/interfaces"
+ echo "" >> /etc/exim4/virtual/interfaces
+ echo "$DOMAIN: $IP" >> /etc/exim4/virtual/interfaces
+ length=$(wc -c /dev/null 2>&1
+ echo "=== Done!"
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-migrate-site-to-https b/bin/v-migrate-site-to-https
new file mode 100644
index 00000000..c15a521e
--- /dev/null
+++ b/bin/v-migrate-site-to-https
@@ -0,0 +1,185 @@
+#!/bin/bash
+# info: migrate site to https
+# options: DOMAIN [--DATABASE_NAME=...] [--DATABASE_USERNAME=...] [--DATABASE_PASSWORD=...]
+#
+# Tool that will replace http to https URLs in database, install SSL and switch to force-https proxy template
+# Automatic detection of CMS, automaticaly read DB user, DB name and DB pass.
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+if [ -z "$user" ]; then
+ echo "domain $domain doesn't exist"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/db.sh
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN [--DATABASE_NAME=...] [--DATABASE_USERNAME=...] [--DATABASE_PASSWORD=...]'
+is_format_valid 'domain' 'user'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+
+FROM_DATABASE_NAME=''
+FROM_DATABASE_USERNAME=''
+FROM_DATABASE_PASSWORD=''
+
+FROM_DOMAIN=$domain
+FROM_USER=$user
+
+r=$(/usr/local/vesta/bin/v-get-database-credentials-of-domain $FROM_DOMAIN)
+# echo $r
+eval $r
+
+source /usr/local/vesta/func/handle_parameters.sh
+
+FROM_CONFIG_FILE=$CONFIG_FILE
+FROM_CONFIG_FILE_FULL_PATH=$CONFIG_FILE_FULL_PATH
+if [ ! -f "$FROM_CONFIG_FILE_FULL_PATH" ]; then
+ echo "Error: CONFIG_FILE_FULL_PATH $FROM_CONFIG_FILE_FULL_PATH does not exists"
+ exit 2
+fi
+
+IT_IS_WP=0
+if [ "$CMS_TYPE" = "wordpress" ]; then
+ IT_IS_WP=1
+fi
+
+if [ -z "$FROM_DATABASE_NAME" ]; then
+ FROM_DATABASE_NAME=$DATABASE_NAME
+fi
+if [ -z "$FROM_DATABASE_USERNAME" ]; then
+ FROM_DATABASE_USERNAME=$DATABASE_USERNAME
+fi
+if [ -z "$FROM_DATABASE_PASSWORD" ]; then
+ FROM_DATABASE_PASSWORD=$DATABASE_PASSWORD
+fi
+
+if [ -z "$FROM_DATABASE_NAME" ]; then
+ echo "Error: DATABASE_NAME is empty"
+ exit 3
+fi
+if [ -z "$FROM_DATABASE_USERNAME" ]; then
+ echo "Error: DATABASE_USERNAME is empty"
+ exit 4
+fi
+if [ -z "$FROM_DATABASE_PASSWORD" ]; then
+ echo "Error: DATABASE_PASSWORD is empty"
+ exit 5
+fi
+
+DB_EXISTS=$(check_if_database_exists "$user" "$FROM_DATABASE_NAME")
+if [ "$DB_EXISTS" = "no" ]; then
+ echo "Error: database $FROM_DATABASE_NAME does not exists"
+ exit 6
+fi
+
+phpver=$(/usr/local/vesta/bin/v-get-php-version-of-domain "$FROM_DOMAIN")
+
+# ----------- CHECK -------------
+
+FROM_REPLACE1="http://$FROM_DOMAIN"
+TO_REPLACE1="https://$FROM_DOMAIN"
+FROM_REPLACE2="http://www.$FROM_DOMAIN"
+TO_REPLACE2="https://www.$FROM_DOMAIN"
+
+if [ $IT_IS_WP -eq 0 ]; then
+ if [ ! -f "/root/Search-Replace-DB/srdb.cli.php" ]; then
+ if [ ! -f "/usr/bin/git" ]; then
+ apt-get update > /dev/null 2>&1
+ apt-get -y install git > /dev/null 2>&1
+ fi
+ cd /root
+ git clone https://github.com/interconnectit/Search-Replace-DB.git
+ fi
+fi
+
+
+# ----------- PRINT -------------
+
+
+echo "==============================================================================="
+echo "FROM_REPLACE1 = $FROM_REPLACE1"
+echo "TO_REPLACE1 = $TO_REPLACE1"
+echo "FROM_REPLACE2 = $FROM_REPLACE2"
+echo "TO_REPLACE2 = $TO_REPLACE2"
+echo "----"
+echo "DOMAIN = $FROM_DOMAIN"
+echo "USER = $FROM_USER"
+echo "SITE_FOLDER = $SITE_FOLDER"
+echo "IT_IS_WP = $IT_IS_WP"
+echo "CONFIG_FILE_FULL_PATH = $FROM_CONFIG_FILE_FULL_PATH"
+echo "DATABASE_NAME = $FROM_DATABASE_NAME"
+echo "DATABASE_USERNAME = $FROM_DATABASE_USERNAME"
+echo "DATABASE_PASSWORD = $FROM_DATABASE_PASSWORD"
+echo "==============================================================================="
+read -p "=== Press Enter to continue ==="
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+if [ ! -f "/home/$user/conf/web/ssl.$domain.ca" ]; then
+ /usr/local/vesta/bin/v-add-letsencrypt-domain "$user" "$domain" "www.$domain" "yes"
+fi
+if [ -f "/home/$user/conf/web/ssl.$domain.ca" ]; then
+ if [ -f "/usr/local/vesta/data/templates/web/nginx/force-https.stpl" ]; then
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$user" "$domain" "force-https" "jpeg,jpg,png,gif,bmp,ico,svg,tif,tiff,css,js,ttf,otf,webp,txt,csv,rtf,doc,docx,xls,xlsx,ppt,pptx,odf,odp,ods,odt,pdf,psd,ai,eot,eps,ps,zip,tar,tgz,gz,rar,bz2,7z,aac,m4a,mp3,mp4,ogg,wav,wma,3gp,avi,flv,m4v,mkv,mov,mpeg,mpg,wmv,exe,iso,dmg,swf,woff,woff2" "yes"
+ fi
+else
+ echo "Error: Can not generate SSL."
+ exit 9
+fi
+
+echo "=== Replacing $FROM_REPLACE1 to $TO_REPLACE1 in folder $TO_FOLDER"
+grep -rl "$FROM_DOMAIN" $SITE_FOLDER | xargs sed -i "s#$FROM_REPLACE1#$TO_REPLACE1#g"
+
+echo "=== Replacing $FROM_REPLACE2 to $TO_REPLACE2 in folder $TO_FOLDER"
+grep -rl "$FROM_DOMAIN" $SITE_FOLDER | xargs sed -i "s#$FROM_REPLACE2#$TO_REPLACE2#g"
+
+if [ $IT_IS_WP -eq 0 ]; then
+ echo "=== Replacing $FROM_REPLACE1 to $TO_REPLACE1 in database $FROM_DATABASE_NAME"
+ php /root/Search-Replace-DB/srdb.cli.php -h localhost -n "$FROM_DATABASE_NAME" -u "$FROM_DATABASE_USERNAME" -p "$FROM_DATABASE_PASSWORD" -s "$FROM_REPLACE1" -r "$TO_REPLACE1"
+ echo "=== Replacing $FROM_REPLACE2 to $TO_REPLACE2 in database $FROM_DATABASE_NAME"
+ php /root/Search-Replace-DB/srdb.cli.php -h localhost -n "$FROM_DATABASE_NAME" -u "$FROM_DATABASE_USERNAME" -p "$FROM_DATABASE_PASSWORD" -s "$FROM_REPLACE2" -r "$TO_REPLACE2"
+else
+ cd $SITE_FOLDER
+ echo "=== Replacing $FROM_REPLACE1 to $TO_REPLACE1 in database $FROM_DATABASE_NAME"
+ /usr/local/vesta/bin/v-run-wp-cli $FROM_DOMAIN search-replace "$FROM_REPLACE1" "$TO_REPLACE1" --precise --all-tables --skip-columns=guid --skip-plugins --skip-themes;
+ echo "=== Replacing $FROM_REPLACE2 to $TO_REPLACE2 in database $FROM_DATABASE_NAME"
+ /usr/local/vesta/bin/v-run-wp-cli $FROM_DOMAIN search-replace "$FROM_REPLACE2" "$TO_REPLACE2" --precise --all-tables --skip-columns=guid --skip-plugins --skip-themes;
+fi
+
+echo "===== DONE ===="
+echo "You can visit $TO_REPLACE1"
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-move-domain-and-database-to-account b/bin/v-move-domain-and-database-to-account
new file mode 100644
index 00000000..383fd26e
--- /dev/null
+++ b/bin/v-move-domain-and-database-to-account
@@ -0,0 +1,147 @@
+#!/bin/bash
+# info: change domain and database owner
+# options: DOMAIN USER
+#
+# The function of changing domain and database ownership.
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Argument definition
+domain=$1
+user=$2
+
+# Importing system environment
+source /etc/profile
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'DOMAIN USER'
+is_format_valid 'domain' 'user'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+owner=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+if [ -z "$owner" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+if [ "$owner" = "$user" ]; then
+ exit
+fi
+
+USER_DATA=$VESTA/data/users/$owner
+is_object_unsuspended 'user' 'USER' "$owner"
+USER_DATA=$VESTA/data/users/$user
+
+USER_TO=$user
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+RET=$OK
+
+echo "================================="
+r=$(/usr/local/vesta/bin/v-get-database-credentials-of-domain $domain)
+echo $r
+eval $r
+echo "================================="
+
+if [ ! -z "$DATABASE_NAME" ]; then
+ echo "=== v-change-database-owner $DATABASE_NAME $USER_TO"
+ /usr/local/vesta/bin/v-change-database-owner $DATABASE_NAME $USER_TO
+ if [ $? -ne 0 ]; then
+ echo "=== v-change-database-owner failed"
+ RET=$E_NOTEXIST
+ fi
+
+ if [ ! -z "$DATABASE_USERNAME" ] && [ ! -z "$CONFIG_FILE_FULL_PATH" ]; then
+ replace_php_config_value "${DATABASE_NAME}" "${USER_TO}_${DATABASE_NAME_WITHOUT_USER_PREFIX}" "$CONFIG_FILE_FULL_PATH" "yes"
+ replace_php_config_value "${DATABASE_USERNAME}" "${USER_TO}_${DATABASE_USERNAME_WITHOUT_USER_PREFIX}" "$CONFIG_FILE_FULL_PATH" "yes"
+ else
+ if [ -z "$DATABASE_USERNAME" ]; then
+ echo "=== DATABASE_USERNAME is empty, so we will not change config file"
+ fi
+ if [ -z "$CONFIG_FILE_FULL_PATH" ]; then
+ echo "=== CONFIG_FILE_FULL_PATH is empty, so we will not change config file"
+ fi
+ fi
+else
+ echo "=== DATABASE_NAME is empty, so we will not move database"
+fi
+
+echo "=== v-change-domain-owner $domain $USER_TO"
+/usr/local/vesta/bin/v-change-domain-owner $domain $USER_TO
+if [ $? -ne 0 ]; then
+ echo "=== v-change-domain-owner failed"
+ RET=$E_NOTEXIST
+fi
+
+#----------------------------------------------------------#
+# Update Wordfence WAF Path #
+#----------------------------------------------------------#
+
+filepath="/home/USER_TO/web/$domain/public_html/.user.ini"
+filename=$(basename $filepath)
+
+# Check if file exists
+if [ -f "$filepath" ]; then
+ echo "Updating $filename with new user path..."
+
+ # Temporary file for modification
+ tmp_file=$(mktemp)
+
+ # Change path from old USER to new USER_TO
+ sed "s|/home/$owner/public_html|/home/$USER_TO/public_html|g" "$filepath" > "$tmp_file"
+
+ # Check if replacement was successful and update file
+ if [ $? -eq 0 ]; then
+ mv "$tmp_file" "$filepath"
+ echo "$filename updated successfully."
+ else
+ echo "Failed to update $filename file."
+ rm "$tmp_file" # Deletes temporary file
+ fi
+fi
+
+filepath="/home/USER_TO/web/$domain/public_html/wordfence-waf.php"
+filename=$(basename $filepath)
+
+# Check if file exists
+if [ -f "$filepath" ]; then
+ echo "Updating $filename with new user path..."
+
+ # Temporary file for modification
+ tmp_file=$(mktemp)
+
+ # Change path from old USER to new USER_TO
+ sed "s|/home/$owner/public_html|/home/$USER_TO/public_html|g" "$filepath" > "$tmp_file"
+
+ # Check if replacement was successful and update file
+ if [ $? -eq 0 ]; then
+ mv "$tmp_file" "$filepath"
+ echo "$filename updated successfully."
+ else
+ echo "Failed to update $filename file."
+ rm "$tmp_file" # Deletes temporary file
+ fi
+fi
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+log_event "$RET" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-move-folder-and-make-symlink b/bin/v-move-folder-and-make-symlink
new file mode 100644
index 00000000..ccd66b7c
--- /dev/null
+++ b/bin/v-move-folder-and-make-symlink
@@ -0,0 +1,114 @@
+#!/bin/bash
+
+# info:
+# This script will move a folder to the new destination and make a symlink from the old path to the new destination
+
+# options: FROMFOLDER TOFOLDER
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ] && [ "$whoami" != "admin" ] ; then
+ echo "You must be root or admin to execute this script";
+ exit 1;
+fi
+
+# Argument definition
+FROMFOLDER=$1
+TOFOLDER=$2
+
+echo "Executing: v-move-folder-and-make-symlink $1 $2"
+
+# Includes
+source $VESTA/func/main.sh
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+if [ -z "$FROMFOLDER" ]; then
+ echo "First parameter is empty, aborting"
+ exit 1
+fi
+
+if [ -z "$TOFOLDER" ]; then
+ echo "Second parameter is empty, aborting"
+ exit 1
+fi
+
+# Trimming the ending slash, just in case
+FROMFOLDER=$(echo "$FROMFOLDER" | sed 's:/*$::')
+TOFOLDER=$(echo "$TOFOLDER" | sed 's:/*$::')
+
+if [ ! -d "$FROMFOLDER" ]; then
+ echo "Folder $FROMFOLDER does not exists, aborting"
+ exit 1
+fi
+
+if [ -L "$FROMFOLDER" ]; then
+ echo "Folder $FROMFOLDER is already symlink, aborting"
+ exit 1
+fi
+
+if [ -d "$TOFOLDER" ]; then
+ echo "Folder $TOFOLDER already exists, aborting"
+ exit 1
+fi
+
+if [ -L "$TOFOLDER" ]; then
+ echo "Folder $TOFOLDER already exists (as symlink), aborting"
+ exit 1
+fi
+
+USER=$(stat -c '%U' "$FROMFOLDER")
+GROUP=$(stat -c '%G' "$FROMFOLDER")
+PARENTFOLDER=$(dirname "$TOFOLDER")
+
+if [ ! -d "$PARENTFOLDER" ]; then
+ PUSER=$(stat -c '%U' "$PARENTFOLDER")
+ PGROUP=$(stat -c '%G' "$PARENTFOLDER")
+ echo "= Creating parent folder..."
+ mkdir -p "$PARENTFOLDER"
+ chown $PUSER:$PGROUP "$PARENTFOLDER"
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+if [ "$FROMFOLDER" = "/home/$USER" ] && [ -d "$FROMFOLDER/conf" ]; then
+ # if we are moving myVesta home folder, we must remove immutable attribute from conf/ files
+ chattr -R -i "$FROMFOLDER/conf/" > /dev/null 2>&1
+ # with slashes on the end of the path of the folder
+fi
+
+# rsync -a "$FROMFOLDER/" "$TOFOLDER/"
+# with slashes on the end of the path of both folders
+
+mv "$FROMFOLDER" "$TOFOLDER"
+if [ "$?" -ne 0 ]; then
+ echo "Error happened, aborting"
+ exit 1
+fi
+
+rm -rf "$FROMFOLDER"
+# without slash on the end of the path of the folder
+
+ln -s "$TOFOLDER" "$FROMFOLDER"
+# without slashes on the end of the path of both folders
+
+chown -h $USER:$GROUP $FROMFOLDER
+# without slash on the end of the path of the folder
+
+#----------------------------------------------------------#
+# Log and print result #
+#----------------------------------------------------------#
+
+echo "Done, folder $FROMFOLDER moved to $TOFOLDER and symlinked"
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-normalize-restored-user b/bin/v-normalize-restored-user
index 86e1f0b8..91ef29c9 100644
--- a/bin/v-normalize-restored-user
+++ b/bin/v-normalize-restored-user
@@ -45,7 +45,7 @@ NEWNS2=${arrNS[1]}
for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
if [ -f "/usr/local/vesta/data/users/$user/dns/$domain.conf" ]; then
- NEWIPV4=$(v-list-dns-domain "$user" "$domain" | grep 'IP:' | awk '{print $2}')
+ NEWIPV4=$(/usr/local/vesta/bin/v-list-dns-domain "$user" "$domain" | grep 'IP:' | awk '{print $2}')
res=$(grep "'www'" /usr/local/vesta/data/users/$user/dns/$domain.conf)
eval $res
OLDIPV4=$VALUE
@@ -79,7 +79,7 @@ sed -i "s#$OLDIPV4#$NEWIPV4#g" /usr/local/vesta/data/users/$user/dns.conf
sed -i "s#$OLDNS1#$NEWNS1#g" /usr/local/vesta/data/users/$user/dns.conf
sed -i "s#$OLDNS1#$NEWNS1#g" /usr/local/vesta/data/users/$user/user.conf
sed -i "s#$OLDNS2#$NEWNS2#g" /usr/local/vesta/data/users/$user/user.conf
-service bind9 reload
+systemctl reload bind9
echo "Done!"
diff --git a/bin/v-php-func b/bin/v-php-func
new file mode 100644
index 00000000..925cc91e
--- /dev/null
+++ b/bin/v-php-func
@@ -0,0 +1,21 @@
+#!/bin/bash
+# info: calling myVesta PHP functions
+# options: FUNCTION
+#
+# The function is calling myVesta or standard PHP functions directly from bash
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+
+if [ "$1" == "--stdin" ] && [ -p /dev/stdin ]; then
+ STDIN=$(cat -)
+ if [ ! -z "$STDIN" ]; then
+ echo "$STDIN" | php /usr/local/vesta/func/bash-to-php-interpreter.php "$@"
+ exit $?
+ fi
+fi
+
+php /usr/local/vesta/func/bash-to-php-interpreter.php "$@"
+exit $?
diff --git a/bin/v-restart-dns b/bin/v-restart-dns
index 4e7712a7..f96937a1 100755
--- a/bin/v-restart-dns
+++ b/bin/v-restart-dns
@@ -55,9 +55,10 @@ if [ -z "$DNS_SYSTEM" ] || [ "$DNS_SYSTEM" = 'remote' ] ; then
fi
# Restart system
-service $DNS_SYSTEM reload >/dev/null 2>&1
+systemctl reset-failed $DNS_SYSTEM
+systemctl reload $DNS_SYSTEM >/dev/null 2>&1
if [ $? -ne 0 ]; then
- service $DNS_SYSTEM restart >/dev/null 2>&1
+ systemctl restart $DNS_SYSTEM >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
check_result $E_RESTART "$DNS_SYSTEM restart failed"
diff --git a/bin/v-restart-proxy b/bin/v-restart-proxy
old mode 100755
new mode 100644
diff --git a/bin/v-restart-web b/bin/v-restart-web
index ab1afe6c..2b17ad9f 100755
--- a/bin/v-restart-web
+++ b/bin/v-restart-web
@@ -64,7 +64,9 @@ fi
# Resart web system if reload didn't work
if [ "$rc" -ne 0 ]; then
- service $WEB_SYSTEM restart >/dev/null 2>&1
+ # service $WEB_SYSTEM restart >/dev/null 2>&1
+ systemctl reset-failed $WEB_SYSTEM
+ systemctl restart $WEB_SYSTEM >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
check_result $E_RESTART "$WEB_SYSTEM restart failed"
diff --git a/bin/v-restore-user b/bin/v-restore-user
index 4816fde8..a2dab574 100755
--- a/bin/v-restore-user
+++ b/bin/v-restore-user
@@ -28,6 +28,11 @@ if [ -z "$BACKUP" ]; then
BACKUP=/backup
fi
+# Allow to specify full path to backup file
+if [[ $backup == "/backup/"* ]]; then
+ backup="${backup:8}"
+fi
+
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
@@ -36,6 +41,10 @@ source $VESTA/func/db.sh
source $VESTA/func/rebuild.sh
source $VESTA/conf/vesta.conf
+if [ ! -z "$OVERRIDE_BACKUP_PATH" ]; then
+ BACKUP=$OVERRIDE_BACKUP_PATH
+fi
+
# Check backup ownership function
is_backup_available() {
passed=false
@@ -408,8 +417,9 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
# Restoring web domain data
chown $user $tmpdir
chmod u+w $HOMEDIR/$user/web/$domain
+ chmod 0755 $tmpdir/web/$domain
sudo -u $user tar -xzpf $tmpdir/web/$domain/domain_data.tar.gz \
- -C $HOMEDIR/$user/web/$domain/ --exclude=logs/* \
+ -C $HOMEDIR/$user/web/$domain/ --exclude=./logs/* \
2> $HOMEDIR/$user/web/$domain/restore_errors.log
if [ -e "$HOMEDIR/$user/web/$domain/restore_errors.log" ]; then
chown $user:$user $HOMEDIR/$user/web/$domain/restore_errors.log
@@ -431,6 +441,15 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
find $HOMEDIR/$user/web/$domain/ -user $old_uid \
-exec chown -h $user:$user {} \;
fi
+
+ # Restoring php-fpm pool.d conf files
+ if [ -d "$tmpdir/web/$domain/php" ]; then
+ fpmver=$(ls $tmpdir/web/$domain/php/)
+ cp -r $tmpdir/web/$domain/php/$fpmver/ /etc/php/
+ systemctl reset-failed php$fpmver-fpm
+ systemctl restart php$fpmver-fpm
+ fi
+
done
# Adding user to traff queue
@@ -458,7 +477,7 @@ if [ "$dns" != 'no' ] && [ ! -z "$DNS_SYSTEM" ]; then
if [ -z "$dns" ] || [ "$dns" = '*' ]; then
domains="$backup_domains"
else
- echo "$dns" |tr ',' '\n' > $tmpdir/selected.txt
+ echo "$dns" | tr ',' '\n' | sed -e "s/^/^/" > $tmpdir/selected.txt
domains=$(echo "$backup_domains" |egrep -f $tmpdir/selected.txt)
fi
@@ -538,7 +557,7 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
if [ -z "$mail" ] || [ "$mail" = '*' ]; then
domains="$backup_domains"
else
- echo "$mail" |tr ',' '\n' > $tmpdir/selected.txt
+ echo "$mail" | tr ',' '\n' | sed -e "s/^/^/" > $tmpdir/selected.txt
domains=$(echo "$backup_domains" |egrep -f $tmpdir/selected.txt)
fi
@@ -600,6 +619,7 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
if [ -e "$tmpdir/mail/$domain/accounts.tar.gz" ]; then
chown $user $tmpdir
chmod u+w $HOMEDIR/$user/mail/$domain_idn
+ chmod 0755 $tmpdir/mail/$domain
sudo -u $user tar -xzpf $tmpdir/mail/$domain/accounts.tar.gz \
-C $HOMEDIR/$user/mail/$domain_idn/
if [ "$?" -ne 0 ]; then
@@ -635,7 +655,7 @@ if [ "$db" != 'no' ] && [ ! -z "$DB_SYSTEM" ]; then
if [ -z "$db" ] || [ "$db" = '*' ]; then
databases="$backup_databases"
else
- echo "$db" |tr ',' '\n' > $tmpdir/selected.txt
+ echo "$db" |tr ',' '\n' | sed -e "s/$/$/" > $tmpdir/selected.txt
databases=$(echo "$backup_databases" |egrep -f $tmpdir/selected.txt)
fi
diff --git a/bin/v-run-wp-cli b/bin/v-run-wp-cli
new file mode 100644
index 00000000..b1e4e6aa
--- /dev/null
+++ b/bin/v-run-wp-cli
@@ -0,0 +1,146 @@
+#!/bin/bash
+# info: Run WP CLI command for a specific domain
+# options: DOMAIN WP_CLI_COMMAND
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+SILENT_MODE=1
+
+# Argument definition
+domain=$1
+wp_command=${@:2}
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/domain.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+VERBOSE_MODE=1
+
+check_args '2' "$#" 'DOMAIN WP_CLI_COMMAND'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+is_object_unsuspended 'web' 'DOMAIN' "$domain"
+
+if [ ! -d "/home/$user" ]; then
+ echo "= User doesn't exist";
+ exit 1;
+fi
+
+if [[ "$wp_command" != core\ download* ]] && [[ "$wp_command" != core\ config* ]] && [ ! -f "/home/$user/web/$domain/public_html/wp-config.php" ]; then
+ echo '= Please install WordPress first.'
+ exit 1;
+fi
+
+wpcli=""
+
+if [ ! -f "/usr/local/bin/wp" ]; then
+ echo "= WP CLI is not installed. Installing..."
+ /usr/local/vesta/bin/v-install-wp-cli
+fi
+
+if [ -z "$USE_WP_CLI_MYVESTA" ]; then
+ if [ -f "/usr/local/bin/wp" ]; then
+ # Get current time and file ctime in seconds since epoch
+ current_time=$(date +%s)
+ file_ctime=$(stat -c %Z /usr/local/bin/wp)
+ # Calculate age in days
+ age_days=$(( (current_time - file_ctime) / 86400 ))
+ if [ "$age_days" -gt 30 ]; then
+ echo "= The /usr/local/bin/wp file is older than 30 days (based on CTime)."
+ echo "= Updating WP CLI..."
+ /usr/local/vesta/bin/v-install-wp-cli
+ fi
+ fi
+fi
+
+if [ -t 1 ]; then
+ output='terminal'
+else
+ output='file'
+fi
+
+if [ -f "/usr/local/bin/wp" ]; then
+ wpcli="/usr/local/bin/wp"
+ WP_CLI_PACKAGES_DIR=""
+fi
+
+if [ ! -z "$USE_WP_CLI_MYVESTA" ] && [ -f "/usr/local/bin/wp-cli/php/boot-fs.php" ] && [ -d "/usr/local/bin/wp-cli/packages/vendor/wp-cli/search-replace-command" ] && [ "$output" == "terminal" ]; then
+ wpcli="/usr/local/bin/wp-cli/php/boot-fs.php"
+ COLUMNS=$(/usr/bin/env stty size 2>/dev/null | awk '{print $2}')
+ echo $COLUMNS > /usr/local/bin/wp-cli/COLUMNS
+ WP_CLI_PACKAGES_DIR="WP_CLI_PACKAGES_DIR=/usr/local/bin/wp-cli/packages"
+fi
+
+if [ -z "$wpcli" ]; then
+ echo "= WP CLI is not installed. Please install it manually."
+ exit 1;
+fi
+
+mkdir -p /home/$user/.wp-cli
+chown $user:$user /home/$user/.wp-cli
+
+if [ -z "$PHP" ]; then
+ phpver=$(/usr/local/vesta/bin/v-get-php-version-of-domain "$domain")
+else
+ phpver=$PHP
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+cd /home/$USER/web/$domain/public_html
+
+if [ -z "$OPEN_BASEDIR" ]; then
+ OPEN_BASEDIR="/home/$user/web/$domain:/home/$user/.wp-cli:/home/$user/tmp:/usr/local/bin:/tmp"
+fi
+
+if [ -z "$DISABLE_FUNCTIONS" ]; then
+ DISABLE_FUNCTIONS="pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,exec,system,passthru,shell_exec,proc_open,popen"
+fi
+
+if [ -z "$SHOW_ERRORS" ]; then
+ sudo -u $USER $WP_CLI_PACKAGES_DIR /usr/bin/php$phpver -d disable_functions=$DISABLE_FUNCTIONS -d open_basedir=$OPEN_BASEDIR $wpcli --path=/home/$user/web/$domain/public_html/ $wp_command 2>/home/$user/web/$domain/wp-cli-error.log
+else
+ sudo -u $USER $WP_CLI_PACKAGES_DIR /usr/bin/php$phpver -d disable_functions=$DISABLE_FUNCTIONS -d open_basedir=$OPEN_BASEDIR $wpcli --path=/home/$user/web/$domain/public_html/ $wp_command
+fi
+
+return_code=$?
+
+if [ -f "/usr/local/bin/wp-cli/COLUMNS" ]; then
+ rm /usr/local/bin/wp-cli/COLUMNS
+fi
+
+if [ -z "$SHOW_ERRORS" ]; then
+ if grep -q "PHP Fatal error" /home/$user/web/$domain/wp-cli-error.log || [ $return_code -ne 0 ]; then
+ cat /home/$user/web/$domain/wp-cli-error.log
+ fi
+fi
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit $return_code;
diff --git a/bin/v-run-wp-cli-myvesta b/bin/v-run-wp-cli-myvesta
new file mode 100644
index 00000000..5947edfa
--- /dev/null
+++ b/bin/v-run-wp-cli-myvesta
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if [ ! -f "/usr/local/bin/wp-cli/php/boot-fs.php" ]; then
+ echo "= myVesta WP CLI is not installed. Installing..."
+ /usr/local/vesta/bin/v-install-wp-cli-myvesta
+fi
+
+if [ -f "/usr/local/bin/wp-cli/php/boot-fs.php" ]; then
+ # Get current time and file ctime in seconds since epoch
+ current_time=$(date +%s)
+ file_ctime=$(stat -c %Z /usr/local/bin/wp-cli/php/boot-fs.php)
+ # Calculate age in days
+ age_days=$(( (current_time - file_ctime) / 86400 ))
+ if [ "$age_days" -gt 30 ]; then
+ echo "= The /usr/local/bin/wp-cli/php/boot-fs.php file is older than 30 days (based on CTime)."
+ echo "= Updating myVesta WP CLI..."
+ /usr/local/vesta/bin/v-install-wp-cli-myvesta
+ fi
+fi
+
+USE_WP_CLI_MYVESTA=1 /usr/local/vesta/bin/v-run-wp-cli "$@"
diff --git a/bin/v-search-domain-owner b/bin/v-search-domain-owner
index 5b88f495..f807ebd2 100755
--- a/bin/v-search-domain-owner
+++ b/bin/v-search-domain-owner
@@ -9,6 +9,8 @@
# Variable&Function #
#----------------------------------------------------------#
+SILENT_MODE=1
+
# Argument definition
domain=$(idn -t --quiet -u "$1" )
type=${2-any}
diff --git a/bin/v-sed b/bin/v-sed
new file mode 100644
index 00000000..16e8ad2b
--- /dev/null
+++ b/bin/v-sed
@@ -0,0 +1,27 @@
+#!/bin/bash
+# info: calling myvesta_sed PHP function
+# options: PARAMETERS
+#
+# The function is calling myVesta PHP replacement for GNU 'sed' command (but without regular expression)
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+
+if [ "$1" == "--stdin" ] && [ -p /dev/stdin ]; then
+ STDIN=$(cat -)
+ if [ ! -z "$STDIN" ]; then
+ shift;
+ echo "$STDIN" | php /usr/local/vesta/func/bash-to-php-interpreter.php '--stdin' 'myvesta_sed' "$@"
+ exit $?
+ fi
+fi
+
+if [ "$1" == "--stdin" ]; then
+ shift;
+ php /usr/local/vesta/func/bash-to-php-interpreter.php '--stdin' 'myvesta_sed' "$@"
+else
+ php /usr/local/vesta/func/bash-to-php-interpreter.php 'myvesta_sed' "$@"
+fi
+exit $?
diff --git a/bin/v-suspend-firewall-rule b/bin/v-suspend-firewall-rule
index 67f14cec..9191fed0 100755
--- a/bin/v-suspend-firewall-rule
+++ b/bin/v-suspend-firewall-rule
@@ -32,12 +32,21 @@ is_object_unsuspended '../../data/firewall/rules' 'RULE' "$rule"
# Action #
#----------------------------------------------------------#
+oldvalues=$(grep "RULE='$rule'" $VESTA/data/firewall/rules.conf)
+
# Suspending rule
update_object_value ../../data/firewall/rules RULE $rule '$SUSPENDED' yes
# Updating system firewall
$BIN/v-update-firewall
+if [ "$WEB_SYSTEM" == 'nginx' ] || [ "$PROXY_SYSTEM" == 'nginx' ]; then
+ parse_object_kv_list_non_eval "$oldvalues"
+ if [ "$PORT" == "80,443" ] && [ "$ACTION" == "DROP" ]; then
+ sed -i "\#$IP#d" /etc/nginx/conf.d/block-firewall.conf
+ systemctl restart nginx
+ fi
+fi
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-suspend-web-domain b/bin/v-suspend-web-domain
index 7bd658ce..c9120122 100755
--- a/bin/v-suspend-web-domain
+++ b/bin/v-suspend-web-domain
@@ -17,6 +17,10 @@ domain=$2
domain_idn=$2
restart=$3
+if [ -z "$restart" ]; then
+ restart='yes'
+fi
+
# Includes
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
@@ -80,12 +84,14 @@ fi
update_object_value 'web' 'DOMAIN' "$domain" '$SUSPENDED' 'yes'
increase_user_value "$user" '$SUSPENDED_WEB'
-# Restarting web server
-$BIN/v-restart-web $restart
-check_result $? "Web restart failed" >/dev/null
-
-$BIN/v-restart-proxy $restart
-check_result $? "Proxy restart failed" >/dev/null
+if [ "$restart" = "yes" ]; then
+ # Restarting web server
+ $BIN/v-restart-web $restart
+ check_result $? "Web restart failed" >/dev/null
+
+ $BIN/v-restart-proxy $restart
+ check_result $? "Proxy restart failed" >/dev/null
+fi
# Logging
log_event "$OK" "$ARGUMENTS"
diff --git a/bin/v-unlock-wordpress b/bin/v-unlock-wordpress
new file mode 100644
index 00000000..4a2c42c3
--- /dev/null
+++ b/bin/v-unlock-wordpress
@@ -0,0 +1,71 @@
+#!/bin/bash
+# info: Unlock previously locked WordPress files if they were potentially infected (somewhere) by PHP malware
+# options: DOMAIN
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Argument definition
+domain=$1
+
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+USER=$user
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+if [ -z "$user" ]; then
+ check_result $E_NOTEXIST "domain $domain doesn't exist"
+fi
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '1' "$#" 'DOMAIN'
+is_format_valid 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+if [ ! -d "/home/$user" ]; then
+ echo "User doesn't exist";
+ exit 1;
+fi
+
+if [ ! -d "/home/$user/web/$domain/public_html" ]; then
+ echo "Domain doesn't exist";
+ exit 1;
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+cd /home/$user/web/$domain
+
+# lock files
+chown -R $user:$user public_html/
+
+rm public_html/wp-content/uploads/.htaccess
+
+/usr/local/vesta/bin/v-fix-website-permissions $domain
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+echo "v-unlock-wordpress: Done."
+
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-unsuspend-firewall-rule b/bin/v-unsuspend-firewall-rule
index be6320d4..f0e00c96 100755
--- a/bin/v-unsuspend-firewall-rule
+++ b/bin/v-unsuspend-firewall-rule
@@ -32,12 +32,25 @@ is_object_suspended '../../data/firewall/rules' 'RULE' "$rule"
# Action #
#----------------------------------------------------------#
+oldvalues=$(grep "RULE='$rule'" $VESTA/data/firewall/rules.conf)
+
# Suspending rule
update_object_value ../../data/firewall/rules RULE $rule '$SUSPENDED' no
# Updating system firewall
$BIN/v-update-firewall
+if [ "$WEB_SYSTEM" == 'nginx' ] || [ "$PROXY_SYSTEM" == 'nginx' ]; then
+ parse_object_kv_list_non_eval "$oldvalues"
+ if [ "$PORT" == "80,443" ] && [ "$ACTION" == "DROP" ]; then
+ touch /etc/nginx/conf.d/block-firewall.conf
+ if ! grep -q "deny $IP;" /etc/nginx/conf.d/block-firewall.conf; then
+ echo "deny $IP;" >> /etc/nginx/conf.d/block-firewall.conf
+ systemctl restart nginx
+ fi
+ fi
+fi
+
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-update-dns-templates b/bin/v-update-dns-templates
index 31361d00..8b128a3d 100755
--- a/bin/v-update-dns-templates
+++ b/bin/v-update-dns-templates
@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
tmpdir=$(mktemp -d --dry-run)
mkdir $tmpdir
cd $tmpdir
-wget http://c.vestacp.com/rhel/7/templates.tar.gz -q
+wget https://c.myvestacp.com/debian/10/templates.tar.gz -q
if [ "$?" -ne 0 ]; then
echo "Error: can't download template.tar.gz"
log_event "$E_CONNECT" "$ARGUMENTS"
diff --git a/bin/v-update-document-errors-files b/bin/v-update-document-errors-files
new file mode 100644
index 00000000..c044a80a
--- /dev/null
+++ b/bin/v-update-document-errors-files
@@ -0,0 +1,48 @@
+#!/bin/bash
+# info: fix website permissions for all websites
+# options:
+#
+# The command is used for fixing website permissions for all websites on the server.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Importing system variables
+source /etc/profile
+
+# Includes
+source $VESTA/func/main.sh
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
+ if [ ! -f "/usr/local/vesta/data/users/$user/user.conf" ]; then
+ continue;
+ fi
+
+ for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
+ cp /usr/local/vesta/data/templates/web/skel/document_errors/403.html /home/$user/web/$domain/document_errors/403.html
+ cp /usr/local/vesta/data/templates/web/skel/document_errors/404.html /home/$user/web/$domain/document_errors/404.html
+ cp /usr/local/vesta/data/templates/web/skel/document_errors/50x.html /home/$user/web/$domain/document_errors/50x.html
+ sed -i "s/%domain%/$domain/g" /home/$user/web/$domain/document_errors/403.html
+ sed -i "s/%domain%/$domain/g" /home/$user/web/$domain/document_errors/404.html
+ sed -i "s/%domain%/$domain/g" /home/$user/web/$domain/document_errors/50x.html
+ chown $user:$user /home/$user/web/$domain/document_errors/*
+ chmod 644 /home/$user/web/$domain/document_errors/*
+ done
+
+done
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Logging
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-update-firewall b/bin/v-update-firewall
index d2d06355..6d359f07 100755
--- a/bin/v-update-firewall
+++ b/bin/v-update-firewall
@@ -52,6 +52,13 @@ if [ $? -ne 0 ]; then
fi
+# Checking custom OpenSSH port
+# Taken from HestiaCP
+sshport=$(grep '^Port ' /etc/ssh/sshd_config | head -1 | cut -d ' ' -f 2)
+if [[ "$sshport" =~ ^[0-9]+$ ]] && [ "$sshport" -ne "22" ]; then
+ sed -i "s/PORT='22'/PORT=\'$sshport\'/" $rules
+fi
+
# Creating temporary file
tmp=$(mktemp)
@@ -60,7 +67,7 @@ echo "$iptables -P INPUT ACCEPT" >> $tmp
echo "$iptables -F INPUT" >> $tmp
# Enabling stateful support
-if [ "$conntrack" != 'no' ]; then
+if [ "$FIREWALL_STATEFUL" == "yes" ] || [ "$conntrack" != 'no' ] || grep --quiet container=lxc /proc/1/environ; then
str="$iptables -A INPUT -m state"
str="$str --state ESTABLISHED,RELATED -j ACCEPT"
echo "$str" >> $tmp
@@ -157,12 +164,12 @@ if [ ! -z "$FIREWALL_EXTENSION" ]; then
fi
# Saving rules to the master iptables file
-if [ -d "/etc/sysconfig" ]; then
- /sbin/iptables-save > /etc/sysconfig/iptables
- if [ -z "$(ls /etc/rc3.d/S*iptables 2>/dev/null)" ]; then
- /sbin/chkconfig iptables on
- fi
-else
+# if [ -d "/etc/sysconfig" ]; then
+# /sbin/iptables-save > /etc/sysconfig/iptables
+# if [ -z "$(ls /etc/rc3.d/S*iptables 2>/dev/null)" ]; then
+# /sbin/chkconfig iptables on
+# fi
+# else
/sbin/iptables-save > /etc/iptables.rules
preup="/etc/network/if-pre-up.d/iptables"
if [ ! -e "$preup" ]; then
@@ -171,7 +178,7 @@ else
echo "exit 0" >> $preup
chmod +x $preup
fi
-fi
+# fi
# Worarkound for OpenVZ
if [ -e "/proc/vz/veinfo" ]; then
diff --git a/bin/v-update-host-certificate b/bin/v-update-host-certificate
index 71a87709..9da49aca 100755
--- a/bin/v-update-host-certificate
+++ b/bin/v-update-host-certificate
@@ -11,12 +11,11 @@
#----------------------------------------------------------#
whoami=$(whoami)
-if [ "$whoami" != "root" ] && [ "$whoami" != "admin" ] ; then
- echo "You must be root or admin to execute this script";
- exit 1;
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
fi
-
# Argument definition
user=$1
hostname=$2
diff --git a/bin/v-update-letsencrypt-ssl b/bin/v-update-letsencrypt-ssl
index 36d7a1e9..819e9846 100755
--- a/bin/v-update-letsencrypt-ssl
+++ b/bin/v-update-letsencrypt-ssl
@@ -23,6 +23,9 @@ source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
lecounter=0
+hostname=$(hostname)
+
+echo "[$(date)] : -----------------------------------------------------------------------------------" >> /usr/local/vesta/log/letsencrypt_cron.log
# Checking user certificates
for user in $($BIN/v-list-users plain |cut -f 1); do
@@ -30,9 +33,28 @@ for user in $($BIN/v-list-users plain |cut -f 1); do
for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
+ limit_check=1
fail_counter=$(get_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT')
- if [[ "$fail_counter" -ge 7 ]]; then
- echo "$domain failed $fail_counter times for LetsEncrypt renewing, skipping"
+
+ # proxy_tpl=$(/usr/local/vesta/bin/v-list-web-domain "$user" "$domain" "shell" | grep 'PROXY:' | cut -d ' ' -f11-)
+ # if [ "$proxy_tpl" = "forward" ]; then
+ # echo "[$(date)] : $domain is using forward proxy, skipping" >> /usr/local/vesta/log/letsencrypt_cron.log
+ # continue;
+ # fi
+
+ if [[ "$hostname" = "$domain" ]]; then
+ if [[ "$fail_counter" -eq 7 ]]; then
+ limit_check=0
+ fi
+ if [[ "$fail_counter" -eq 8 ]]; then
+ fail_counter=$(alter_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT')
+ send_email_to_admin "LetsEncrypt renewing hostname $hostname" "Warning: hostname $domain failed for LetsEncrypt renewing"
+ fi
+ fi
+
+ if [[ "$fail_counter" -ge 7 ]] && [[ "$limit_check" -eq 1 ]]; then
+ # echo "$domain failed $fail_counter times for LetsEncrypt renewing, skipping"
+ echo "[$(date)] : $domain failed $fail_counter times for LetsEncrypt renewing, skipping" >> /usr/local/vesta/log/letsencrypt_cron.log
continue;
fi
crt_data=$(openssl x509 -text -in $USER_DATA/ssl/$domain.crt)
@@ -53,11 +75,13 @@ for user in $($BIN/v-list-users plain |cut -f 1); do
aliases=$(echo "$aliases" |sed -e ':a;N;$!ba;s/\n/,/g')
msg=$($BIN/v-add-letsencrypt-domain $user $domain $aliases)
if [ $? -ne 0 ]; then
- echo "$domain $msg"
if [[ $msg == *"is suspended" ]]; then
- echo "OK, it's suspended"
+ echo "[$(date)] : SUSPENDED: $domain $msg" >> /usr/local/vesta/log/letsencrypt_cron.log
else
+ echo "[$(date)] : $domain $msg" >> /usr/local/vesta/log/letsencrypt_cron.log
+ echo "$domain $msg"
fail_counter=$(alter_web_counter "$user" "$domain" 'LETSENCRYPT_FAIL_COUNT')
+ echo "[$(date)] : fail_counter = $fail_counter" >> /usr/local/vesta/log/letsencrypt_cron.log
echo "fail_counter = $fail_counter"
fi
fi
diff --git a/bin/v-update-mail-domain-disk b/bin/v-update-mail-domain-disk
index 451dbd37..be5502e7 100755
--- a/bin/v-update-mail-domain-disk
+++ b/bin/v-update-mail-domain-disk
@@ -49,7 +49,8 @@ dom_diks=0
for account in $(search_objects "mail/$domain" 'SUSPENDED' "no" 'ACCOUNT'); do
home_dir=$HOMEDIR/$user/mail/$domain/$account
if [ -e "$home_dir" ]; then
- udisk=$(nice -n 19 du -shm $home_dir | cut -f 1 )
+ cd $home_dir
+ udisk=$(nice -n 19 du -shm ./ | cut -f 1 )
else
udisk=0
fi
diff --git a/bin/v-update-mail-domains-disk b/bin/v-update-mail-domains-disk
index ca93627f..807218e3 100755
--- a/bin/v-update-mail-domains-disk
+++ b/bin/v-update-mail-domains-disk
@@ -35,13 +35,14 @@ fi
#----------------------------------------------------------#
# Starting loop
-for domain in $(search_objects 'mail' 'SUSPENDED' "no" 'DOMAIN'); do
+for domain in $(list_objects 'mail' 'DOMAIN'); do
dom_diks=0
- accounts=$(search_objects "mail/$domain" 'SUSPENDED' "no" 'ACCOUNT')
+ accounts=$(list_objects "mail/$domain" 'ACCOUNT')
for account in $accounts; do
home_dir=$HOMEDIR/$user/mail/$domain/$account
if [ -e "$home_dir" ]; then
- udisk=$(nice -n 19 du -shm $home_dir | cut -f 1 )
+ cd $home_dir
+ udisk=$(nice -n 19 du -shm ./ | cut -f 1 )
else
udisk=0
fi
diff --git a/bin/v-update-myvesta b/bin/v-update-myvesta
new file mode 100644
index 00000000..c3eaf337
--- /dev/null
+++ b/bin/v-update-myvesta
@@ -0,0 +1,36 @@
+#!/bin/bash
+# info: Get the very latest build of myVesta
+# options: NONE
+#
+# The function is downloading the very latest build of myVesta
+
+#----------------------------------------------------------#
+# Verifications & Variable & Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Includes
+source /usr/local/vesta/func/main.sh
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+rm /var/cache/apt/archives/vesta_* > /dev/null 2>&1
+apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" > /usr/local/vesta/log/update-$package.log 2>&1
+apt-get install --reinstall vesta
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+echo "=== myVesta updated ==="
+
+log_event "$OK" "$ARGUMENTS"
+
+exit
diff --git a/bin/v-update-sys-ip b/bin/v-update-sys-ip
index 6c07edc6..0186a394 100755
--- a/bin/v-update-sys-ip
+++ b/bin/v-update-sys-ip
@@ -110,7 +110,7 @@ for ip in $ips; do
done
# Updating NAT
-pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
+pub_ip=$(curl -4 -s https://scripts.myvestacp.com/ip.php)
if [ ! -e "$VESTA/data/ips/$pub_ip" ]; then
if [ -z "$(grep -R "$pub_ip" $VESTA/data/ips/)" ]; then
ip=$(ls -t $VESTA/data/ips/ |head -n1)
diff --git a/bin/v-update-sys-rrd-la b/bin/v-update-sys-rrd-la
index c8266626..860bdec6 100755
--- a/bin/v-update-sys-rrd-la
+++ b/bin/v-update-sys-rrd-la
@@ -74,7 +74,7 @@ rrdtool graph $RRD/la/$period-la.png \
-c "SHADEA#ffffff" \
-c "SHADEB#ffffff" \
-c "FONT#555555" \
- -c "CANVAS#302c2d" \
+ -c "CANVAS#F2F2F2" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
-c "FRAME#777777" \
@@ -82,7 +82,7 @@ rrdtool graph $RRD/la/$period-la.png \
DEF:la=$RRD/la/la.rrd:LA:AVERAGE \
DEF:pr=$RRD/la/la.rrd:PR:AVERAGE \
COMMENT:'\r' \
- AREA:la#C8EA2E:"LA * 100"\
+ AREA:la#00CD2E:"LA * 100"\
GPRINT:la:'LAST: Current\:''%8.0lf' \
GPRINT:la:'MIN: Min\:''%8.0lf' \
GPRINT:la:'MAX: Max\:''%8.0lf\j' \
diff --git a/bin/v-update-sys-rrd-net b/bin/v-update-sys-rrd-net
index e9c642e4..d59eefd9 100755
--- a/bin/v-update-sys-rrd-net
+++ b/bin/v-update-sys-rrd-net
@@ -35,13 +35,15 @@ if [ ! -d "$RRD/net" ]; then
mkdir $RRD/net
fi
+find $RRD/net -name "veth*" -delete
+
# Parsing network interfaces
ndev=$(cat /proc/net/dev)
ifaces=$(echo "$ndev" |grep : |cut -f 1 -d : | sed "s/ //g")
# Parsing excludes
if [ -z "$RRD_IFACE_EXCLUDE" ]; then
- RRD_IFACE_EXCLUDE='lo'
+ RRD_IFACE_EXCLUDE='lo,'
fi
for exclude in $(echo ${RRD_IFACE_EXCLUDE//,/ }); do
ifaces=$(echo "$ifaces" |grep -vw "$exclude" )
@@ -62,6 +64,8 @@ for iface in $ifaces; do
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797
+ else
+ touch $RRD/net/$iface.rrd
fi
# Parsing device stats
@@ -112,6 +116,8 @@ for iface in $ifaces; do
done
+find $RRD/net -name "*.png" -mtime +1 -delete
+find $RRD/net -name "*.rrd" -mtime +1 -delete
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-update-sys-vesta b/bin/v-update-sys-vesta
index d8df2aae..8db9242d 100755
--- a/bin/v-update-sys-vesta
+++ b/bin/v-update-sys-vesta
@@ -28,6 +28,23 @@ source $VESTA/conf/vesta.conf
# Checking arg number
check_args '1' "$#" 'PACKAGE'
+valid=0
+if [ "$package" = "vesta" ]; then
+ valid=1
+fi
+if [ "$package" = "vesta-nginx" ]; then
+ valid=1
+fi
+if [ "$package" = "vesta-php" ]; then
+ valid=1
+fi
+if [ "$package" = "vesta-softaculous" ]; then
+ valid=1
+fi
+if [ $valid -eq 0 ]; then
+ echo "Package $package is not valid"
+ exit 1
+fi
#----------------------------------------------------------#
# Action #
@@ -45,11 +62,10 @@ if [ -n "$(command -v yum)" ]; then
check_result $? "$package update failed" $E_UPDATE
else
# Update repo
- apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" \
- -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -qq
+ apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" > /usr/local/vesta/log/update-$package.log 2>&1
# Update vesta package
- apt-get -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confmiss" install $package > /dev/null 2>&1
+ apt-get -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confmiss" install $package >> /usr/local/vesta/log/update-$package.log 2>&1
check_result $? "$package update failed" $E_UPDATE
fi
diff --git a/bin/v-update-sys-vesta-all b/bin/v-update-sys-vesta-all
index 5a42a0c0..cd3e677f 100755
--- a/bin/v-update-sys-vesta-all
+++ b/bin/v-update-sys-vesta-all
@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
# Checking official latest version
-latest=$(wget -q -T 10 -t 1 http://c.myvestacp.com/latest.txt?check_latest -O -)
+latest=$(wget -q -T 10 -t 1 http://c.myvestacp.com/latest.txt?check_latest_version -O -)
# Starting update loop
for package in vesta vesta-nginx vesta-php; do
diff --git a/bin/v-update-web-domain-disk b/bin/v-update-web-domain-disk
index ac851b92..1bee4685 100755
--- a/bin/v-update-web-domain-disk
+++ b/bin/v-update-web-domain-disk
@@ -50,6 +50,14 @@ if [ -e "$home_dir" ]; then
disk_usage=$(nice -n 19 du -shm $home_dir | cut -f 1 )
fi
+# Defining hdd home directory
+home_dir="/hdd$HOMEDIR/$user/web/$domain/"
+
+# Checking home directory exist
+if [ -e "$home_dir" ] && [[ ! -L "$home_dir" ]]; then
+ disk_usage2=$(nice -n 19 du -shm $home_dir | cut -f 1 )
+ disk_usage=$(( disk_usage + disk_usage2 ))
+fi
#----------------------------------------------------------#
# Vesta #
diff --git a/bin/v-update-web-domains-disk b/bin/v-update-web-domains-disk
index 5951f289..5ee58abf 100755
--- a/bin/v-update-web-domains-disk
+++ b/bin/v-update-web-domains-disk
@@ -32,11 +32,16 @@ is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Domain loop
-for domain in $(search_objects 'web' 'SUSPENDED' "no" 'DOMAIN'); do
+for domain in $(list_objects 'web' 'DOMAIN'); do
home_dir="$HOMEDIR/$user/web/$domain/"
if [ -e "$home_dir" ]; then
disk_usage=$(nice -n 19 du -shm $home_dir | cut -f 1 )
fi
+ home_dir="/hdd$HOMEDIR/$user/web/$domain/"
+ if [ -e "$home_dir" ] && [[ ! -L "$home_dir" ]]; then
+ disk_usage2=$(nice -n 19 du -shm $home_dir | cut -f 1 )
+ disk_usage=$(( disk_usage + disk_usage2 ))
+ fi
update_object_value 'web' 'DOMAIN' "$domain" '$U_DISK' "$disk_usage"
done
diff --git a/bin/v-whitelist-email-account b/bin/v-whitelist-email-account
new file mode 100644
index 00000000..4a6e6329
--- /dev/null
+++ b/bin/v-whitelist-email-account
@@ -0,0 +1,119 @@
+#!/bin/bash
+# info: Add a specific email address to SpamAssassin whitelist
+# usage: v-whitelist-email-account EMAIL
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Determine Debian version and set SpamAssassin service name
+release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+if [ "$release" -lt 12 ]; then
+ SPAMD_SERVICE="spamassassin.service"
+else
+ SPAMD_SERVICE="spamd.service"
+fi
+
+SPAMASSASSIN_FILE="/etc/spamassassin/local.cf"
+
+# Flags to track changes
+SPAMASSASSIN_CHANGED=false
+
+# Function to check if an entry already exists in a file
+check_entry_exists() {
+ local entry=$1
+ local file=$2
+ grep -qF "$entry" "$file"
+}
+
+# Function to check if a domain/email is already blacklisted
+check_blacklisted() {
+ local pattern=$1
+ local file=$2
+ grep -qE "blacklist_from.*${pattern}" "$file"
+}
+
+# Function to add an entry to a file
+add_entry_to_file() {
+ local entry=$1
+ local file=$2
+ echo "$entry" >> "$file"
+}
+
+# Display usage if no arguments are provided
+if [ $# -lt 1 ]; then
+ echo "Usage: v-whitelist-email-account EMAIL"
+ exit 1
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+EMAIL=$1
+
+# Validate email format
+if [[ ! "$EMAIL" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then
+ echo "Invalid email address format."
+ exit 1
+fi
+
+# Extract the domain from the email address
+DOMAIN=$(echo "$EMAIL" | awk -F '@' '{print $2}')
+
+# Prepare entries for SpamAssassin
+WHITELIST_ENTRY="whitelist_from $EMAIL"
+BLACKLIST_ENTRY_MAIN="*@${DOMAIN}"
+BLACKLIST_ENTRY_SUB="*.$DOMAIN"
+
+#----------------------------------------------------------#
+# SpamAssassin Whitelist #
+#----------------------------------------------------------#
+
+echo "Updating $SPAMASSASSIN_FILE..."
+
+# Check if the email address or its domain is already blacklisted
+if check_blacklisted "$EMAIL" "$SPAMASSASSIN_FILE"; then
+ echo "Cannot whitelist $EMAIL. It is already blacklisted."
+ exit 1
+fi
+
+if check_blacklisted "$BLACKLIST_ENTRY_MAIN" "$SPAMASSASSIN_FILE"; then
+ echo "Cannot whitelist $EMAIL. The domain $DOMAIN is already blacklisted."
+ exit 1
+fi
+
+if check_blacklisted "$BLACKLIST_ENTRY_SUB" "$SPAMASSASSIN_FILE"; then
+ echo "Cannot whitelist $EMAIL. The subdomain of $DOMAIN is already blacklisted."
+ exit 1
+fi
+
+# Add the email to whitelist if not already present
+if ! check_entry_exists "$WHITELIST_ENTRY" "$SPAMASSASSIN_FILE"; then
+ add_entry_to_file "$WHITELIST_ENTRY" "$SPAMASSASSIN_FILE"
+ echo "Added $WHITELIST_ENTRY to $SPAMASSASSIN_FILE."
+ SPAMASSASSIN_CHANGED=true
+else
+ echo "$WHITELIST_ENTRY already exists in $SPAMASSASSIN_FILE."
+fi
+
+# Restart SpamAssassin only if changes were made
+if [ "$SPAMASSASSIN_CHANGED" == "true" ]; then
+ systemctl restart "$SPAMD_SERVICE"
+ echo "SpamAssassin service ($SPAMD_SERVICE) restarted."
+fi
+
+#----------------------------------------------------------#
+# Done #
+#----------------------------------------------------------#
+
+exit 0
diff --git a/bin/v-whitelist-email-domain b/bin/v-whitelist-email-domain
new file mode 100644
index 00000000..9d877ad4
--- /dev/null
+++ b/bin/v-whitelist-email-domain
@@ -0,0 +1,119 @@
+#!/bin/bash
+# info: Add a domain to SpamAssassin whitelist
+# usage: v-whitelist-email-domain DOMAIN SUBDOMAIN(YES/NO)
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+whoami=$(whoami)
+if [ "$whoami" != "root" ]; then
+ echo "You must be root to execute this script"
+ exit 1
+fi
+
+# Importing system environment
+source /etc/profile
+
+# Determine Debian version and set SpamAssassin service name
+release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
+if [ "$release" -lt 12 ]; then
+ SPAMD_SERVICE="spamassassin.service"
+else
+ SPAMD_SERVICE="spamd.service"
+fi
+
+SPAMASSASSIN_FILE="/etc/spamassassin/local.cf"
+
+# Flags to track changes
+SPAMASSASSIN_CHANGED=false
+
+# Function to check if a SpamAssassin whitelist entry already exists
+check_whitelist_exists() {
+ local entry=$1
+ local file=$2
+ grep -qF "whitelist_from $entry" "$file"
+}
+
+# Function to check if a domain/email is already blacklisted
+check_blacklist_exists() {
+ local domain=$1
+ local file=$2
+ grep -qE "blacklist_from.*${domain}$" "$file"
+}
+
+# Function to add whitelist entry to file
+add_whitelist_to_file() {
+ local entry=$1
+ local file=$2
+ echo "whitelist_from $entry" >> "$file"
+}
+
+# Display usage if no arguments are provided
+if [ $# -lt 2 ]; then
+ echo "Usage: v-whitelist-email-domain DOMAIN SUBDOMAIN(YES/NO)"
+ exit 1
+fi
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+DOMAIN=$1
+SUBDOMAIN=${2^^} # Convert to uppercase for consistency (YES/NO)
+
+# Validate SUBDOMAIN parameter
+if [[ "$SUBDOMAIN" != "YES" && "$SUBDOMAIN" != "NO" ]]; then
+ echo "Invalid parameter for SUBDOMAIN. Use YES or NO."
+ exit 1
+fi
+
+# Prepare entries for SpamAssassin
+WHITELIST_ENTRY_MAIN="*@${DOMAIN}"
+WHITELIST_ENTRY_SUB="*.$DOMAIN"
+BLACKLIST_ENTRY_MAIN="*@${DOMAIN}"
+BLACKLIST_ENTRY_SUB="*.$DOMAIN"
+
+#----------------------------------------------------------#
+# SpamAssassin Whitelist #
+#----------------------------------------------------------#
+
+echo "Updating $SPAMASSASSIN_FILE..."
+
+# Check if the domain is already blacklisted
+if check_blacklist_exists "$DOMAIN" "$SPAMASSASSIN_FILE"; then
+ echo "Cannot whitelist $DOMAIN. It is already blacklisted."
+ exit 1
+fi
+
+# Add the main entry
+if ! check_whitelist_exists "$WHITELIST_ENTRY_MAIN" "$SPAMASSASSIN_FILE"; then
+ add_whitelist_to_file "$WHITELIST_ENTRY_MAIN" "$SPAMASSASSIN_FILE"
+ echo "Added whitelist_from $WHITELIST_ENTRY_MAIN to $SPAMASSASSIN_FILE."
+ SPAMASSASSIN_CHANGED=true
+else
+ echo "whitelist_from $WHITELIST_ENTRY_MAIN already exists in $SPAMASSASSIN_FILE."
+fi
+
+# Add the subdomain entry if needed
+if [ "$SUBDOMAIN" == "YES" ]; then
+ if ! check_whitelist_exists "$WHITELIST_ENTRY_SUB" "$SPAMASSASSIN_FILE"; then
+ add_whitelist_to_file "$WHITELIST_ENTRY_SUB" "$SPAMASSASSIN_FILE"
+ echo "Added whitelist_from $WHITELIST_ENTRY_SUB to $SPAMASSASSIN_FILE."
+ SPAMASSASSIN_CHANGED=true
+ else
+ echo "whitelist_from $WHITELIST_ENTRY_SUB already exists in $SPAMASSASSIN_FILE."
+ fi
+fi
+
+# Restart SpamAssassin only if changes were made
+if [ "$SPAMASSASSIN_CHANGED" == "true" ]; then
+ systemctl restart "$SPAMD_SERVICE"
+ echo "SpamAssassin service ($SPAMD_SERVICE) restarted."
+fi
+
+#----------------------------------------------------------#
+# Done #
+#----------------------------------------------------------#
+
+exit 0
diff --git a/func/bash-to-php-interpreter.php b/func/bash-to-php-interpreter.php
new file mode 100644
index 00000000..b437c3c9
--- /dev/null
+++ b/func/bash-to-php-interpreter.php
@@ -0,0 +1,88 @@
+ $mysql_out 2>&1
if [ '0' -ne "$?" ]; then
if [ "$notify" != 'no' ]; then
+ subj="Error: Connection to $HOST failed"
+ email=$($BIN/v-get-user-value admin CONTACT)
+
echo -e "Can't connect to MySQL $HOST\n$(cat $mysql_out)" |\
$SENDMAIL -s "$subj" $email
fi
@@ -55,10 +58,13 @@ mysql_query() {
mysql_dump() {
err="/tmp/e.mysql"
- mysqldump --defaults-file=$mycnf --single-transaction --max_allowed_packet=100M -r $1 $2 2> $err
+ mysqldump --defaults-file=$mycnf --complete-insert --force --quick --single-transaction --max-allowed-packet=1024MB -r $1 $2 2> $err
if [ '0' -ne "$?" ]; then
rm -rf $tmpdir
if [ "$notify" != 'no' ]; then
+ subj="Error: dump $database failed"
+ email=$($BIN/v-get-user-value admin CONTACT)
+
echo -e "Can't dump database $database\n$(cat $err)" |\
$SENDMAIL -s "$subj" $email
fi
@@ -82,6 +88,9 @@ psql_connect() {
psql -h $HOST -U $USER -c "SELECT VERSION()" > /dev/null 2>/tmp/e.psql
if [ '0' -ne "$?" ]; then
if [ "$notify" != 'no' ]; then
+ subj="Error: Connection to $HOST failed"
+ email=$($BIN/v-get-user-value admin CONTACT)
+
echo -e "Can't connect to PostgreSQL $HOST\n$(cat /tmp/e.psql)" |\
$SENDMAIL -s "$subj" $email
fi
@@ -103,6 +112,9 @@ psql_dump() {
if [ '0' -ne "$?" ]; then
rm -rf $tmpdir
if [ "$notify" != 'no' ]; then
+ subj="Error: dump $database failed"
+ email=$($BIN/v-get-user-value admin CONTACT)
+
echo -e "Can't dump database $database\n$(cat /tmp/e.psql)" |\
$SENDMAIL -s "$subj" $email
fi
@@ -202,21 +214,57 @@ decrease_dbhost_values() {
add_mysql_database() {
mysql_connect $host
+ mysql_ver_sub=$(echo $mysql_ver |cut -d '.' -f1)
+ mysql_ver_sub_sub=$(echo $mysql_ver |cut -d '.' -f2)
+
query="CREATE DATABASE \`$database\` CHARACTER SET $charset"
mysql_query "$query" > /dev/null
- query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@\`%\`
- IDENTIFIED BY '$dbpass'"
- mysql_query "$query" > /dev/null
+ if [ "$mysql_fork" = "mysql" ] && [ "$mysql_ver_sub" -ge 8 ] ; then
+ query="CREATE USER \`$dbuser\`@\`%\`
+ IDENTIFIED BY '$dbpass'"
+ mysql_query "$query" > /dev/null
- query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@localhost
- IDENTIFIED BY '$dbpass'"
- mysql_query "$query" > /dev/null
+ query="CREATE USER \`$dbuser\`@localhost
+ IDENTIFIED BY '$dbpass'"
+ mysql_query "$query" > /dev/null
- if [ "$(echo $mysql_ver |cut -d '.' -f2)" -ge 7 ]; then
- md5=$(mysql_query "SHOW CREATE USER \`$dbuser\`" 2>/dev/null)
- md5=$(echo "$md5" |grep password |cut -f8 -d \')
+ query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@\`%\`"
+ mysql_query "$query" > /dev/null
+
+ query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@localhost"
+ mysql_query "$query" > /dev/null
else
+ query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@\`%\`
+ IDENTIFIED BY '$dbpass'"
+ mysql_query "$query" > /dev/null
+
+ query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@localhost
+ IDENTIFIED BY '$dbpass'"
+ mysql_query "$query" > /dev/null
+ fi
+
+ if [ "$mysql_fork" = "mysql" ]; then
+ # mysql
+ if [ "$mysql_ver_sub" -ge 8 ] || { [ "$mysql_ver_sub" -eq 5 ] && [ "$mysql_ver_sub_sub" -ge 7 ]; } then
+ if [ "$mysql_ver_sub" -ge 8 ]; then
+ # mysql >= 8
+ md5=$(mysql_query "SHOW CREATE USER \`$dbuser\`" 2>/dev/null)
+ # echo $md5
+ md5=$(echo "$md5" |grep password |cut -f4 -d \')
+ # echo $md5
+ else
+ # mysql < 8
+ md5=$(mysql_query "SHOW CREATE USER \`$dbuser\`" 2>/dev/null)
+ md5=$(echo "$md5" |grep password |cut -f8 -d \')
+ fi
+ else
+ # mysql < 5.7
+ md5=$(mysql_query "SHOW GRANTS FOR \`$dbuser\`" 2>/dev/null)
+ md5=$(echo "$md5" |grep PASSW|tr ' ' '\n' |tail -n1 |cut -f 2 -d \')
+ fi
+ else
+ # mariadb
md5=$(mysql_query "SHOW GRANTS FOR \`$dbuser\`" 2>/dev/null)
md5=$(echo "$md5" |grep PASSW|tr ' ' '\n' |tail -n1 |cut -f 2 -d \')
fi
@@ -267,22 +315,63 @@ get_database_values() {
# Change MySQL database password
change_mysql_password() {
mysql_connect $HOST
- query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@\`%\`
- IDENTIFIED BY '$dbpass'"
- mysql_query "$query" > /dev/null
-
- query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@localhost
- IDENTIFIED BY '$dbpass'"
- mysql_query "$query" > /dev/null
-if [ "$(echo $mysql_ver |cut -d '.' -f2)" -ge 7 ]; then
-
- md5=$(mysql_query "SHOW CREATE USER \`$DBUSER\`" 2>/dev/null)
- md5=$(echo "$md5" |grep password |cut -f8 -d \')
-else
- md5=$(mysql_query "SHOW GRANTS FOR \`$DBUSER\`" 2>/dev/null)
- md5=$(echo "$md5" |grep PASSW|tr ' ' '\n' |tail -n1 |cut -f 2 -d \')
-fi
+ mysql_ver_sub=$(echo $mysql_ver |cut -d '.' -f1)
+ mysql_ver_sub_sub=$(echo $mysql_ver |cut -d '.' -f2)
+
+ if [ "$mysql_fork" = "mysql" ]; then
+ # mysql
+ if [ "$mysql_ver_sub" -ge 8 ]; then
+ # mysql >= 8
+ query="SET PASSWORD FOR \`$DBUSER\`@\`%\` = '$dbpass'"
+ mysql_query "$query" > /dev/null
+ query="SET PASSWORD FOR \`$DBUSER\`@localhost = '$dbpass'"
+ mysql_query "$query" > /dev/null
+ else
+ # mysql < 8
+ query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@\`%\`
+ IDENTIFIED BY '$dbpass'"
+ mysql_query "$query" > /dev/null
+
+ query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@localhost
+ IDENTIFIED BY '$dbpass'"
+ mysql_query "$query" > /dev/null
+ fi
+ else
+ # mariadb
+ query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@\`%\`
+ IDENTIFIED BY '$dbpass'"
+ mysql_query "$query" > /dev/null
+
+ query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@localhost
+ IDENTIFIED BY '$dbpass'"
+ mysql_query "$query" > /dev/null
+ fi
+
+ if [ "$mysql_fork" = "mysql" ]; then
+ # mysql
+ if [ "$mysql_ver_sub" -ge 8 ] || { [ "$mysql_ver_sub" -eq 5 ] && [ "$mysql_ver_sub_sub" -ge 7 ]; } then
+ if [ "$mysql_ver_sub" -ge 8 ]; then
+ # mysql >= 8
+ md5=$(mysql_query "SHOW CREATE USER \`$DBUSER\`" 2>/dev/null)
+ # echo $md5
+ md5=$(echo "$md5" |grep password |cut -f4 -d \')
+ # echo $md5
+ else
+ # mysql < 8
+ md5=$(mysql_query "SHOW CREATE USER \`$DBUSER\`" 2>/dev/null)
+ md5=$(echo "$md5" |grep password |cut -f8 -d \')
+ fi
+ else
+ # mysql < 5.7
+ md5=$(mysql_query "SHOW GRANTS FOR \`$DBUSER\`" 2>/dev/null)
+ md5=$(echo "$md5" |grep PASSW|tr ' ' '\n' |tail -n1 |cut -f 2 -d \')
+ fi
+ else
+ # mariadb
+ md5=$(mysql_query "SHOW GRANTS FOR \`$DBUSER\`" 2>/dev/null)
+ md5=$(echo "$md5" |grep PASSW|tr ' ' '\n' |tail -n1 |cut -f 2 -d \')
+ fi
}
# Change PostgreSQL database password
@@ -322,7 +411,7 @@ delete_pgsql_database() {
psql_connect $HOST
query="REVOKE ALL PRIVILEGES ON DATABASE $database FROM $DBUSER"
- psql_qyery "$query" > /dev/null
+ psql_query "$query" > /dev/null
query="DROP DATABASE $database"
psql_query "$query" > /dev/null
@@ -391,7 +480,7 @@ suspend_pgsql_database() {
# Unsuspend MySQL database
unsuspend_mysql_database() {
mysql_connect $HOST
- query="GRANT ALL ON \`$database\`.* FROM \`$DBUSER\`@\`%\`"
+ query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@\`%\`"
mysql_query "$query" > /dev/null
query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@localhost"
mysql_query "$query" > /dev/null
@@ -464,3 +553,27 @@ delete_pgsql_user() {
query="DROP ROLE $old_dbuser"
psql_query "$query" > /dev/null
}
+
+# Get database name without user prefix
+get_database_name_without_user_prefix() {
+ user=$1
+ db=$2
+ user_len=${#user}
+ user_len=$((user_len+1))
+ echo ${db:user_len}
+}
+
+# Check if database exists
+check_if_database_exists() {
+ USER_DATA_PATH=$VESTA/data/users/$1
+ if [ ! -d "$USER_DATA_PATH" ]; then
+ echo "no"
+ return;
+ fi
+ counter=$(grep -c "DB='$2'" $USER_DATA_PATH/db.conf)
+ if [ "$counter" = "0" ]; then
+ echo "no"
+ else
+ echo "yes"
+ fi
+}
diff --git a/func/domain.sh b/func/domain.sh
index 713cc52a..f2a45e71 100644
--- a/func/domain.sh
+++ b/func/domain.sh
@@ -225,6 +225,10 @@ add_web_config() {
$user $domain $local_ip $HOMEDIR \
$HOMEDIR/$user/web/$domain/public_html
fi
+
+ if [[ "$2" =~ ^PHP-FPM ]]; then
+ ensure_poold_folders_not_empty
+ fi
}
# Get config top and bottom line number
@@ -412,6 +416,24 @@ update_domain_zone() {
VALUE=$(idn --quiet -a -t "$VALUE")
fi
+ # Split long TXT entries into 255 chunks
+ if [ "$TYPE" = 'TXT' ]; then
+ txtlength=${#VALUE}
+ if [ $txtlength -gt 255 ]; then
+ already_chunked=0
+ if [[ $VALUE == *"\" \""* ]] || [[ $VALUE == *"\"\""* ]]; then
+ already_chunked=1
+ fi
+ if [ $already_chunked -eq 0 ]; then
+ if [[ ${VALUE:0:1} = '"' ]]; then
+ txtlength=$(( $txtlength - 2 ))
+ VALUE=${VALUE:1:txtlength}
+ fi
+ VALUE=$(echo $VALUE | fold -w 255 | xargs -I '$' echo -n '"$"')
+ fi
+ fi
+ fi
+
if [ "$SUSPENDED" != 'yes' ]; then
eval echo -e "\"$fields\""|sed "s/%quote%/'/g" >> $zn_conf
fi
@@ -572,3 +594,28 @@ is_domain_new() {
get_domain_values() {
eval $(grep "DOMAIN='$domain'" $USER_DATA/$1.conf)
}
+
+# Ensure that pool.d folders are not empty
+ensure_poold_folders_not_empty () {
+ for D in /etc/php/*; do
+ if [ -d "${D}" ]; then
+ BD=$(basename ${D})
+ POOLD="${D}/fpm/pool.d"
+ if [ -d "$POOLD" ]; then
+ # echo $POOLD
+ # service_to_check="php${BD}-fpm"
+ # service_exists=$(check_if_service_exists $service_to_check)
+ # if [ $service_exists -eq 1 ]; then
+ # echo "$BD = $service_to_check = $POOLD = $service_exists"
+ ls=$(ls $POOLD | grep -c '.conf')
+ if [ $ls -eq 0 ]; then
+ # echo "$BD = $POOLD = $ls"
+ if [ -f "/usr/local/vesta/src/deb/for-download/tools/default-pool.d/$BD/www.conf" ] && [ ! -f "/etc/php/$BD/fpm/pool.d/www.conf" ]; then
+ cp /usr/local/vesta/src/deb/for-download/tools/default-pool.d/$BD/www.conf /etc/php/$BD/fpm/pool.d/www.conf
+ fi
+ fi
+ # fi
+ fi
+ fi
+ done
+}
diff --git a/func/handle_parameters.sh b/func/handle_parameters.sh
new file mode 100644
index 00000000..32e09312
--- /dev/null
+++ b/func/handle_parameters.sh
@@ -0,0 +1,19 @@
+# handle --parameters=val
+
+handle_parameter() {
+ origparam=$1
+ searchstring="="
+ paramminuses=${origparam:0:2}
+ if [ "$paramminuses" = "--" ]; then
+ var_without_minuses=${origparam:2}
+ var=${var_without_minuses%%=*}
+ val=${origparam#*$searchstring}
+ # echo "$var = $val"
+ printf -v "$var" '%s' "$val"
+ fi
+}
+numargs=$#
+for ((i=1 ; i <= numargs ; i++))
+do
+ handle_parameter ${@:$i:1}
+done
diff --git a/func/main.php b/func/main.php
new file mode 100644
index 00000000..4628c92a
--- /dev/null
+++ b/func/main.php
@@ -0,0 +1,85 @@
+/dev/null
fi
}
@@ -152,7 +156,7 @@ generate_password() {
matrix=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
fi
if [ -z "$lenght" ]; then
- lenght=10
+ lenght=16
fi
i=1
while [ $i -le $lenght ]; do
@@ -250,6 +254,9 @@ is_object_unsuspended() {
spnd=$(grep "$2='$3'" $USER_DATA/$1.conf |grep "SUSPENDED='yes'")
fi
if [ ! -z "$spnd" ]; then
+ if [ ! -z "$VERBOSE_MODE" ]; then
+ echo "Error: $(basename $1) $3 is suspended"
+ fi
check_result $E_SUSPENDED "$(basename $1) $3 is suspended"
fi
}
@@ -299,6 +306,20 @@ is_dir_symlink() {
fi
}
+# Check if file exists
+if_file_exists() {
+ if [[ -f "$1" ]]; then
+ check_result $E_FORBIDEN "$1 file exists"
+ fi
+}
+
+# Check if directory exists
+if_dir_exists() {
+ if [[ -d "$1" ]]; then
+ check_result $E_FORBIDEN "$1 directory exists"
+ fi
+}
+
# Get object value
get_object_value() {
object=$(grep "$2='$3'" $USER_DATA/$1.conf)
@@ -341,6 +362,17 @@ search_objects() {
IFS="$OLD_IFS"
}
+# List objects
+list_objects() {
+ OLD_IFS="$IFS"
+ IFS=$'\n'
+ for line in $(cat $USER_DATA/$1.conf); do
+ eval $line
+ eval echo \$$2
+ done
+ IFS="$OLD_IFS"
+}
+
# Get user value
get_user_value() {
grep "^${1//$/}=" $USER_DATA/user.conf |awk -F "'" '{print $2}'
@@ -537,7 +569,7 @@ is_user_format_valid() {
is_domain_format_valid() {
object_name=${2-domain}
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
- if [[ $1 =~ $exclude ]] || [[ $1 =~ ^[0-9]+$ ]] || [[ $1 =~ "\.\." ]] || [[ $1 =~ "$(printf '\t')" ]]; then
+ if [[ $1 =~ $exclude ]] || [[ $1 =~ ^[0-9]+$ ]] || [[ $1 =~ \.\. ]] || [[ $1 =~ $(printf '\t') ]]; then
check_result $E_INVALID "invalid $object_name format :: $1"
fi
}
@@ -824,6 +856,22 @@ is_format_valid_shell() {
exit $E_INVALID
fi
}
+
+format_no_quotes() {
+ exclude="['|\"]"
+ if [[ "$1" =~ $exclude ]]; then
+ check_result "$E_INVALID" "Invalid $2 contains qoutes (\" or ') :: $1"
+ fi
+ is_no_new_line_format "$1"
+}
+
+is_no_new_line_format() {
+ test=$(echo "$1" | head -n1 );
+ if [[ "$test" != "$1" ]]; then
+ check_result "$E_INVALID" "invalid value :: $1"
+ fi
+}
+
# Format validation controller
is_format_valid() {
for arg_name in $*; do
@@ -832,6 +880,7 @@ is_format_valid() {
case $arg_name in
account) is_user_format_valid "$arg" "$arg_name";;
action) is_fw_action_format_valid "$arg";;
+ alias) is_alias_format_valid "$arg" ;;
aliases) is_alias_format_valid "$arg" ;;
antispam) is_boolean_format_valid "$arg" 'antispam' ;;
antivirus) is_boolean_format_valid "$arg" 'antivirus' ;;
@@ -857,6 +906,7 @@ is_format_valid() {
host) is_object_format_valid "$arg" "$arg_name" ;;
hour) is_cron_format_valid "$arg" $arg_name ;;
id) is_int_format_valid "$arg" 'id' ;;
+ interface) is_interface_format_valid "$arg" ;;
ip) is_ip_format_valid "$arg" ;;
ip_name) is_domain_format_valid "$arg" 'IP name';;
ip_status) is_ip_status_format_valid "$arg" ;;
@@ -1040,3 +1090,172 @@ get_web_counter() {
echo $counter
}
+
+escape_shell_quote() {
+ local escape_shell_quoted=${1//\'/\'\\\'\'};
+ printf "'%s'" "$escape_shell_quoted"
+}
+
+replace_php_config_value() {
+ if [ ! -z "$4" ]; then
+ if [ "$4" = "yes" ] || [ "$4" = "true" ] || [ "$4" = "1" ] || [ $4 -eq 1 ]; then
+ echo "=== Replacing $1 to $2 in $3"
+ fi
+ fi
+ sed -i "s|'$1'|'$2'|g" $3
+ sed -i "s|\"$1\"|\"$2\"|g" $3
+ sed -i "s|=$1$|=$2|g" $3
+ sed -i "s|= $1$|= $2|g" $3
+}
+
+# Defining password-gen function
+vesta_generate_pass() {
+ MATRIX='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
+ LENGTH=32
+ if [ $# -gt 0 ] && [ $1 != "" ]; then
+ LENGTH=$1
+ fi
+ while [ ${n:=1} -le $LENGTH ]; do
+ PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}"
+ let n+=1
+ done
+ echo "$PASS"
+}
+
+# Simple chmod wrapper that skips symlink files after glob expand
+# Taken from HestiaCP
+no_symlink_chmod() {
+ local filemode=$1; shift;
+
+ for i in "$@"; do
+ [[ -L ${i} ]] && continue
+
+ chmod "${filemode}" "${i}"
+ done
+}
+
+# $1 = subject
+# $2 = body
+send_email_to_admin() {
+ email=$(grep CONTACT /usr/local/vesta/data/users/admin/user.conf)
+ email=$(echo "$email" | cut -f 2 -d "'")
+ if [ -z "$email" ]; then
+ if [ ! -z "$NOTIFY_ADMIN_FULL_BACKUP" ]; then
+ email=$NOTIFY_ADMIN_FULL_BACKUP
+ fi
+ fi
+ if [ -z "$email" ]; then
+ return;
+ fi
+ echo "$2" | $SENDMAIL -s "$1" "$email" 'yes'
+}
+
+check_if_service_exists() {
+ if [ $(systemctl list-units --all -t service --full --no-legend | grep -c "$1") -gt 0 ]; then
+ echo "1"
+ else
+ echo "0"
+ fi
+}
+
+# Parsing config variables with key='value' and key="value" pairs and setting them as variables, without using Perl.
+# Inspired by HestiaCP function and improved
+parse_object_kv_list_non_eval() {
+ # Let's combine all the parameters into one string, replace the new lines with a space
+ local str="${*//$'\n'/ }"
+ str=${str//\\\'/---QUOTE---}
+ str=${str//\\\"/---DQUOTE---}
+ local backup_str=$str
+
+ local key val match i length length_val prefix position cut
+ i=0
+ # Searching for key='value' blocks
+ # Loop until we find the next key='value'
+ while [[ $str =~ ([A-Za-z][[:alnum:]_]*)=\'([^\']*)\' ]]; do
+ key="${BASH_REMATCH[1]}"
+ val="${BASH_REMATCH[2]}"
+ match="${BASH_REMATCH[0]}"
+ length=${#match}
+ length_val=${#match}
+
+ # Key validation: alphanumeric, length 2–66 (key must start and end with a letter/number)
+ if ! [[ "$key" =~ ^[[:alnum:]][_[:alnum:]]{0,64}[[:alnum:]]$ ]]; then
+ check_result "$E_INVALID" "Invalid key format [$key]"
+ fi
+
+ # Declaring a global variable
+ val=${val/---QUOTE---/\\\'}
+ val=${val/---DQUOTE---/\\\"}
+ declare -g "$key"="$val"
+
+ # Let's remove the processed part from str to continue
+ prefix=${str%%"$key="*}
+ position=${#prefix}
+ cut=$((position + 1 + length_val))
+ str=${str:cut}
+ ((i++))
+ if [ $i -eq 100 ]; then
+ check_result "$E_INVALID" "Potentially conf-parsing infinite loop detected"
+ fi
+ done
+
+ # Terminate function if we don't expect strings with double apostrophes
+ if [ -z "$PARSE_DOUBLE_QUOTES_VAR" ]; then
+ return;
+ fi
+
+ # Searching for key="value" blocks
+ str=$backup_str
+ i=0
+ # Loop until we find the next key="value"
+ while [[ $str =~ ([A-Za-z][[:alnum:]_]*)=\"([^\"]*)\" ]]; do
+ key="${BASH_REMATCH[1]}"
+ val="${BASH_REMATCH[2]}"
+ match="${BASH_REMATCH[0]}"
+ length=${#match}
+ length_val=${#match}
+
+ # Key validation: alphanumeric, length 2–66 (key must start and end with a letter/number)
+ if ! [[ "$key" =~ ^[[:alnum:]][_[:alnum:]]{0,64}[[:alnum:]]$ ]]; then
+ check_result "$E_INVALID" "Invalid key format [$key]"
+ fi
+
+ # Declaring a global variable
+ val=${val/---QUOTE---/\\\'}
+ val=${val/---DQUOTE---/\\\"}
+ declare -g "$key"="$val"
+
+ # Let's remove the processed part from str to continue
+ prefix=${str%%"$key="*}
+ position=${#prefix}
+ cut=$((position + 1 + length_val))
+ str=${str:cut}
+ ((i++))
+ if [ $i -eq 100 ]; then
+ check_result "$E_INVALID" "Potentially conf-parsing infinite loop detected"
+ fi
+ done
+}
+
+# Return OK (0) if domain is unsupended
+# Parameters:
+# $1 - user
+# $2 - domain
+return_ok_if_domain_is_unsuspended() {
+ spnd=$(grep "DOMAIN='$2'" /usr/local/vesta/data/users/$1/web.conf | grep "SUSPENDED='yes'")
+ if [ ! -z "$spnd" ]; then
+ return $E_SUSPENDED
+ fi
+ return $OK
+}
+
+# Return OK (0) if user is unsupended
+# Parameters:
+# $1 - user
+return_ok_if_user_is_unsuspended() {
+ spnd=$(cat /usr/local/vesta/data/users/$1/user.conf | grep "SUSPENDED='yes'")
+ if [ ! -z "$spnd" ]; then
+ return $E_SUSPENDED
+ fi
+ return $OK
+}
diff --git a/func/rebuild.sh b/func/rebuild.sh
index cf743d65..ae267e8b 100644
--- a/func/rebuild.sh
+++ b/func/rebuild.sh
@@ -51,7 +51,7 @@ rebuild_user_conf() {
mkdir -p $HOMEDIR/$user/conf
chmod a+x $HOMEDIR/$user
chmod a+x $HOMEDIR/$user/conf
- chown $user:$user $HOMEDIR/$user
+ chown --no-dereference $user:$user $HOMEDIR/$user
chown root:root $HOMEDIR/$user/conf
# Update disk pipe
@@ -80,7 +80,7 @@ rebuild_user_conf() {
chmod 751 $HOMEDIR/$user/conf/web
chmod 751 $HOMEDIR/$user/web
chmod 771 $HOMEDIR/$user/tmp
- chown $user:$user $HOMEDIR/$user/web
+ chown --no-dereference $user:$user $HOMEDIR/$user/web
if [ -z "$create_user" ]; then
$BIN/v-rebuild-web-domains $user $restart
fi
@@ -183,10 +183,10 @@ rebuild_web_domain_conf() {
fi
# Set folder permissions
- chmod 551 $HOMEDIR/$user/web/$domain \
+ no_symlink_chmod 551 $HOMEDIR/$user/web/$domain \
$HOMEDIR/$user/web/$domain/stats \
$HOMEDIR/$user/web/$domain/logs
- chmod 751 $HOMEDIR/$user/web/$domain/private \
+ no_symlink_chmod 751 $HOMEDIR/$user/web/$domain/private \
$HOMEDIR/$user/web/$domain/cgi-bin \
$HOMEDIR/$user/web/$domain/public_html \
$HOMEDIR/$user/web/$domain/public_shtml \
@@ -194,7 +194,7 @@ rebuild_web_domain_conf() {
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
# Set ownership
- chown $user:$user $HOMEDIR/$user/web/$domain \
+ chown --no-dereference $user:$user $HOMEDIR/$user/web/$domain \
$HOMEDIR/$user/web/$domain/private \
$HOMEDIR/$user/web/$domain/cgi-bin \
$HOMEDIR/$user/web/$domain/public_html \
@@ -445,9 +445,12 @@ rebuild_mail_domain_conf() {
rm -f $HOMEDIR/$user/conf/mail/$domain/protection
rm -f $HOMEDIR/$user/conf/mail/$domain/passwd
rm -f $HOMEDIR/$user/conf/mail/$domain/fwd_only
+ rm -f $HOMEDIR/$user/conf/mail/$domain/accounts
+
touch $HOMEDIR/$user/conf/mail/$domain/aliases
touch $HOMEDIR/$user/conf/mail/$domain/passwd
touch $HOMEDIR/$user/conf/mail/$domain/fwd_only
+ touch $HOMEDIR/$user/conf/mail/$domain/accounts
# Adding antispam protection
if [ "$ANTISPAM" = 'yes' ]; then
@@ -506,6 +509,8 @@ rebuild_mail_domain_conf() {
fi
str="$account:$MD5:$user:mail::$HOMEDIR/$user:$QUOTA"
echo $str >> $HOMEDIR/$user/conf/mail/$domain/passwd
+ userstr="$account:$account:$user:mail:$HOMEDIR/$user"
+ echo $userstr >> $HOMEDIR/$user/conf/mail/$domain/accounts
for malias in ${ALIAS//,/ }; do
echo "$malias@$domain_idn:$account@$domain_idn" >> $dom_aliases
done
@@ -518,6 +523,12 @@ rebuild_mail_domain_conf() {
fi
done
+ # Define mail user
+ if [ "$MAIL_SYSTEM" = 'exim4' ]; then
+ MAIL_USER=Debian-exim
+ else
+ MAIL_USER=exim
+ fi
# Set permissions and ownership
if [[ "$MAIL_SYSTEM" =~ exim ]]; then
chmod 660 $USER_DATA/mail/$domain.*
@@ -527,6 +538,7 @@ rebuild_mail_domain_conf() {
chmod 770 $HOMEDIR/$user/mail/$domain_idn
chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain
chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
+ chown $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain/accounts
chown $user:mail $HOMEDIR/$user/mail/$domain_idn
fi
@@ -544,33 +556,48 @@ rebuild_mysql_database() {
mysql_query "CREATE DATABASE \`$DB\` CHARACTER SET $CHARSET" >/dev/null
if [ "$mysql_fork" = "mysql" ]; then
# mysql
- if [ "$(echo $mysql_ver |cut -d '.' -f2)" -ge 7 ]; then
+ mysql_ver_sub=$(echo $mysql_ver |cut -d '.' -f1)
+ mysql_ver_sub_sub=$(echo $mysql_ver |cut -d '.' -f2)
+ if [ "$mysql_ver_sub" -ge 8 ] || { [ "$mysql_ver_sub" -eq 5 ] && [ "$mysql_ver_sub_sub" -ge 7 ]; } then
# mysql >= 5.7
- mysql_query "CREATE USER IF NOT EXISTS \`$DBUSER\`" > /dev/null
- mysql_query "CREATE USER IF NOT EXISTS \`$DBUSER\`@localhost" > /dev/null
- query="UPDATE mysql.user SET authentication_string='$MD5'"
- query="$query WHERE User='$DBUSER'"
+ # if [ "$mysql_ver_sub" -eq 5 ] && [ "$mysql_ver_sub_sub" -ge 7 ]; then
+ mysql_query "CREATE USER IF NOT EXISTS \`$DBUSER\`" > /dev/null
+ mysql_query "CREATE USER IF NOT EXISTS \`$DBUSER\`@localhost" > /dev/null
+ query="UPDATE mysql.user SET authentication_string='$MD5'"
+ query="$query WHERE User='$DBUSER'"
else
# mysql < 5.7
query="UPDATE mysql.user SET Password='$MD5' WHERE User='$DBUSER'"
fi
else
# mariadb
- if [ "$(echo $mysql_ver |cut -d '.' -f1)" -eq 5 ]; then
+ mysql_ver_sub=$(echo $mysql_ver |cut -d '.' -f1)
+ mysql_ver_sub_sub=$(echo $mysql_ver |cut -d '.' -f2)
+ if [ "$mysql_ver_sub" -eq 5 ]; then
# mariadb = 5
mysql_query "CREATE USER \`$DBUSER\`" > /dev/null
mysql_query "CREATE USER \`$DBUSER\`@localhost" > /dev/null
+ query="UPDATE mysql.user SET Password='$MD5' WHERE User='$DBUSER'"
else
# mariadb = 10
mysql_query "CREATE USER IF NOT EXISTS \`$DBUSER\`" > /dev/null
mysql_query "CREATE USER IF NOT EXISTS \`$DBUSER\`@localhost" > /dev/null
+ if [ "$mysql_ver_sub_sub" -ge 4 ]; then
+ # mariadb >= 10.4
+ query="SET PASSWORD FOR '$DBUSER'@'%' = '$MD5';"
+ query2="SET PASSWORD FOR '$DBUSER'@'localhost' = '$MD5';"
+ else
+ # mariadb < 10.4
+ query="UPDATE mysql.user SET Password='$MD5' WHERE User='$DBUSER'"
+ fi
fi
- # mariadb any version
- query="UPDATE mysql.user SET Password='$MD5' WHERE User='$DBUSER'"
fi
mysql_query "GRANT ALL ON \`$DB\`.* TO \`$DBUSER\`@\`%\`" >/dev/null
mysql_query "GRANT ALL ON \`$DB\`.* TO \`$DBUSER\`@localhost" >/dev/null
mysql_query "$query" >/dev/null
+ if [ ! -z "$query2" ]; then
+ mysql_query "$query2" >/dev/null
+ fi
mysql_query "FLUSH PRIVILEGES" >/dev/null
}
@@ -583,6 +610,9 @@ rebuild_pgsql_database() {
if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
echo "Error: postgresql config parsing failed"
if [ ! -z "$SENDMAIL" ]; then
+ subj="Error: postgresql config parsing failed"
+ email=$($BIN/v-get-user-value admin CONTACT)
+
echo "Can't parse PostgreSQL config" | $SENDMAIL -s "$subj" $email
fi
log_event "$E_PARSING" "$ARGUMENTS"
@@ -594,6 +624,9 @@ rebuild_pgsql_database() {
if [ '0' -ne "$?" ]; then
echo "Error: Connection failed"
if [ ! -z "$SENDMAIL" ]; then
+ subj="Error: Connection failed"
+ email=$($BIN/v-get-user-value admin CONTACT)
+
echo "Database connection to PostgreSQL host $HOST failed" |\
$SENDMAIL -s "$subj" $email
fi
diff --git a/func/string.php b/func/string.php
new file mode 100644
index 00000000..7ada2546
--- /dev/null
+++ b/func/string.php
@@ -0,0 +1,238 @@
+$slen) $len=$slen-$pos1;
+
+ $myvesta_str_found_at=$pos1;
+ $myvesta_str_end_at=$pos1+$len;
+
+ return substr($text, $pos1, $len);
+}
+
+function myvesta_str_replace_once_between_including_borders(&$text, $left, $right, $replace_with) {
+ $pos1=strpos($text, $left);
+ if ($pos1===false) return $text;
+ $pos2=strpos($text, $right, $pos1+strlen($left));
+ if ($pos2===false) return $text;
+ return substr($text, 0, $pos1).$replace_with.substr($text, $pos2+strlen($right));
+}
+
+function myvesta_str_strip_once_between_including_borders(&$text, $left, $right) {
+ $pos1=strpos($text, $left);
+ if ($pos1===false) return $text;
+ $pos2=strpos($text, $right, $pos1+strlen($left));
+ if ($pos2===false) return $text;
+ return substr($text, 0, $pos1).substr($text, $pos2+strlen($right));
+}
+
+function myvesta_str_replace_between_including_borders($text, $left, $right, $replace_with) {
+ $start=0;
+ $left_len=strlen($left);
+ $right_len=strlen($right);
+ while (true) {
+ $pos1=strpos($text, $left);
+ if ($pos1===false) break;
+ $pos2=strpos($text, $right, $pos1+$left_len);
+ if ($pos2===false) break;
+ $text=substr($text, 0, $pos1).$replace_with.substr($text, $pos2+$right_len);
+ }
+ return $text;
+}
+
+function myvesta_str_strip_between_including_borders($text, $left, $right) {
+ global $myvesta_stdin;
+ $args=func_get_args();
+ $args_i=-1;
+ if ($myvesta_stdin!='') {
+ $text=$myvesta_stdin;
+ } else {
+ $args_i++; $text=$args[$args_i];
+ }
+ $args_i++; $left=$args[$args_i];
+ $args_i++; $right=$args[$args_i];
+
+ $left_len=strlen($left);
+ $right_len=strlen($right);
+ while (true) {
+ $pos1=strpos($text, $left);
+ if ($pos1===false) break;
+ $pos2=strpos($text, $right, $pos1+$left_len);
+ if ($pos2===false) break;
+ $text=substr($text, 0, $pos1).substr($text, $pos2+$right_len);
+ }
+ return $text;
+}
+
+function myvesta_str_find($text, $find, $quiet=false) {
+ $pos=strpos($text, $find);
+ if ($pos===false) return myvesta_throw_error (MYVESTA_ERROR_STRING_NOT_FOUND, "");
+ if ($quiet) return true;
+ return $pos;
+}
+
+function myvesta_str_uppercase($text) {
+ return strtoupper($text);
+}
+
+function myvesta_str_lowercase($text) {
+ return strtolower($text);
+}
+
+function myvesta_str_substring($text, $start, $length=null) {
+ if ($length===null) return substr($text, $start);
+ if ($length!==null) return substr($text, $start, $length);
+}
diff --git a/install/debian/10/apache2/status.conf b/install/debian/10/apache2/status.conf
index da9d9633..0d82a356 100644
--- a/install/debian/10/apache2/status.conf
+++ b/install/debian/10/apache2/status.conf
@@ -4,5 +4,5 @@ Listen 127.0.0.1:8081
Order deny,allow
Deny from all
Allow from 127.0.0.1
- Allow from all
+ # Allow from all
diff --git a/install/debian/10/clamav/clamd.conf b/install/debian/10/clamav/clamd.conf
index 10ebbac3..c636b6d3 100644
--- a/install/debian/10/clamav/clamd.conf
+++ b/install/debian/10/clamav/clamd.conf
@@ -1,7 +1,7 @@
#Automatically Generated by clamav-base postinst
#To reconfigure clamd run #dpkg-reconfigure clamav-base
#Please read /usr/share/doc/clamav-base/README.Debian.gz for details
-LocalSocket /var/lib/clamav/clamd.sock
+LocalSocket /var/run/clamav/clamd.ctl
FixStaleSocket true
LocalSocketGroup clamav
LocalSocketMode 666
diff --git a/install/debian/10/deb_signing.key b/install/debian/10/deb_signing.key
index 9debc008..d279abbd 100644
--- a/install/debian/10/deb_signing.key
+++ b/install/debian/10/deb_signing.key
@@ -1,41 +1,41 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
-mQGNBF0pEcYBDADE5M0hqORpLBNuCtGaDzX7b7pRNCpWG0zBqjfXf6GSNCZFmoT8
-ag0DJqhEgt9+MK8StYPvZJNrnhEfT3z8twRfvnFGl6SIHMidInmDOJG8Y6btUPc4
-pylXYgAMnRUzT3eXaHcn/UGNQ1NR3DwUaL8wqGpurMkxqmoeHsvn6sHO5v7PiAW1
-xSFVyrMLDEAQASdif6Zfmjm4WaxJF3p8BxCcmfmMIC+UXiRVn5jrib1J0yC5AQZf
-uPHcnZZIynYphcNV9fOC0VFpxxtdWz3cdtJQNEuM/bV5qEowlULgopQQVn4W7I3/
-6Hy4RSS+B5mSinKF7Na666sKiBbOqWNWHpGi9YEGfD+3bE36Gd/B3FaMKDc/zDn7
-5eWFgxBT89ASHNzKULKpNwOzRMwBDj6nZySFzr2lMNH9SAQ6xL5i2/L49SXu2wsI
-FisvNzSFpflyseiHpda2DbQ3U9Uk36Ixy8OrHFcRHW/an4mPuae+FHjI3+TYJPbM
-DINOKGlDAHpXIEUAEQEAAbQuUHJlZHJhZyBEYW1uamFub3ZpYyA8cHJlZHJhZ0Bo
-b3N0aW5ncGFuZWwuZGV2PokB1AQTAQoAPhYhBKkALHMylGR2fdARrXm+rmsIksKF
-BQJdKRHGAhsDBQkDwmcABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEHm+rmsI
-ksKF8ywL+gM1e/22lvq+q6mElPZBPtpa6rHgvPlm9pKdp/vdpV/x7bXWOiE/xClK
-F5+ULBbudeWiiJi6e6aUKSYTtEFku6qJLBe64gX4EfjOYjBdYqbmGr0I+s2F/awB
-jBqg/97XB5JnUVis9762VU9CltvRjHjhd/s5HM4lCta0bSjPkRyFASONPDLx0y/L
-1ESXyHgTBOHOotQrnH0l4RQmTEcjN1jyGsHqbt6D5Km5DrteI9uFt2MWjOAOB6Fc
-noiGJCaLGffw7aJ0CwKWySUPaXgTiLYWwJW3KIIh/IgKtLfhteAwImxMxLiQDLk2
-p6jO4h+I6k+n3e+u/Bd7/zK2PbpoEqgw2NzfAFX6qkJKQgtps1oP2IwEi64BbFTd
-uOjJjfYLKuFgwilHe0mdrUusjQy8HSBhezpciTlalDOJtrjF3DHiIvp3WUPXsS7o
-vswoR8SH7yJTH5dP7lrfFEeQ8TBBq+f+d3uAQVBXi8ETyflHnws9LHMR8J3QuadK
-y6OESuMzPrkBjQRdKRHGAQwAyqeIfU2TL36ddAKAmNvDlMwYAcxlsq619KbIuFPK
-h3nW1bXYwhFGjOwSFrIhFPT8cG69S4yvVDwkN1BeCefEA35PJdwy9FLERHFApEbO
-C2WUrbqYovd26W/xdAlHXsphsD0p64ntYkqJzYWGKAQ/6LO0esoesRl5iTSda7WG
-pHX/2LXiSl91gqysWZIaB8LoJaACkoti9N/FFH/Li08ez3Am2mxciX5yGdcba290
-rEvzgxwi00KdhNTE7ZT8FmpiUDxdm5kninRRklk6FAfEaQ1sLffhhZkcaNF+cmSV
-ijU8TCmoTpkAoyOddWri1zZBgeDQh7CGaNbx3n/6EZVKwPajFgDuVA/n9YVKyG9O
-AGpgK5p3pn7yrBCdDEOl+pun/NsEaUm3mrRpQvEZoVCLYkVfdYaXpgTcifVYJnt3
-/8xbYYM6qMXM/ajiUQrAWaYBylzF5uc0WaK3w0feb1KdEV8o0+BgpOxUQtUfM88m
-GMCLb+2S2DQY2ay4tImgIjKVABEBAAGJAbwEGAEKACYWIQSpACxzMpRkdn3QEa15
-vq5rCJLChQUCXSkRxgIbDAUJA8JnAAAKCRB5vq5rCJLChRWJDACNA2AOuB5wuJOY
-pm9fXB5uwtvqbqd7Q3219o5236F7Imw81afxcu2RDZDh6DXHmW3YnICq4ffyYjWW
-1jQrZJo7uemlc+Vkqvq/XFS5T/DbaWwZCYj5uN6BbsfmfoLpa7QYvUu2vsNM6UD6
-DmrWeLIWAv9VS/RHAFgzs5Rre3EjD5NrWVOttOmwqeMJC06Nf9JUqE7o5DDQ6avG
-Hy+7KMYHSJf6dtH7lYNI0tq3/qxkNr7xF5c7FO5J/hv0wOeilExEJEiSrBfVXrhJ
-tOs6B1qE6liD6IoMSPHZDZESzU/PJG+UbzxYpi3rtqcte/qXS7QzOnv77rFK0VmF
-pHGSkDCoUmxbSIGrju8D9MeXuj5ygS7LoqpdxifCfnxa50VJk10+ucyiW4yUjBZv
-7SjBioKXx4cW7TDjPcZ7XrsCKftipZxr8d7BvSRESgRdBI/p8md3sf9e7vw4V4d0
-ME0RikTA0b3qYO0RroUPcs/FD6PcvJ4SiWNwWqIU6DbtFh1ojo0=
-=mMOx
+mQGNBGDsPogBDADT7jiPewIuavqJZJMZ18c+kEC8N+/EK15k9zdBvcluxZ7gb5D6
+sKT3fVmLWD49mux+OoFs8DJH1LkpFe2Ax58NVMgDwCNUtcqeR8eB6nEWpZLjzJhZ
+RD5+ZpUaX/emXrr7mxJ1SvT8PgWWerl2ZuPSlpPm4Ls6JO53AvPAsUVgMTHkfHNj
+4/GqKtORkanzBwimC0bcB3BBRLH/kiW/TNi3hQnR5GYIaKWrc8oGpHHqX5BNw72O
+JTSqTj8OZXKG7US6cXgBQuLN68sKd9TIy2HZdTKlqR1yQyc2BiPwVYDrJemM72VT
+kuW0qbsOwji7rG2B6Pg1yggWXpB8Znczzi8AfzoFgXeOTi/hzcaf3YnAxfeL1Ofq
+aOW+ReqsF1wxpgVwNj0DVquPTqzd4uCIGNNGGHhlIR434FyA4YNfxK63YxZS5SAR
+leQGTUtBRdh1SOKPDZMcSlJ3wEfHKbp72qmnLdqUkGl//FZsCDdPFxx3wDCPPS2e
+++g3ImqeaQ553nUAEQEAAbQhbXlWZXN0YSB0ZWFtIDxpbmZvQG15dmVzdGFjcC5j
+b20+iQHOBBMBCgA4FiEEDcdTLoRXCPbKaPuqiIB9SyIhM4wFAmDsPogCGwMFCwkI
+BwIGFQoJCAsCBBYCAwECHgECF4AACgkQiIB9SyIhM4yADAv+M62/6N+uFx9Izbj5
+HxZCzLEgvlQzdQcLJPDwFWYByVRiQRkRJWt5kqwNpndWoDo5zEtyKn3Yulbj6zyy
+UqYhN0ctXyaFjKFIHIqrrz9P9AF2uGr17rTWbnRpjlMSkDSmUGXNEKO7gMtKiTo3
+olWldDELuM0MQddwMGgnqZPb3/Z+om68U1/6NS8A5hAHL+HuwcKGFZpFRJYXSOLY
+lIpHyicifvkRAMkPp025Y3Who3EZMWq3Bpo78djtxfA4CoUn+OH64Hn0llkJ3vU6
+bM+KuC2ZrkHrzcqZbPbYnmEmVD1rkxVoOgzqE76fAY2I6YFY09uhdg0FbZeeMjA+
+DReBwINRFYsk6/maY7Zc82clfc7+vr3xmR+f+KEiUCU4mI72PnlU9LT9RuoCkKbo
+znUZo+Xj6ezM6lCKGnOmqhvQmWR+hdsn1zX1ufxPA5uQyeFfR5VpAjvDOFykPA93
+3Et0ZdrKB2U6jjlGzWhsCkYphF7M0DVIRPOm1xLUJvLx+zB+uQGNBGDsPogBDADG
+rJuQBsLJ6MWAGLydwaIBttwG3GOysSsQ1P09mbeOqiyCaWfEladePorTpKsbOHA/
+USAfjN8Eik81Un1Kik6rYU8ieGERKpCMiBkcNLQH/DnYyCNT5oaGqXtIQ+5GNn71
+mt7sLmf0yL3C320RJa8KSP+rAaey4ttLyl7rM1q8RPmlsRSxVjeiMw01i6cXmA1G
+EJDuRbXdzDuo5utHDBMHgN0T0g8kgoTX9G2uwUTnJm9qzW2Lg3d4xoe2+H5/86Qm
+0lVl5vLSMEPl01NcoTVgQpGO/yR3nJ4ubMkkbzCM0e0MByHqOKJ2LfW77BcvcoXg
+coa7tF+6DZBB4UGyb1VuSZJoVOYN2tnSj2/taPk0yHJf/tLvNm/hVHEvXNXk09hy
+fne0FZmHKwwp0TGSC8tzsHPRSbIOazifIC8pdN4fPTQyfI9tKxi26opCIAHHkcTr
+7VOUvUNyAGVB9TU/nmzpvkv8BLCKSQM1FxUQ0owgFtrtIoMVxkYG5hb6EjAHyUcA
+EQEAAYkBtgQYAQoAIBYhBA3HUy6EVwj2ymj7qoiAfUsiITOMBQJg7D6IAhsMAAoJ
+EIiAfUsiITOMR40MALn5sqKFZ9FMe7982XMamanjPqO3Odi5/9rUXYKbJGjsaSof
+lSC3OtqnRTVGE6KEuYErCKCpAk2ZvEf5eQHi264fC255zuxWihdcEQpiPK1DdlN3
+m9JNp/4Pns38Nn/zG3cFQuDEvDsC75xmxN7pi+ZkokodwA0PgaiMVh5mSos+Mc/G
+fLcEes21xVk2DQ3Vw6p1P/39uujBPZ3J2unWBqv0rCFEpwgXm/d80Y0x31tq0ToZ
+hf1r/GcoB6rC3sSAtUykrTZUaRv57BouvnAP9zfFlFSrYpJZ5L9/IawBH+O9yUu2
+N1jGq9eJ/RwHG1lKUBJd6wCWz1ZKzxnaoH9CfRC/aG9vRQWLSjiHCl2cnNDxElKx
+JOT7RUjxlri4zvxdum49Vr8iEpjUFXzhRYq79SsmqkLuXZYQnccNFAdde8ZcPpKA
+zhfavTutAPNJRyg9hbwxQYUH6N1i5J7ZZsqHB/GIBaSReXroacHjFYcU6uiBt/da
+qiC8NLvRaE3PVkma9Q==
+=RAbI
-----END PGP PUBLIC KEY BLOCK-----
diff --git a/install/debian/10/exim/dnsbl.conf b/install/debian/10/exim/dnsbl.conf
index 5166b255..279bafcd 100644
--- a/install/debian/10/exim/dnsbl.conf
+++ b/install/debian/10/exim/dnsbl.conf
@@ -1,2 +1 @@
bl.spamcop.net
-zen.spamhaus.org
diff --git a/install/debian/10/exim/exim4.conf.template b/install/debian/10/exim/exim4.conf.template
index 95e9bc48..0e5afaac 100644
--- a/install/debian/10/exim/exim4.conf.template
+++ b/install/debian/10/exim/exim4.conf.template
@@ -25,12 +25,19 @@ acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
acl_smtp_mime = acl_check_mime
+recipients_max = 15
+recipients_max_reject = true
+
+# log_selector = +smtp_connection
+smtp_accept_max = 50
+smtp_accept_max_per_host = 4
+
.ifdef SPAMASSASSIN
spamd_address = 127.0.0.1 783
.endif
.ifdef CLAMD
-av_scanner = clamd: /var/lib/clamav/clamd.sock
+av_scanner = clamd: /var/run/clamav/clamd.ctl
.endif
tls_advertise_hosts = *
@@ -84,16 +91,18 @@ acl_check_mail:
deny condition = ${if eq{$sender_helo_name}{}}
message = HELO required before MAIL
- drop message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid
+ drop !authenticated = *
+ message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid
condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}}
- condition = ${if match{${lc:$sender_host_name}}{.telenor.rs}{false}{true}}
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}}
delay = 45s
- drop condition = ${if isip{$sender_helo_name}}
+ drop !authenticated = *
+ condition = ${if isip{$sender_helo_name}}
message = Access denied - Invalid HELO name (See RFC2821 4.1.3)
- drop condition = ${if eq{[$interface_address]}{$sender_helo_name}}
+ drop !authenticated = *
+ condition = ${if eq{[$interface_address]}{$sender_helo_name}}
message = $interface_address is _my_ address
accept
@@ -167,7 +176,7 @@ acl_check_data:
.ifdef SPAMASSASSIN
warn !authenticated = *
hosts = !+relay_from_hosts
- condition = ${if < {$message_size}{100K}}
+ condition = ${if < {$message_size}{600K}}
condition = ${if eq{$acl_m1}{yes}{yes}{no}}
spam = nobody:true/defer_ok
add_header = X-Spam-Score: $spam_score_int
@@ -240,6 +249,8 @@ userforward:
driver = redirect
check_local_user
file = $home/.forward
+ require_files = ${local_part}:+${home}/.forward
+ domains = +local_domains
allow_filter
no_verify
no_expn
diff --git a/install/debian/10/mysql/my-large.cnf b/install/debian/10/mysql/my-large.cnf
index febfda66..b056c316 100644
--- a/install/debian/10/mysql/my-large.cnf
+++ b/install/debian/10/mysql/my-large.cnf
@@ -1,11 +1,18 @@
[client]
+default-character-set=utf8mb4
port=3306
socket=/var/run/mysqld/mysqld.sock
[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock
+[mysql]
+default-character-set=utf8mb4
+
[mysqld]
+collation-server = utf8mb4_unicode_520_ci
+init-connect='SET NAMES utf8mb4'
+character-set-server = utf8mb4
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
diff --git a/install/debian/10/mysql/my-medium.cnf b/install/debian/10/mysql/my-medium.cnf
index 3aa8fe22..33aa04c2 100644
--- a/install/debian/10/mysql/my-medium.cnf
+++ b/install/debian/10/mysql/my-medium.cnf
@@ -1,11 +1,18 @@
[client]
+default-character-set=utf8mb4
port=3306
socket=/var/run/mysqld/mysqld.sock
[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock
+[mysql]
+default-character-set=utf8mb4
+
[mysqld]
+collation-server = utf8mb4_unicode_520_ci
+init-connect='SET NAMES utf8mb4'
+character-set-server = utf8mb4
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
diff --git a/install/debian/10/mysql/my-small.cnf b/install/debian/10/mysql/my-small.cnf
index bd53770b..857f48ce 100644
--- a/install/debian/10/mysql/my-small.cnf
+++ b/install/debian/10/mysql/my-small.cnf
@@ -1,11 +1,18 @@
[client]
+default-character-set=utf8mb4
port=3306
socket=/var/run/mysqld/mysqld.sock
[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock
+[mysql]
+default-character-set=utf8mb4
+
[mysqld]
+collation-server = utf8mb4_unicode_520_ci
+init-connect='SET NAMES utf8mb4'
+character-set-server = utf8mb4
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
diff --git a/install/debian/10/nginx/nginx.conf b/install/debian/10/nginx/nginx.conf
index ccf657de..6d5e36ba 100644
--- a/install/debian/10/nginx/nginx.conf
+++ b/install/debian/10/nginx/nginx.conf
@@ -77,6 +77,8 @@ http {
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
+ set_real_ip_from 104.16.0.0/13;
+ set_real_ip_from 104.24.0.0/14;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
@@ -84,7 +86,6 @@ http {
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
- set_real_ip_from 104.16.0.0/12;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 2400:cb00::/32;
diff --git a/install/debian/10/pma/pma.sh b/install/debian/10/pma/pma.sh
index 53ec9982..f04f3f8e 100644
--- a/install/debian/10/pma/pma.sh
+++ b/install/debian/10/pma/pma.sh
@@ -134,8 +134,8 @@ PMAUSER=pma
#DROP USER and TABLE
mysql -uroot <
VRootEngine on
VRootAlias /etc/security/pam_env.conf etc/security/pam_env.conf
diff --git a/install/debian/10/proftpd/tls.conf b/install/debian/10/proftpd/tls.conf
new file mode 100644
index 00000000..9da0017b
--- /dev/null
+++ b/install/debian/10/proftpd/tls.conf
@@ -0,0 +1,63 @@
+#
+# Proftpd sample configuration for FTPS connections.
+#
+# Note that FTPS impose some limitations in NAT traversing.
+# See http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-TLS.html
+# for more information.
+#
+
+ # If mod_tls was built as a shared/DSO module, load it
+ LoadModule mod_tls.c
+
+
+TLSEngine on
+TLSLog /var/log/proftpd/tls.log
+# this is an example of protocols, proftp works witl all, but use only the most secure ones like TLSv1.1 and TLSv1.2
+TLSProtocol TLSv1.1 TLSv1.2
+#
+# Server SSL certificate. You can generate a self-signed certificate using
+# a command like:
+#
+# openssl req -x509 -newkey rsa:1024 \
+# -keyout /etc/ssl/private/proftpd.key -out /etc/ssl/certs/proftpd.crt \
+# -nodes -days 365
+#
+# The proftpd.key file must be readable by root only. The other file can be
+# readable by anyone.
+#
+# chmod 0600 /etc/ssl/private/proftpd.key
+# chmod 0640 /etc/ssl/private/proftpd.key
+#
+TLSRSACertificateFile /usr/local/vesta/ssl/certificate.crt
+TLSRSACertificateKeyFile /usr/local/vesta/ssl/certificate.key
+#
+# CA the server trusts...
+#TLSCACertificateFile /etc/ssl/certs/CA.pem
+# ...or avoid CA cert and be verbose
+#TLSOptions NoCertRequest EnableDiags
+# ... or the same with relaxed session use for some clients (e.g. FireFtp)
+#TLSOptions NoCertRequest EnableDiags NoSessionReuseRequired
+#
+#
+# Per default drop connection if client tries to start a renegotiate
+# This is a fix for CVE-2009-3555 but could break some clients.
+#
+#TLSOptions AllowClientRenegotiations
+#
+TLSOptions NoSessionReuseRequired AllowClientRenegotiations
+# Authenticate clients that want to use FTP over TLS?
+#
+#TLSVerifyClient off
+#
+# Are clients required to use FTP over TLS when talking to this server?
+#
+TLSRequired off
+#
+# Allow SSL/TLS renegotiations when the client requests them, but
+# do not force the renegotations. Some clients do not support
+# SSL/TLS renegotiations; when mod_tls forces a renegotiation, these
+# clients will close the data connection, or there will be a timeout
+# on an idle data connection.
+#
+TLSRenegotiate required off
+
diff --git a/install/debian/10/templates/web/apache2/PHP-FPM-73-public.sh b/install/debian/10/templates/web/apache2/PHP-FPM-73-public.sh
index cc55b61e..a2fea927 100755
--- a/install/debian/10/templates/web/apache2/PHP-FPM-73-public.sh
+++ b/install/debian/10/templates/web/apache2/PHP-FPM-73-public.sh
@@ -17,8 +17,8 @@ user = $1
group = $1
pm = ondemand
-pm.max_children = 16
-request_terminate_timeout = 30s
+pm.max_children = 8
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 20
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -45,25 +45,31 @@ pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
write_file=0
@@ -75,14 +81,25 @@ else
write_file=1
fi
fi
-
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_73
- service php7.3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
-
if [ -f "/etc/php/7.3/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.3/fpm/pool.d/www.conf
fi
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
exit 0
diff --git a/install/debian/10/templates/web/apache2/PHP-FPM-73-public.stpl b/install/debian/10/templates/web/apache2/PHP-FPM-73-public.stpl
index 9660c234..39777224 100644
--- a/install/debian/10/templates/web/apache2/PHP-FPM-73-public.stpl
+++ b/install/debian/10/templates/web/apache2/PHP-FPM-73-public.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/install/debian/10/templates/web/apache2/PHP-FPM-73-public.tpl b/install/debian/10/templates/web/apache2/PHP-FPM-73-public.tpl
index 892c0d1f..b6e306d7 100644
--- a/install/debian/10/templates/web/apache2/PHP-FPM-73-public.tpl
+++ b/install/debian/10/templates/web/apache2/PHP-FPM-73-public.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/install/debian/10/templates/web/apache2/PHP-FPM-73.sh b/install/debian/10/templates/web/apache2/PHP-FPM-73.sh
index 546fb7c3..a2fea927 100755
--- a/install/debian/10/templates/web/apache2/PHP-FPM-73.sh
+++ b/install/debian/10/templates/web/apache2/PHP-FPM-73.sh
@@ -17,8 +17,8 @@ user = $1
group = $1
pm = ondemand
-pm.max_children = 16
-request_terminate_timeout = 30s
+pm.max_children = 8
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 20
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -45,25 +45,31 @@ pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
write_file=0
@@ -77,11 +83,23 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_73
- service php7.3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
-
if [ -f "/etc/php/7.3/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.3/fpm/pool.d/www.conf
fi
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
exit 0
diff --git a/install/debian/10/templates/web/apache2/PHP-FPM-73.stpl b/install/debian/10/templates/web/apache2/PHP-FPM-73.stpl
index 28224413..902d647a 100644
--- a/install/debian/10/templates/web/apache2/PHP-FPM-73.stpl
+++ b/install/debian/10/templates/web/apache2/PHP-FPM-73.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/install/debian/10/templates/web/apache2/PHP-FPM-73.tpl b/install/debian/10/templates/web/apache2/PHP-FPM-73.tpl
index 7bec5e73..40df2629 100644
--- a/install/debian/10/templates/web/apache2/PHP-FPM-73.tpl
+++ b/install/debian/10/templates/web/apache2/PHP-FPM-73.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/install/debian/10/templates/web/awstats/awstats.tpl b/install/debian/10/templates/web/awstats/awstats.tpl
index 9a92e0fd..6bb51c50 100755
--- a/install/debian/10/templates/web/awstats/awstats.tpl
+++ b/install/debian/10/templates/web/awstats/awstats.tpl
@@ -24,7 +24,7 @@ PurgeLogFile=0
ArchiveLogRecords=0
KeepBackupOfHistoricFiles=1
DefaultFile="index.php index.html"
-SkipHosts="127.0.0.1
+SkipHosts="127.0.0.1"
SkipUserAgents=""
SkipFiles=""
SkipReferrersBlackList=""
diff --git a/install/debian/10/templates/web/nginx/caching.stpl b/install/debian/10/templates/web/nginx/caching.stpl
index 868e2fe9..f5c9740f 100644
--- a/install/debian/10/templates/web/nginx/caching.stpl
+++ b/install/debian/10/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/caching.tpl b/install/debian/10/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100644
--- a/install/debian/10/templates/web/nginx/caching.tpl
+++ b/install/debian/10/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/force-https-legacy.stpl b/install/debian/10/templates/web/nginx/force-https-legacy.stpl
index 56278e86..79e55a26 100644
--- a/install/debian/10/templates/web/nginx/force-https-legacy.stpl
+++ b/install/debian/10/templates/web/nginx/force-https-legacy.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -26,6 +26,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/force-https-legacy.tpl b/install/debian/10/templates/web/nginx/force-https-legacy.tpl
index 851ac0dc..5a463370 100644
--- a/install/debian/10/templates/web/nginx/force-https-legacy.tpl
+++ b/install/debian/10/templates/web/nginx/force-https-legacy.tpl
@@ -2,7 +2,7 @@ server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
location / {
- rewrite ^(.*) https://%domain_idn%$1 permanent;
+ rewrite ^(.*) https://$host$1 permanent;
}
include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt;
}
diff --git a/install/debian/10/templates/web/nginx/force-https-public.stpl b/install/debian/10/templates/web/nginx/force-https-public.stpl
index 8f0d3fe3..ac422df6 100644
--- a/install/debian/10/templates/web/nginx/force-https-public.stpl
+++ b/install/debian/10/templates/web/nginx/force-https-public.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -26,6 +26,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/force-https-public.tpl b/install/debian/10/templates/web/nginx/force-https-public.tpl
index 851ac0dc..5a463370 100644
--- a/install/debian/10/templates/web/nginx/force-https-public.tpl
+++ b/install/debian/10/templates/web/nginx/force-https-public.tpl
@@ -2,7 +2,7 @@ server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
location / {
- rewrite ^(.*) https://%domain_idn%$1 permanent;
+ rewrite ^(.*) https://$host$1 permanent;
}
include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt;
}
diff --git a/install/debian/10/templates/web/nginx/force-https-webmail-phpmyadmin.stpl b/install/debian/10/templates/web/nginx/force-https-webmail-phpmyadmin.stpl
index 4fadbbfc..7e0e71d1 100644
--- a/install/debian/10/templates/web/nginx/force-https-webmail-phpmyadmin.stpl
+++ b/install/debian/10/templates/web/nginx/force-https-webmail-phpmyadmin.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -50,6 +50,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/force-https-webmail-phpmyadmin.tpl b/install/debian/10/templates/web/nginx/force-https-webmail-phpmyadmin.tpl
index 851ac0dc..5a463370 100644
--- a/install/debian/10/templates/web/nginx/force-https-webmail-phpmyadmin.tpl
+++ b/install/debian/10/templates/web/nginx/force-https-webmail-phpmyadmin.tpl
@@ -2,7 +2,7 @@ server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
location / {
- rewrite ^(.*) https://%domain_idn%$1 permanent;
+ rewrite ^(.*) https://$host$1 permanent;
}
include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt;
}
diff --git a/install/debian/10/templates/web/nginx/force-https.stpl b/install/debian/10/templates/web/nginx/force-https.stpl
index 7da96e46..33fab443 100644
--- a/install/debian/10/templates/web/nginx/force-https.stpl
+++ b/install/debian/10/templates/web/nginx/force-https.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -26,6 +26,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/force-https.tpl b/install/debian/10/templates/web/nginx/force-https.tpl
index 851ac0dc..5a463370 100644
--- a/install/debian/10/templates/web/nginx/force-https.tpl
+++ b/install/debian/10/templates/web/nginx/force-https.tpl
@@ -2,7 +2,7 @@ server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
location / {
- rewrite ^(.*) https://%domain_idn%$1 permanent;
+ rewrite ^(.*) https://$host$1 permanent;
}
include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt;
}
diff --git a/install/debian/10/templates/web/nginx/hosting-legacy.stpl b/install/debian/10/templates/web/nginx/hosting-legacy.stpl
index d62b5171..a34b4bf1 100644
--- a/install/debian/10/templates/web/nginx/hosting-legacy.stpl
+++ b/install/debian/10/templates/web/nginx/hosting-legacy.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -26,6 +26,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/hosting-legacy.tpl b/install/debian/10/templates/web/nginx/hosting-legacy.tpl
index 15961c95..a41d4054 100644
--- a/install/debian/10/templates/web/nginx/hosting-legacy.tpl
+++ b/install/debian/10/templates/web/nginx/hosting-legacy.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/hosting-public.stpl b/install/debian/10/templates/web/nginx/hosting-public.stpl
index 8f0d3fe3..ac422df6 100644
--- a/install/debian/10/templates/web/nginx/hosting-public.stpl
+++ b/install/debian/10/templates/web/nginx/hosting-public.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -26,6 +26,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/hosting-public.tpl b/install/debian/10/templates/web/nginx/hosting-public.tpl
index 9ff417ba..f5d8b327 100644
--- a/install/debian/10/templates/web/nginx/hosting-public.tpl
+++ b/install/debian/10/templates/web/nginx/hosting-public.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.stpl b/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.stpl
index 4fadbbfc..7e0e71d1 100644
--- a/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.stpl
+++ b/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -50,6 +50,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.tpl b/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.tpl
index 5f601672..f84f4781 100644
--- a/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.tpl
+++ b/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.tpl
@@ -47,6 +47,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/hosting.stpl b/install/debian/10/templates/web/nginx/hosting.stpl
index 0c456c5e..755caadf 100644
--- a/install/debian/10/templates/web/nginx/hosting.stpl
+++ b/install/debian/10/templates/web/nginx/hosting.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -26,6 +26,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/hosting.tpl b/install/debian/10/templates/web/nginx/hosting.tpl
index 262417b1..61469ad2 100644
--- a/install/debian/10/templates/web/nginx/hosting.tpl
+++ b/install/debian/10/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/php-fpm/cms_made_simple.stpl b/install/debian/10/templates/web/nginx/php-fpm/cms_made_simple.stpl
index d85bcce3..cf8fad56 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/cms_made_simple.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/cms_made_simple.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/codeigniter2.stpl b/install/debian/10/templates/web/nginx/php-fpm/codeigniter2.stpl
index 9c24c3ea..5931f617 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/codeigniter2.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/codeigniter2.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/codeigniter3.stpl b/install/debian/10/templates/web/nginx/php-fpm/codeigniter3.stpl
index d7186314..3c2793d1 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/codeigniter3.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/codeigniter3.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/datalife_engine.stpl b/install/debian/10/templates/web/nginx/php-fpm/datalife_engine.stpl
index 4f0b9ec7..bb9a727b 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/datalife_engine.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/datalife_engine.stpl
@@ -1,13 +1,12 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
-
- ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/default.stpl b/install/debian/10/templates/web/nginx/php-fpm/default.stpl
index 5cb55311..f9c01e40 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/default.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/default.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/default_host.stpl b/install/debian/10/templates/web/nginx/php-fpm/default_host.stpl
new file mode 100644
index 00000000..005705ce
--- /dev/null
+++ b/install/debian/10/templates/web/nginx/php-fpm/default_host.stpl
@@ -0,0 +1,62 @@
+###
+# this file directory:
+# /usr/local/vesta/data/templates/web/nginx/php-fpm/default_host.stpl
+#
+#
+###
+server {
+ listen %ip%:%web_ssl_port% ssl http2 default_server;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires 1d;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ access_log off;
+ log_not_found off;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/debian/10/templates/web/nginx/php-fpm/default_host.tpl b/install/debian/10/templates/web/nginx/php-fpm/default_host.tpl
new file mode 100644
index 00000000..45b8476e
--- /dev/null
+++ b/install/debian/10/templates/web/nginx/php-fpm/default_host.tpl
@@ -0,0 +1,77 @@
+#
+# this file directory: /usr/local/vesta/data/templates/web/nginx/php-fpm/
+#
+server {
+ listen %ip%:%web_port% default_server;
+ server_name %domain_idn% %alias_idn%;
+ # redirect http > httpS (www cut)
+ return 301 https://%domain_idn%$request_uri;
+ root %docroot%;
+ index index.php index.html;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ # запрещаем всем доступ
+ # access is denied to everyone
+ deny all;
+ # не засоряем лог отказом в доступе
+ # we do not clog the blog with access denial
+ access_log off;
+ log_not_found off;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location /vstats/ {
+ alias %home%/%user%/web/%domain%/stats/;
+ include %home%/%user%/conf/web/%domain%.auth*;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+
+ gzip on;
+ gzip_static on;
+ gzip_proxied any;
+ gzip_min_length 512;
+ gzip_buffers 16 8k;
+ gzip_comp_level 3;
+ gzip_vary on;
+ gzip_types
+ application/atom+xml
+ application/javascript
+ application/json
+ application/ld+json
+ application/manifest+json
+ application/rss+xml
+ application/vnd.geo+json
+ application/vnd.ms-fontobject
+ application/x-font-ttf
+ application/x-web-app-manifest+json
+ application/xhtml+xml
+ application/xml
+ font/opentype
+ image/bmp
+ image/svg+xml
+ image/x-icon
+ text/cache-manifest
+ text/css
+ text/plain
+ text/vcard
+ text/vnd.rim.location.xloc
+ text/vtt
+ text/x-component
+ text/x-cross-domain-policy;
+}
diff --git a/install/debian/10/templates/web/nginx/php-fpm/dokuwiki.stpl b/install/debian/10/templates/web/nginx/php-fpm/dokuwiki.stpl
index f85032ba..a7564705 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/dokuwiki.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/dokuwiki.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/drupal6.stpl b/install/debian/10/templates/web/nginx/php-fpm/drupal6.stpl
index 0af7ce84..6e67a4e0 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/drupal6.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/drupal6.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/drupal7.stpl b/install/debian/10/templates/web/nginx/php-fpm/drupal7.stpl
index 030ea952..32f01a6f 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/drupal7.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/drupal7.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/drupal8.stpl b/install/debian/10/templates/web/nginx/php-fpm/drupal8.stpl
index 030ea952..32f01a6f 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/drupal8.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/drupal8.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/joomla.stpl b/install/debian/10/templates/web/nginx/php-fpm/joomla.stpl
index 704405f3..d4f96ee3 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/joomla.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/joomla.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/laravel.stpl b/install/debian/10/templates/web/nginx/php-fpm/laravel.stpl
index 477f6f01..db0b4dde 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/laravel.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/laravel.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%/public;
index index.php index.html index.htm;
@@ -7,8 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
-
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/magento.stpl b/install/debian/10/templates/web/nginx/php-fpm/magento.stpl
index fdab43aa..f8ac30c9 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/magento.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/magento.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%/pub;
@@ -9,7 +9,6 @@ server {
error_page 404 403 = /errors/404.php;
add_header "X-UA-Compatible" "IE=Edge";
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/modx.stpl b/install/debian/10/templates/web/nginx/php-fpm/modx.stpl
index f410ab77..420aeb9e 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/modx.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/modx.stpl
@@ -1,13 +1,12 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
-
- ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
# if you need to rewrite www to non-www uncomment bellow
diff --git a/install/debian/10/templates/web/nginx/php-fpm/moodle.stpl b/install/debian/10/templates/web/nginx/php-fpm/moodle.stpl
index f15a68c5..8594ec94 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/moodle.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/moodle.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/no-php.stpl b/install/debian/10/templates/web/nginx/php-fpm/no-php.stpl
index bc8b53a3..4bb50383 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/no-php.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/no-php.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/odoo.stpl b/install/debian/10/templates/web/nginx/php-fpm/odoo.stpl
index d6697d7a..e28afcfc 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/odoo.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/odoo.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/opencart.stpl b/install/debian/10/templates/web/nginx/php-fpm/opencart.stpl
index 908b9aeb..52706d21 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/opencart.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/opencart.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/owncloud.stpl b/install/debian/10/templates/web/nginx/php-fpm/owncloud.stpl
index 891566b9..1b803f97 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/owncloud.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/owncloud.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/piwik.stpl b/install/debian/10/templates/web/nginx/php-fpm/piwik.stpl
index 78c1bb78..1b299343 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/piwik.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/piwik.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/pyrocms.stpl b/install/debian/10/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..d26ed9f4 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%/public;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
@@ -37,7 +36,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/pyrocms.tpl b/install/debian/10/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/wordpress.stpl b/install/debian/10/templates/web/nginx/php-fpm/wordpress.stpl
index 5cb55311..f9c01e40 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/wordpress.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/wordpress.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/wordpress2.stpl b/install/debian/10/templates/web/nginx/php-fpm/wordpress2.stpl
index e0aeb524..01dfee5b 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/wordpress2.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/wordpress2.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/php-fpm/wordpress2_rewrite.stpl b/install/debian/10/templates/web/nginx/php-fpm/wordpress2_rewrite.stpl
index 0d933b30..a5fc46fb 100644
--- a/install/debian/10/templates/web/nginx/php-fpm/wordpress2_rewrite.stpl
+++ b/install/debian/10/templates/web/nginx/php-fpm/wordpress2_rewrite.stpl
@@ -1,5 +1,5 @@
server {
- listen %ip%:%web_ssl_port%;
+ listen %ip%:%web_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
root %docroot%;
index index.php index.html index.htm;
@@ -7,7 +7,6 @@ server {
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
- ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
diff --git a/install/debian/10/templates/web/nginx/private-force-https.stpl b/install/debian/10/templates/web/nginx/private-force-https.stpl
index 38532e6b..64094fb8 100644
--- a/install/debian/10/templates/web/nginx/private-force-https.stpl
+++ b/install/debian/10/templates/web/nginx/private-force-https.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -28,6 +28,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/private-force-https.tpl b/install/debian/10/templates/web/nginx/private-force-https.tpl
index 851ac0dc..5a463370 100644
--- a/install/debian/10/templates/web/nginx/private-force-https.tpl
+++ b/install/debian/10/templates/web/nginx/private-force-https.tpl
@@ -2,7 +2,7 @@ server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
location / {
- rewrite ^(.*) https://%domain_idn%$1 permanent;
+ rewrite ^(.*) https://$host$1 permanent;
}
include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt;
}
diff --git a/install/debian/10/templates/web/nginx/private-hosting.sh b/install/debian/10/templates/web/nginx/private-hosting.sh
index abc9155d..eeed37ef 100755
--- a/install/debian/10/templates/web/nginx/private-hosting.sh
+++ b/install/debian/10/templates/web/nginx/private-hosting.sh
@@ -1,11 +1,11 @@
-#!/bin/bash
-# Changing public_html permission
-user="$1"
-domain="$2"
-ip="$3"
-home_dir="$4"
-docroot="$5"
-
-chmod 755 $docroot
-
-exit 0
+#!/bin/bash
+# Changing public_html permission
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+chmod 755 $docroot
+
+exit 0
diff --git a/install/debian/10/templates/web/nginx/private-hosting.stpl b/install/debian/10/templates/web/nginx/private-hosting.stpl
index d7326a46..fd9471bd 100644
--- a/install/debian/10/templates/web/nginx/private-hosting.stpl
+++ b/install/debian/10/templates/web/nginx/private-hosting.stpl
@@ -1,7 +1,7 @@
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
- # ssl on;
+
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
@@ -28,6 +28,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/nginx/private-hosting.tpl b/install/debian/10/templates/web/nginx/private-hosting.tpl
index da70045f..a8ee840e 100644
--- a/install/debian/10/templates/web/nginx/private-hosting.tpl
+++ b/install/debian/10/templates/web/nginx/private-hosting.tpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/debian/10/templates/web/skel/public_html/index.html b/install/debian/10/templates/web/skel/public_html/index.html
index 9b8789e8..c2895cf2 100755
--- a/install/debian/10/templates/web/skel/public_html/index.html
+++ b/install/debian/10/templates/web/skel/public_html/index.html
@@ -18,7 +18,7 @@
+ It seems that the page you were trying to reach does not exist anymore, or maybe it has just moved.
+ You can start again from the home or go back to previous page.
+
+ It seems that the page you were trying to reach does not exist anymore, or maybe it has just moved.
+ You can start again from the home or go back to previous page.
+
+ It seems that the page you were trying to reach does not exist anymore, or maybe it has just moved.
+ You can start again from the home or go back to previous page.
+
diff --git a/install/rhel/5/templates/web/nginx/caching.stpl b/install/rhel/5/templates/web/nginx/caching.stpl
index 5e1ac757..720b880b 100755
--- a/install/rhel/5/templates/web/nginx/caching.stpl
+++ b/install/rhel/5/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/5/templates/web/nginx/caching.tpl b/install/rhel/5/templates/web/nginx/caching.tpl
index 6d727c67..fc721982 100755
--- a/install/rhel/5/templates/web/nginx/caching.tpl
+++ b/install/rhel/5/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/5/templates/web/nginx/default.stpl b/install/rhel/5/templates/web/nginx/default.stpl
index 22bbd55a..92804815 100755
--- a/install/rhel/5/templates/web/nginx/default.stpl
+++ b/install/rhel/5/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/5/templates/web/nginx/default.tpl b/install/rhel/5/templates/web/nginx/default.tpl
index c1fec114..e49081a5 100755
--- a/install/rhel/5/templates/web/nginx/default.tpl
+++ b/install/rhel/5/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/5/templates/web/nginx/hosting.stpl b/install/rhel/5/templates/web/nginx/hosting.stpl
index c3414149..10dae25e 100755
--- a/install/rhel/5/templates/web/nginx/hosting.stpl
+++ b/install/rhel/5/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/5/templates/web/nginx/hosting.tpl b/install/rhel/5/templates/web/nginx/hosting.tpl
index 44d87496..de42b9df 100755
--- a/install/rhel/5/templates/web/nginx/hosting.tpl
+++ b/install/rhel/5/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/5/templates/web/nginx/http2.stpl b/install/rhel/5/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/rhel/5/templates/web/nginx/http2.stpl
+++ b/install/rhel/5/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/5/templates/web/nginx/http2.tpl b/install/rhel/5/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/rhel/5/templates/web/nginx/http2.tpl
+++ b/install/rhel/5/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/5/templates/web/nginx/php-fpm/pyrocms.stpl b/install/rhel/5/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/rhel/5/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/rhel/5/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/rhel/5/templates/web/nginx/php-fpm/pyrocms.tpl b/install/rhel/5/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/rhel/5/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/rhel/5/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/rhel/6/templates/web/nginx/caching.stpl b/install/rhel/6/templates/web/nginx/caching.stpl
index 5e1ac757..720b880b 100755
--- a/install/rhel/6/templates/web/nginx/caching.stpl
+++ b/install/rhel/6/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/6/templates/web/nginx/caching.tpl b/install/rhel/6/templates/web/nginx/caching.tpl
index 6d727c67..fc721982 100755
--- a/install/rhel/6/templates/web/nginx/caching.tpl
+++ b/install/rhel/6/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/6/templates/web/nginx/default.stpl b/install/rhel/6/templates/web/nginx/default.stpl
index 22bbd55a..92804815 100755
--- a/install/rhel/6/templates/web/nginx/default.stpl
+++ b/install/rhel/6/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/6/templates/web/nginx/default.tpl b/install/rhel/6/templates/web/nginx/default.tpl
index c1fec114..e49081a5 100755
--- a/install/rhel/6/templates/web/nginx/default.tpl
+++ b/install/rhel/6/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/6/templates/web/nginx/hosting.stpl b/install/rhel/6/templates/web/nginx/hosting.stpl
index c3414149..10dae25e 100755
--- a/install/rhel/6/templates/web/nginx/hosting.stpl
+++ b/install/rhel/6/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/6/templates/web/nginx/hosting.tpl b/install/rhel/6/templates/web/nginx/hosting.tpl
index 44d87496..de42b9df 100755
--- a/install/rhel/6/templates/web/nginx/hosting.tpl
+++ b/install/rhel/6/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/6/templates/web/nginx/http2.stpl b/install/rhel/6/templates/web/nginx/http2.stpl
index cfdb9188..0810e9d4 100644
--- a/install/rhel/6/templates/web/nginx/http2.stpl
+++ b/install/rhel/6/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/6/templates/web/nginx/http2.tpl b/install/rhel/6/templates/web/nginx/http2.tpl
index b20e2922..9344a7a9 100644
--- a/install/rhel/6/templates/web/nginx/http2.tpl
+++ b/install/rhel/6/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/6/templates/web/nginx/php-fpm/pyrocms.stpl b/install/rhel/6/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/rhel/6/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/rhel/6/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/rhel/6/templates/web/nginx/php-fpm/pyrocms.tpl b/install/rhel/6/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/rhel/6/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/rhel/6/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/rhel/7/templates/web/nginx/caching.stpl b/install/rhel/7/templates/web/nginx/caching.stpl
index 5e1ac757..720b880b 100755
--- a/install/rhel/7/templates/web/nginx/caching.stpl
+++ b/install/rhel/7/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/7/templates/web/nginx/caching.tpl b/install/rhel/7/templates/web/nginx/caching.tpl
index 6d727c67..fc721982 100755
--- a/install/rhel/7/templates/web/nginx/caching.tpl
+++ b/install/rhel/7/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/7/templates/web/nginx/default.stpl b/install/rhel/7/templates/web/nginx/default.stpl
index 22bbd55a..92804815 100755
--- a/install/rhel/7/templates/web/nginx/default.stpl
+++ b/install/rhel/7/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/7/templates/web/nginx/default.tpl b/install/rhel/7/templates/web/nginx/default.tpl
index c1fec114..e49081a5 100755
--- a/install/rhel/7/templates/web/nginx/default.tpl
+++ b/install/rhel/7/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/7/templates/web/nginx/hosting.stpl b/install/rhel/7/templates/web/nginx/hosting.stpl
index c3414149..10dae25e 100755
--- a/install/rhel/7/templates/web/nginx/hosting.stpl
+++ b/install/rhel/7/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/7/templates/web/nginx/hosting.tpl b/install/rhel/7/templates/web/nginx/hosting.tpl
index 44d87496..de42b9df 100755
--- a/install/rhel/7/templates/web/nginx/hosting.tpl
+++ b/install/rhel/7/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/7/templates/web/nginx/http2.stpl b/install/rhel/7/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/rhel/7/templates/web/nginx/http2.stpl
+++ b/install/rhel/7/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/7/templates/web/nginx/http2.tpl b/install/rhel/7/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/rhel/7/templates/web/nginx/http2.tpl
+++ b/install/rhel/7/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/rhel/7/templates/web/nginx/php-fpm/pyrocms.stpl b/install/rhel/7/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/rhel/7/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/rhel/7/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/rhel/7/templates/web/nginx/php-fpm/pyrocms.tpl b/install/rhel/7/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/rhel/7/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/rhel/7/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/12.04/templates/web/nginx/caching.stpl b/install/ubuntu/12.04/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/12.04/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/12.04/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.04/templates/web/nginx/caching.tpl b/install/ubuntu/12.04/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/12.04/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/12.04/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.04/templates/web/nginx/default.stpl b/install/ubuntu/12.04/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/12.04/templates/web/nginx/default.stpl
+++ b/install/ubuntu/12.04/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.04/templates/web/nginx/default.tpl b/install/ubuntu/12.04/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/12.04/templates/web/nginx/default.tpl
+++ b/install/ubuntu/12.04/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.04/templates/web/nginx/hosting.stpl b/install/ubuntu/12.04/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/12.04/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/12.04/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.04/templates/web/nginx/hosting.tpl b/install/ubuntu/12.04/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/12.04/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/12.04/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.04/templates/web/nginx/http2.stpl b/install/ubuntu/12.04/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/12.04/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/12.04/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.04/templates/web/nginx/http2.tpl b/install/ubuntu/12.04/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/12.04/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/12.04/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/12.04/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/12.04/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/12.04/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/12.04/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/12.04/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/12.04/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/12.04/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/12.10/templates/web/nginx/caching.stpl b/install/ubuntu/12.10/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/12.10/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/12.10/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.10/templates/web/nginx/caching.tpl b/install/ubuntu/12.10/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/12.10/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/12.10/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.10/templates/web/nginx/default.stpl b/install/ubuntu/12.10/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/12.10/templates/web/nginx/default.stpl
+++ b/install/ubuntu/12.10/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.10/templates/web/nginx/default.tpl b/install/ubuntu/12.10/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/12.10/templates/web/nginx/default.tpl
+++ b/install/ubuntu/12.10/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.10/templates/web/nginx/hosting.stpl b/install/ubuntu/12.10/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/12.10/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/12.10/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.10/templates/web/nginx/hosting.tpl b/install/ubuntu/12.10/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/12.10/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/12.10/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.10/templates/web/nginx/http2.stpl b/install/ubuntu/12.10/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/12.10/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/12.10/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.10/templates/web/nginx/http2.tpl b/install/ubuntu/12.10/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/12.10/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/12.10/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/12.10/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/12.10/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/12.10/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/12.10/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/12.10/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/12.10/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/12.10/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/13.04/templates/web/nginx/caching.stpl b/install/ubuntu/13.04/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/13.04/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/13.04/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.04/templates/web/nginx/caching.tpl b/install/ubuntu/13.04/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/13.04/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/13.04/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.04/templates/web/nginx/default.stpl b/install/ubuntu/13.04/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/13.04/templates/web/nginx/default.stpl
+++ b/install/ubuntu/13.04/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.04/templates/web/nginx/default.tpl b/install/ubuntu/13.04/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/13.04/templates/web/nginx/default.tpl
+++ b/install/ubuntu/13.04/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.04/templates/web/nginx/hosting.stpl b/install/ubuntu/13.04/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/13.04/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/13.04/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.04/templates/web/nginx/hosting.tpl b/install/ubuntu/13.04/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/13.04/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/13.04/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.04/templates/web/nginx/http2.stpl b/install/ubuntu/13.04/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/13.04/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/13.04/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.04/templates/web/nginx/http2.tpl b/install/ubuntu/13.04/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/13.04/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/13.04/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/13.04/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/13.04/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/13.04/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/13.04/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/13.04/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/13.04/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/13.04/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/13.10/templates/web/nginx/caching.stpl b/install/ubuntu/13.10/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/13.10/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/13.10/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.10/templates/web/nginx/caching.tpl b/install/ubuntu/13.10/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/13.10/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/13.10/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.10/templates/web/nginx/default.stpl b/install/ubuntu/13.10/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/13.10/templates/web/nginx/default.stpl
+++ b/install/ubuntu/13.10/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.10/templates/web/nginx/default.tpl b/install/ubuntu/13.10/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/13.10/templates/web/nginx/default.tpl
+++ b/install/ubuntu/13.10/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.10/templates/web/nginx/hosting.stpl b/install/ubuntu/13.10/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/13.10/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/13.10/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.10/templates/web/nginx/hosting.tpl b/install/ubuntu/13.10/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/13.10/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/13.10/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.10/templates/web/nginx/http2.stpl b/install/ubuntu/13.10/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/13.10/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/13.10/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.10/templates/web/nginx/http2.tpl b/install/ubuntu/13.10/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/13.10/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/13.10/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/13.10/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/13.10/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/13.10/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/13.10/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/13.10/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/13.10/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/13.10/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/14.04/templates/web/nginx/caching.stpl b/install/ubuntu/14.04/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/14.04/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/14.04/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.04/templates/web/nginx/caching.tpl b/install/ubuntu/14.04/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/14.04/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/14.04/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.04/templates/web/nginx/default.stpl b/install/ubuntu/14.04/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/14.04/templates/web/nginx/default.stpl
+++ b/install/ubuntu/14.04/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.04/templates/web/nginx/default.tpl b/install/ubuntu/14.04/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/14.04/templates/web/nginx/default.tpl
+++ b/install/ubuntu/14.04/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.04/templates/web/nginx/hosting.stpl b/install/ubuntu/14.04/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/14.04/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/14.04/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.04/templates/web/nginx/hosting.tpl b/install/ubuntu/14.04/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/14.04/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/14.04/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.04/templates/web/nginx/http2.stpl b/install/ubuntu/14.04/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/14.04/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/14.04/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.04/templates/web/nginx/http2.tpl b/install/ubuntu/14.04/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/14.04/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/14.04/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/14.04/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/14.04/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/14.04/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/14.04/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/14.04/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/14.04/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/14.04/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/14.10/templates/web/nginx/caching.stpl b/install/ubuntu/14.10/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/14.10/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/14.10/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.10/templates/web/nginx/caching.tpl b/install/ubuntu/14.10/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/14.10/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/14.10/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.10/templates/web/nginx/default.stpl b/install/ubuntu/14.10/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/14.10/templates/web/nginx/default.stpl
+++ b/install/ubuntu/14.10/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.10/templates/web/nginx/default.tpl b/install/ubuntu/14.10/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/14.10/templates/web/nginx/default.tpl
+++ b/install/ubuntu/14.10/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.10/templates/web/nginx/hosting.stpl b/install/ubuntu/14.10/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/14.10/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/14.10/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.10/templates/web/nginx/hosting.tpl b/install/ubuntu/14.10/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/14.10/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/14.10/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.10/templates/web/nginx/http2.stpl b/install/ubuntu/14.10/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/14.10/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/14.10/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.10/templates/web/nginx/http2.tpl b/install/ubuntu/14.10/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/14.10/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/14.10/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/14.10/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/14.10/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/14.10/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/14.10/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/14.10/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/14.10/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/14.10/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/15.04/templates/web/nginx/caching.stpl b/install/ubuntu/15.04/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/15.04/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/15.04/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.04/templates/web/nginx/caching.tpl b/install/ubuntu/15.04/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/15.04/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/15.04/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.04/templates/web/nginx/default.stpl b/install/ubuntu/15.04/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/15.04/templates/web/nginx/default.stpl
+++ b/install/ubuntu/15.04/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.04/templates/web/nginx/default.tpl b/install/ubuntu/15.04/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/15.04/templates/web/nginx/default.tpl
+++ b/install/ubuntu/15.04/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.04/templates/web/nginx/hosting.stpl b/install/ubuntu/15.04/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/15.04/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/15.04/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.04/templates/web/nginx/hosting.tpl b/install/ubuntu/15.04/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/15.04/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/15.04/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.04/templates/web/nginx/http2.stpl b/install/ubuntu/15.04/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/15.04/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/15.04/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.04/templates/web/nginx/http2.tpl b/install/ubuntu/15.04/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/15.04/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/15.04/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/15.04/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/15.04/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/15.04/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/15.04/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/15.04/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/15.04/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/15.04/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/15.10/templates/web/nginx/caching.stpl b/install/ubuntu/15.10/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/15.10/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/15.10/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.10/templates/web/nginx/caching.tpl b/install/ubuntu/15.10/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/15.10/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/15.10/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.10/templates/web/nginx/default.stpl b/install/ubuntu/15.10/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/15.10/templates/web/nginx/default.stpl
+++ b/install/ubuntu/15.10/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.10/templates/web/nginx/default.tpl b/install/ubuntu/15.10/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/15.10/templates/web/nginx/default.tpl
+++ b/install/ubuntu/15.10/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.10/templates/web/nginx/hosting.stpl b/install/ubuntu/15.10/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/15.10/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/15.10/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.10/templates/web/nginx/hosting.tpl b/install/ubuntu/15.10/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/15.10/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/15.10/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.10/templates/web/nginx/http2.stpl b/install/ubuntu/15.10/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/15.10/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/15.10/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.10/templates/web/nginx/http2.tpl b/install/ubuntu/15.10/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/15.10/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/15.10/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/15.10/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/15.10/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/15.10/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/15.10/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/15.10/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/15.10/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/15.10/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/15.10/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/16.04/templates/web/nginx/caching.stpl b/install/ubuntu/16.04/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/16.04/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/16.04/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.04/templates/web/nginx/caching.tpl b/install/ubuntu/16.04/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/16.04/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/16.04/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.04/templates/web/nginx/default.stpl b/install/ubuntu/16.04/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/16.04/templates/web/nginx/default.stpl
+++ b/install/ubuntu/16.04/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.04/templates/web/nginx/default.tpl b/install/ubuntu/16.04/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/16.04/templates/web/nginx/default.tpl
+++ b/install/ubuntu/16.04/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.04/templates/web/nginx/hosting.stpl b/install/ubuntu/16.04/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/16.04/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/16.04/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.04/templates/web/nginx/hosting.tpl b/install/ubuntu/16.04/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/16.04/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/16.04/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.04/templates/web/nginx/http2.stpl b/install/ubuntu/16.04/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/16.04/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/16.04/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.04/templates/web/nginx/http2.tpl b/install/ubuntu/16.04/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/16.04/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/16.04/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.04/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/16.04/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/16.04/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/16.04/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/16.04/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/16.04/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/16.04/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/16.04/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/16.10/templates/web/nginx/caching.stpl b/install/ubuntu/16.10/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/16.10/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/16.10/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.10/templates/web/nginx/caching.tpl b/install/ubuntu/16.10/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/16.10/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/16.10/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.10/templates/web/nginx/default.stpl b/install/ubuntu/16.10/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/16.10/templates/web/nginx/default.stpl
+++ b/install/ubuntu/16.10/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.10/templates/web/nginx/default.tpl b/install/ubuntu/16.10/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/16.10/templates/web/nginx/default.tpl
+++ b/install/ubuntu/16.10/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.10/templates/web/nginx/hosting.stpl b/install/ubuntu/16.10/templates/web/nginx/hosting.stpl
index 62620789..fc70c266 100755
--- a/install/ubuntu/16.10/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/16.10/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.10/templates/web/nginx/hosting.tpl b/install/ubuntu/16.10/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/16.10/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/16.10/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.10/templates/web/nginx/http2.stpl b/install/ubuntu/16.10/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/16.10/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/16.10/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.10/templates/web/nginx/http2.tpl b/install/ubuntu/16.10/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/16.10/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/16.10/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/16.10/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/16.10/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/16.10/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/16.10/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/16.10/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/16.10/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/16.10/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/16.10/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/17.04/templates/web/nginx/caching.stpl b/install/ubuntu/17.04/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/17.04/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/17.04/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.04/templates/web/nginx/caching.tpl b/install/ubuntu/17.04/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/17.04/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/17.04/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.04/templates/web/nginx/default.stpl b/install/ubuntu/17.04/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/17.04/templates/web/nginx/default.stpl
+++ b/install/ubuntu/17.04/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.04/templates/web/nginx/default.tpl b/install/ubuntu/17.04/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/17.04/templates/web/nginx/default.tpl
+++ b/install/ubuntu/17.04/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.04/templates/web/nginx/hosting.stpl b/install/ubuntu/17.04/templates/web/nginx/hosting.stpl
index 1ef8994b..3e3567d6 100755
--- a/install/ubuntu/17.04/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/17.04/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.04/templates/web/nginx/hosting.tpl b/install/ubuntu/17.04/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/17.04/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/17.04/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.04/templates/web/nginx/http2.stpl b/install/ubuntu/17.04/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/17.04/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/17.04/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.04/templates/web/nginx/http2.tpl b/install/ubuntu/17.04/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/17.04/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/17.04/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.04/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/17.04/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/17.04/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/17.04/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/17.04/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/17.04/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/17.04/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/17.04/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/17.10/templates/web/nginx/caching.stpl b/install/ubuntu/17.10/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/17.10/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/17.10/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.10/templates/web/nginx/caching.tpl b/install/ubuntu/17.10/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/17.10/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/17.10/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.10/templates/web/nginx/default.stpl b/install/ubuntu/17.10/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/17.10/templates/web/nginx/default.stpl
+++ b/install/ubuntu/17.10/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.10/templates/web/nginx/default.tpl b/install/ubuntu/17.10/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/17.10/templates/web/nginx/default.tpl
+++ b/install/ubuntu/17.10/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.10/templates/web/nginx/hosting.stpl b/install/ubuntu/17.10/templates/web/nginx/hosting.stpl
index 1ef8994b..3e3567d6 100755
--- a/install/ubuntu/17.10/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/17.10/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.10/templates/web/nginx/hosting.tpl b/install/ubuntu/17.10/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/17.10/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/17.10/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.10/templates/web/nginx/http2.stpl b/install/ubuntu/17.10/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/17.10/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/17.10/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.10/templates/web/nginx/http2.tpl b/install/ubuntu/17.10/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/17.10/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/17.10/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/17.10/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/17.10/templates/web/nginx/php-fpm/pyrocms.stpl
index 5ffc9ed5..a721dd81 100644
--- a/install/ubuntu/17.10/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/17.10/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -37,7 +37,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/17.10/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/17.10/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/17.10/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/17.10/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/18.04/templates/web/nginx/caching.stpl b/install/ubuntu/18.04/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/18.04/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/18.04/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.04/templates/web/nginx/caching.tpl b/install/ubuntu/18.04/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/18.04/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/18.04/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.04/templates/web/nginx/default.stpl b/install/ubuntu/18.04/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/18.04/templates/web/nginx/default.stpl
+++ b/install/ubuntu/18.04/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.04/templates/web/nginx/default.tpl b/install/ubuntu/18.04/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/18.04/templates/web/nginx/default.tpl
+++ b/install/ubuntu/18.04/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.04/templates/web/nginx/hosting.stpl b/install/ubuntu/18.04/templates/web/nginx/hosting.stpl
index 1ef8994b..3e3567d6 100755
--- a/install/ubuntu/18.04/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/18.04/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.04/templates/web/nginx/hosting.tpl b/install/ubuntu/18.04/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/18.04/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/18.04/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.04/templates/web/nginx/http2.stpl b/install/ubuntu/18.04/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/18.04/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/18.04/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.04/templates/web/nginx/http2.tpl b/install/ubuntu/18.04/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/18.04/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/18.04/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.stpl
index c9f91854..b8bf770a 100644
--- a/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -36,7 +36,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/18.04/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/18.10/templates/web/nginx/caching.stpl b/install/ubuntu/18.10/templates/web/nginx/caching.stpl
index e149b98b..61b74814 100755
--- a/install/ubuntu/18.10/templates/web/nginx/caching.stpl
+++ b/install/ubuntu/18.10/templates/web/nginx/caching.stpl
@@ -34,6 +34,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.10/templates/web/nginx/caching.tpl b/install/ubuntu/18.10/templates/web/nginx/caching.tpl
index 36761b65..73de28d5 100755
--- a/install/ubuntu/18.10/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/18.10/templates/web/nginx/caching.tpl
@@ -32,6 +32,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.10/templates/web/nginx/default.stpl b/install/ubuntu/18.10/templates/web/nginx/default.stpl
index 0e669b3d..418305a8 100755
--- a/install/ubuntu/18.10/templates/web/nginx/default.stpl
+++ b/install/ubuntu/18.10/templates/web/nginx/default.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.10/templates/web/nginx/default.tpl b/install/ubuntu/18.10/templates/web/nginx/default.tpl
index 4d5c774b..bebd47a2 100755
--- a/install/ubuntu/18.10/templates/web/nginx/default.tpl
+++ b/install/ubuntu/18.10/templates/web/nginx/default.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.10/templates/web/nginx/hosting.stpl b/install/ubuntu/18.10/templates/web/nginx/hosting.stpl
index 1ef8994b..3e3567d6 100755
--- a/install/ubuntu/18.10/templates/web/nginx/hosting.stpl
+++ b/install/ubuntu/18.10/templates/web/nginx/hosting.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.10/templates/web/nginx/hosting.tpl b/install/ubuntu/18.10/templates/web/nginx/hosting.tpl
index 15961c95..a41d4054 100755
--- a/install/ubuntu/18.10/templates/web/nginx/hosting.tpl
+++ b/install/ubuntu/18.10/templates/web/nginx/hosting.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.10/templates/web/nginx/http2.stpl b/install/ubuntu/18.10/templates/web/nginx/http2.stpl
index f225becd..5a958ca4 100644
--- a/install/ubuntu/18.10/templates/web/nginx/http2.stpl
+++ b/install/ubuntu/18.10/templates/web/nginx/http2.stpl
@@ -25,6 +25,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.10/templates/web/nginx/http2.tpl b/install/ubuntu/18.10/templates/web/nginx/http2.tpl
index 4d5c774b..bebd47a2 100644
--- a/install/ubuntu/18.10/templates/web/nginx/http2.tpl
+++ b/install/ubuntu/18.10/templates/web/nginx/http2.tpl
@@ -23,6 +23,7 @@ server {
}
location ~ /\.ht {return 404;}
+ location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
diff --git a/install/ubuntu/18.10/templates/web/nginx/php-fpm/pyrocms.stpl b/install/ubuntu/18.10/templates/web/nginx/php-fpm/pyrocms.stpl
index c9f91854..b8bf770a 100644
--- a/install/ubuntu/18.10/templates/web/nginx/php-fpm/pyrocms.stpl
+++ b/install/ubuntu/18.10/templates/web/nginx/php-fpm/pyrocms.stpl
@@ -36,7 +36,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/ubuntu/18.10/templates/web/nginx/php-fpm/pyrocms.tpl b/install/ubuntu/18.10/templates/web/nginx/php-fpm/pyrocms.tpl
index 297fe0e8..b92861b0 100644
--- a/install/ubuntu/18.10/templates/web/nginx/php-fpm/pyrocms.tpl
+++ b/install/ubuntu/18.10/templates/web/nginx/php-fpm/pyrocms.tpl
@@ -33,7 +33,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ /\.ht { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
error_page 403 /error/404.html;
diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh
index 864d25b6..98887225 100755
--- a/install/vst-install-debian.sh
+++ b/install/vst-install-debian.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Vesta Debian installer v.05
+# myVesta Debian installer v 0.9
#----------------------------------------------------------#
# Variables&Functions #
@@ -18,8 +18,45 @@ os='debian'
release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
vestacp="$VESTA/install/$VERSION/$release"
+ARCH="amd64"
-if [ "$release" -eq 10 ]; then
+if [ "$release" -eq 13 ]; then
+ software="nginx apache2 apache2-utils
+ libapache2-mod-fcgid php-fpm php
+ php-common php-cgi php-mysql php-curl php-fpm php-pgsql awstats
+ vsftpd proftpd-basic bind9 exim4 exim4-daemon-heavy
+ clamav-daemon spamassassin dovecot-imapd dovecot-pop3d roundcube-core
+ roundcube-mysql roundcube-plugins mariadb-server mariadb-common
+ mariadb-client postgresql postgresql-contrib phpmyadmin mc
+ flex whois git idn zip sudo bc ftp lsof ntpdate rrdtool quota
+ e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
+ bsdmainutils cron vesta vesta-nginx vesta-php expect libmail-dkim-perl
+ unrar-free vim-common net-tools unzip iptables xxd spamd"
+elif [ "$release" -eq 12 ]; then
+ software="nginx apache2 apache2-utils
+ libapache2-mod-fcgid php-fpm php
+ php-common php-cgi php-mysql php-curl php-fpm php-pgsql awstats
+ vsftpd proftpd-basic bind9 exim4 exim4-daemon-heavy
+ clamav-daemon spamassassin dovecot-imapd dovecot-pop3d roundcube-core
+ roundcube-mysql roundcube-plugins mariadb-server mariadb-common
+ mariadb-client postgresql postgresql-contrib phpmyadmin mc
+ flex whois git idn zip sudo bc ftp lsof ntpdate rrdtool quota
+ e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
+ bsdmainutils cron vesta vesta-nginx vesta-php expect libmail-dkim-perl
+ unrar-free vim-common net-tools unzip iptables xxd spamd rsyslog"
+elif [ "$release" -eq 11 ]; then
+ software="nginx apache2 apache2-utils
+ libapache2-mod-fcgid php-fpm php
+ php-common php-cgi php-mysql php-curl php-fpm php-pgsql awstats
+ vsftpd proftpd-basic bind9 exim4 exim4-daemon-heavy
+ clamav-daemon spamassassin dovecot-imapd dovecot-pop3d roundcube-core
+ roundcube-mysql roundcube-plugins mariadb-server mariadb-common
+ mariadb-client postgresql postgresql-contrib phppgadmin phpmyadmin mc
+ flex whois git idn zip sudo bc ftp lsof ntpdate rrdtool quota
+ e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
+ bsdmainutils cron vesta vesta-nginx vesta-php expect libmail-dkim-perl
+ unrar-free vim-common net-tools unzip iptables"
+elif [ "$release" -eq 10 ]; then
software="nginx apache2 apache2-utils
libapache2-mod-fcgid php-fpm php
php-common php-cgi php-mysql php-curl php-fpm php-pgsql awstats
@@ -74,12 +111,12 @@ help() {
-a, --apache Install Apache [yes|no] default: yes
-n, --nginx Install Nginx [yes|no] default: yes
-w, --phpfpm Install PHP-FPM [yes|no] default: no
- -v, --vsftpd Install Vsftpd [yes|no] default: yes
- -j, --proftpd Install ProFTPD [yes|no] default: no
+ -v, --vsftpd Install Vsftpd [yes|no] default: no
+ -j, --proftpd Install ProFTPD [yes|no] default: yes
-k, --named Install Bind [yes|no] default: yes
- -m, --mysql Install MySQL [yes|no] default: yes
+ -m, --mysql Install MariaDB [yes|no] default: yes
+ -d, --mysql8 Install MySQL 8 [yes|no] default: no
-g, --postgresql Install PostgreSQL [yes|no] default: no
- -d, --mongodb Install MongoDB [yes|no] unsupported
-x, --exim Install Exim [yes|no] default: yes
-z, --dovecot Install Dovecot [yes|no] default: yes
-c, --clamav Install ClamAV [yes|no] default: yes
@@ -98,7 +135,7 @@ help() {
-f, --force Force installation
-h, --help Print this help
- Example: bash $0 -e demo@vestacp.com -p p4ssw0rd --apache no --phpfpm yes"
+ Example: bash $0 -e demo@myvestacp.com -p p4ssw0rd --apache no --phpfpm yes"
exit 1
}
@@ -106,7 +143,11 @@ help() {
# Defining password-gen function
gen_pass() {
MATRIX='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
- LENGTH=32
+ if [ -z "$1" ]; then
+ LENGTH=32
+ else
+ LENGTH=$1
+ fi
while [ ${n:=1} -le $LENGTH ]; do
PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}"
let n+=1
@@ -148,6 +189,25 @@ set_default_lang() {
fi
}
+ensure_startup() {
+ echo "- making sure startup is enabled for: $1"
+ currentservice=$1
+ unit_files="$(systemctl list-unit-files |grep $currentservice)"
+ if [[ "$unit_files" =~ "disabled" ]]; then
+ systemctl enable $currentservice
+ fi
+}
+
+ensure_start() {
+ echo "- making sure $1 is started"
+ currentservice=$1
+ systemctl status $currentservice.service > /dev/null 2>&1
+ r=$?
+ if [ $r -ne 0 ]; then
+ systemctl start $currentservice
+ check_result $? "$currentservice start failed"
+ fi
+}
#----------------------------------------------------------#
# Verifications #
@@ -167,6 +227,7 @@ for arg; do
--proftpd) args="${args}-j " ;;
--named) args="${args}-k " ;;
--mysql) args="${args}-m " ;;
+ --mysql8) args="${args}-d " ;;
--postgresql) args="${args}-g " ;;
--mongodb) args="${args}-d " ;;
--exim) args="${args}-x " ;;
@@ -202,7 +263,8 @@ while getopts "a:n:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:u:1:fh" Option; do
v) vsftpd=$OPTARG ;; # Vsftpd
j) proftpd=$OPTARG ;; # Proftpd
k) named=$OPTARG ;; # Named
- m) mysql=$OPTARG ;; # MySQL
+ m) mysql=$OPTARG ;; # MariaDB
+ d) mysql8=$OPTARG ;; # MySQL8
g) postgresql=$OPTARG ;; # PostgreSQL
d) mongodb=$OPTARG ;; # MongoDB (unsupported)
x) exim=$OPTARG ;; # Exim
@@ -235,11 +297,12 @@ set_default_value 'vsftpd' 'no'
set_default_value 'proftpd' 'yes'
set_default_value 'named' 'yes'
set_default_value 'mysql' 'yes'
+set_default_value 'mysql8' 'no'
set_default_value 'postgresql' 'no'
set_default_value 'mongodb' 'no'
set_default_value 'exim' 'yes'
set_default_value 'dovecot' 'yes'
-if [ $memory -lt 1500000 ]; then
+if [ $memory -lt 2500000 ]; then
set_default_value 'clamd' 'no'
set_default_value 'spamd' 'no'
else
@@ -254,10 +317,10 @@ set_default_value 'interactive' 'yes'
set_default_lang 'en'
# Checking software conflicts
-if [ "$phpfpm" = 'yes' ]; then
- apache='no'
- nginx='yes'
-fi
+# if [ "$phpfpm" = 'yes' ]; then
+# apache='no'
+# nginx='yes'
+# fi
if [ "$proftpd" = 'yes' ]; then
vsftpd='no'
fi
@@ -269,6 +332,9 @@ fi
if [ "$iptables" = 'no' ]; then
fail2ban='no'
fi
+if [ "$mysql8" = 'yes' ]; then
+ mysql='no'
+fi
# Checking root permissions
if [ "x$(id -u)" != 'x0' ]; then
@@ -283,15 +349,18 @@ if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ -z "$force" ]; then
check_result 1 "User admin exists"
fi
+echo "Updating apt, please wait..."
+apt-get update > /dev/null 2>&1
+
# Checking wget
if [ ! -e '/usr/bin/wget' ]; then
- apt-get -y install wget
+ apt-get -y install wget > /dev/null 2>&1
check_result $? "Can't install wget"
fi
# Check if gnupg2 is installed
if [ $(dpkg-query -W -f='${Status}' gnupg2 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
- apt -y install gnupg2
+ apt-get -y install gnupg2 > /dev/null 2>&1
fi
# Check if apparmor is installed
@@ -315,6 +384,15 @@ for pkg in exim4 mysql-server apache2 nginx vesta; do
fi
done
rm -f $tmpfile
+
+if [ ! -z "$conflicts" ] && [[ "$conflicts" = *"exim4"* ]]; then
+ echo "=== Removing pre-installed exim4"
+ apt remove --purge -y exim4 exim4-base exim4-config
+ rm -rf /etc/exim4
+ conflicts=$(echo "$conflicts" | sed -e "s/exim4//")
+ conflicts=$(echo "$conflicts" | sed -e "s/ //")
+fi
+
if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
echo
@@ -338,71 +416,75 @@ fi
# Printing nice ascii aslogo
clear
echo
-echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|'
-echo ' _| _| _| _| _| _| _|'
-echo ' _| _| _|_|_| _|_| _| _|_|_|_|'
-echo ' _| _| _| _| _| _| _|'
-echo ' _| _|_|_|_| _|_|_| _| _| _|'
+echo " __ __ _ "
+echo " _ __ ___ _ \ \ / /__ ___| |_ __ _ "
+echo " | '_ \` _ \| | | \ \ / / _ \/ __| __/ _\` |"
+echo " | | | | | | |_| |\ V / __/\__ \ || (_| |"
+echo " |_| |_| |_|\__, | \_/ \___||___/\__\__,_|"
+echo " |___/ "
echo
-echo ' Vesta Control Panel'
+echo ' myVesta Control Panel'
echo -e "\n\n"
echo 'Following software will be installed on your system:'
# Web stack
if [ "$nginx" = 'yes' ]; then
- echo ' - Nginx Web Server'
+ echo ' - nginx Web server'
fi
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
- echo ' - Apache Web Server'
+ echo ' - Apache web server'
fi
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
- echo ' - Apache Web Server (as backend)'
+ echo ' - Apache web server (in very fast mpm_event mode)'
+ echo ' - PHP-FPM service for PHP processing'
fi
if [ "$phpfpm" = 'yes' ]; then
- echo ' - PHP-FPM Application Server'
+ echo ' - PHP-FPM service for PHP processing'
fi
# DNS stack
if [ "$named" = 'yes' ]; then
- echo ' - Bind DNS Server'
+ echo ' - Bind9 DNS service'
fi
# Mail Stack
if [ "$exim" = 'yes' ]; then
- echo -n ' - Exim mail server'
+ echo -n ' - Exim4 mail server'
if [ "$clamd" = 'yes' ] || [ "$spamd" = 'yes' ] ; then
- echo -n ' + '
if [ "$clamd" = 'yes' ]; then
- echo -n 'Antivirus '
+ echo -n ' + ClamAV antivirus'
fi
if [ "$spamd" = 'yes' ]; then
- echo -n 'Antispam'
+ echo -n ' + SpamAssassin antispam service'
fi
fi
echo
if [ "$dovecot" = 'yes' ]; then
- echo ' - Dovecot POP3/IMAP Server'
+ echo ' - Dovecot POP3/IMAP service'
fi
fi
# DB stack
if [ "$mysql" = 'yes' ]; then
- echo ' - MySQL Database Server'
+ echo ' - MariaDB Database server'
+fi
+if [ "$mysql8" = 'yes' ]; then
+ echo ' - MySQL 8 Database server'
fi
if [ "$postgresql" = 'yes' ]; then
- echo ' - PostgreSQL Database Server'
-fi
-if [ "$mongodb" = 'yes' ]; then
- echo ' - MongoDB Database Server'
+ echo ' - PostgreSQL Database server'
fi
+# if [ "$mongodb" = 'yes' ]; then
+# echo ' - MongoDB Database Server'
+# fi
# FTP stack
if [ "$vsftpd" = 'yes' ]; then
- echo ' - Vsftpd FTP Server'
+ echo ' - Vsftpd FTP service'
fi
if [ "$proftpd" = 'yes' ]; then
- echo ' - ProFTPD FTP Server'
+ echo ' - ProFTPD FTP service'
fi
# Softaculous
@@ -412,19 +494,25 @@ fi
# Firewall stack
if [ "$iptables" = 'yes' ]; then
- echo -n ' - Iptables Firewall'
+ echo -n ' - iptables firewall'
fi
if [ "$iptables" = 'yes' ] && [ "$fail2ban" = 'yes' ]; then
- echo -n ' + Fail2Ban'
+ echo -n ' + Fail2Ban service'
fi
echo -e "\n\n"
# Asking for confirmation to proceed
if [ "$interactive" = 'yes' ]; then
- read -p 'Would you like to continue [y/n]: ' answer
- if [ "$answer" != 'y' ] && [ "$answer" != 'Y' ]; then
- echo 'Goodbye'
- exit 1
+ prompt_to_continue=1;
+ if [ ! -z "$email" ] && [ ! -z "$secret_url" ] && [ ! -z "$port" ] && [ ! -z "$servername" ]; then
+ prompt_to_continue=0;
+ fi
+ if [ $prompt_to_continue -eq 1 ]; then
+ read -p 'Would you like to continue [y/n]: ' answer
+ if [ "$answer" != 'y' ] && [ "$answer" != 'Y' ]; then
+ echo 'Goodbye'
+ exit 1
+ fi
fi
# Asking for contact email
@@ -471,6 +559,8 @@ if ! [[ "$servername" =~ ^${mask1}${mask2}$ ]]; then
fi
echo "127.0.0.1 $servername" >> /etc/hosts
fi
+echo "$servername" > /etc/hostname
+hostname $servername
# Set email if it wasn't set
if [ -z "$email" ]; then
@@ -495,8 +585,8 @@ sleep 5
# Checking swap #
#----------------------------------------------------------#
-# Checking swap on small instances
if [ -z "$(swapon -s)" ] && [ $memory -lt 1000000 ]; then
+ echo "== Checking swap on small instances"
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
@@ -509,20 +599,24 @@ fi
# Install repository #
#----------------------------------------------------------#
-# Updating system
+echo "=== Updating system (apt-get -y upgrade)"
apt-get -y upgrade
check_result $? 'apt-get upgrade failed'
-# Installing nginx repo
-apt=/etc/apt/sources.list.d
-echo "deb http://nginx.org/packages/debian/ $codename nginx" > $apt/nginx.list
-wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
-apt-key add /tmp/nginx_signing.key
+echo "=== Installing nginx repo"
+apt="/etc/apt/sources.list.d"
+# echo "deb http://nginx.org/packages/debian/ $codename nginx" > $apt/nginx.list
+# wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
+# apt-key add /tmp/nginx_signing.key
+echo "deb [arch=$ARCH signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
+curl -s https://nginx.org/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-keyring.gpg > /dev/null 2>&1
-# Installing vesta repo
-echo "deb http://$RHOST/$codename/ $codename vesta" > $apt/vesta.list
-wget $CHOST/deb_signing.key -O deb_signing.key
-apt-key add deb_signing.key
+echo "=== Installing myVesta repo"
+# echo "deb http://$RHOST/$codename/ $codename vesta" > $apt/vesta.list
+# wget $CHOST/deb_signing.key -O deb_signing.key
+# apt-key add deb_signing.key
+echo "deb [arch=$ARCH signed-by=/usr/share/keyrings/myvesta-keyring.gpg] https://$RHOST/$codename/ $codename vesta" > $apt/vesta.list
+curl -s $CHOST/deb_signing.key | gpg --dearmor | tee /usr/share/keyrings/myvesta-keyring.gpg > /dev/null 2>&1
# Installing jessie backports
if [ "$release" -eq 8 ]; then
@@ -540,12 +634,15 @@ fi
# Backup #
#----------------------------------------------------------#
-# Creating backup directory tree
+mkdir /backup
+
+echo "=== Creating backup directory tree"
mkdir -p $vst_backups
cd $vst_backups
mkdir nginx apache2 php php5 php5-fpm vsftpd proftpd bind exim4 dovecot clamd
mkdir spamassassin mysql postgresql mongodb vesta
+echo "=== Backing up old configs"
# Backing up Nginx configuration
service nginx stop > /dev/null 2>&1
cp -r /etc/nginx/* $vst_backups/nginx >/dev/null 2>&1
@@ -663,9 +760,53 @@ if [ "$mysql" = 'no' ]; then
software=$(echo "$software" | sed -e 's/mysql-server//')
software=$(echo "$software" | sed -e 's/mysql-client//')
software=$(echo "$software" | sed -e 's/mysql-common//')
+ software=$(echo "$software" | sed -e 's/mariadb-server//')
+ software=$(echo "$software" | sed -e 's/mariadb-client//')
+ software=$(echo "$software" | sed -e 's/mariadb-common//')
software=$(echo "$software" | sed -e 's/php5-mysql//')
software=$(echo "$software" | sed -e 's/php-mysql//')
software=$(echo "$software" | sed -e 's/phpMyAdmin//')
+ software=$(echo "$software" | sed -e 's/phpmyadmin//')
+ software=$(echo "$software" | sed -e 's/roundcube-mysql//')
+fi
+if [ "$mysql8" = 'yes' ]; then
+ echo "=== Preparing MySQL 8 apt repo"
+ if [ "$release" -lt 12 ]; then
+ software=$(echo "$software" | sed -e 's/exim4-daemon-heavy//')
+ software=$(echo "$software" | sed -e 's/exim4//')
+ #software="$software php-mysql roundcube-mysql"
+ echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ###" > /etc/apt/sources.list.d/mysql.list
+ echo "# You may comment out entries below, but any other modifications may be lost." >> /etc/apt/sources.list.d/mysql.list
+ echo "# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications." >> /etc/apt/sources.list.d/mysql.list
+ echo "deb http://repo.mysql.com/apt/debian/ $codename mysql-apt-config" >> /etc/apt/sources.list.d/mysql.list
+ echo "deb http://repo.mysql.com/apt/debian/ $codename mysql-8.0" >> /etc/apt/sources.list.d/mysql.list
+ echo "deb http://repo.mysql.com/apt/debian/ $codename mysql-tools" >> /etc/apt/sources.list.d/mysql.list
+ echo "#deb http://repo.mysql.com/apt/debian/ $codename mysql-tools-preview" >> /etc/apt/sources.list.d/mysql.list
+ echo "deb-src http://repo.mysql.com/apt/debian/ $codename mysql-8.0" >> /etc/apt/sources.list.d/mysql.list
+
+ # apt-key adv --keyserver pgp.mit.edu --recv-keys 3A79BD29
+ key="467B942D3A79BD29"
+ readonly key
+ GNUPGHOME="$(mktemp -d)"
+ export GNUPGHOME
+ for keyserver in $(shuf -e ha.pool.sks-keyservers.net hkp://p80.pool.sks-keyservers.net:80 keyserver.ubuntu.com hkp://keyserver.ubuntu.com:80)
+ do
+ gpg --keyserver "${keyserver}" --recv-keys "${key}" 2>&1 && break
+ done
+ gpg --export "${key}" > /etc/apt/trusted.gpg.d/mysql.gpg
+ gpgconf --kill all
+ rm -rf "${GNUPGHOME}"
+ unset GNUPGHOME
+ else
+ # check latest on: https://dev.mysql.com/downloads/repo/apt/
+ wget https://dev.mysql.com/get/mysql-apt-config_0.8.34-1_all.deb
+ dpkg -i mysql-apt-config_0.8.34-1_all.deb
+ fi
+
+ mpass=$(gen_pass)
+ debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password $mpass"
+ debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password $mpass"
+ debconf-set-selections <<< "mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)"
fi
if [ "$postgresql" = 'no' ]; then
software=$(echo "$software" | sed -e 's/postgresql-contrib//')
@@ -687,39 +828,70 @@ fi
#----------------------------------------------------------#
# Update system packages
+echo "=== Running: apt-get update"
apt-get update
-# Disable daemon autostart /usr/share/doc/sysv-rc/README.policy-rc.d.gz
+echo "=== Disable daemon autostart /usr/share/doc/sysv-rc/README.policy-rc.d.gz"
echo -e '#!/bin/sh \nexit 101' > /usr/sbin/policy-rc.d
chmod a+x /usr/sbin/policy-rc.d
-# Install apt packages
+if [ "$mysql8" = 'yes' ]; then
+ echo "=== Installing MySQL 8"
+ apt-get -y install mysql-server mysql-client mysql-common
+ #update-rc.d mysql defaults
+ currentservice='mysql'
+ ensure_startup $currentservice
+ ensure_start $currentservice
+ echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
+ chmod 600 /root/.my.cnf
+ mysqladmin -u root password $mpass
+fi
+
+echo "=== Installing all apt packages"
+# echo "apt-get -y install $software"
apt-get -y install $software
+
check_result $? "apt-get install failed"
-# Restore policy
+if [ "$mysql8" = 'yes' ]; then
+ if [ "$exim" = 'yes' ]; then
+ echo "=== Installing exim4"
+ apt-get -y install exim4 exim4-daemon-heavy
+ fi
+ echo "=== Installing phpmyadmin"
+ #apt-get -y --no-install-recommends install phpmyadmin
+ apt-get -y install phpmyadmin
+fi
+
+echo "=== Enabling daemon autostart"
rm -f /usr/sbin/policy-rc.d
+if [ "$release" -gt 11 ]; then
+ echo "=== Setting up rsyslog"
+ currentservice='rsyslog'
+ ensure_startup $currentservice
+ ensure_start $currentservice
+fi
#----------------------------------------------------------#
# Configure system #
#----------------------------------------------------------#
-# Enable SSH password auth
+echo "== Enable SSH password auth"
sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
-service ssh restart
+systemctl restart ssh
-# Disable awstats cron
+echo "== Disable awstats cron"
rm -f /etc/cron.d/awstats
-# Set directory color
+echo "== Set directory color"
echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile
-# Register /sbin/nologin and /usr/sbin/nologin
+echo "== Register /sbin/nologin and /usr/sbin/nologin"
echo "/sbin/nologin" >> /etc/shells
echo "/usr/sbin/nologin" >> /etc/shells
-# NTP Synchronization
+echo "== NTP Synchronization"
echo '#!/bin/sh' > /etc/cron.daily/ntpdate
echo "$(which ntpdate) -s pool.ntp.org" >> /etc/cron.daily/ntpdate
chmod 775 /etc/cron.daily/ntpdate
@@ -740,12 +912,12 @@ fi
# Configure VESTA #
#----------------------------------------------------------#
-# Installing sudo configuration
+echo "== Installing sudo configuration"
mkdir -p /etc/sudoers.d
cp -f $vestacp/sudo/admin /etc/sudoers.d/
chmod 440 /etc/sudoers.d/admin
-# Configuring system env
+echo "== Configuring system env"
echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh
chmod 755 /etc/profile.d/vesta.sh
source /etc/profile.d/vesta.sh
@@ -753,10 +925,10 @@ echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile
echo 'export PATH' >> /root/.bash_profile
source /root/.bash_profile
-# Configuring logrotate for Vesta logs
+echo "== Copying logrotate for myVesta logs"
cp -f $vestacp/logrotate/vesta /etc/logrotate.d/
-# Building directory tree and creating some blank files for vesta
+echo "== Building directory tree and creating some blank files for myVesta"
mkdir -p $VESTA/conf $VESTA/log $VESTA/ssl $VESTA/data/ips \
$VESTA/data/queue $VESTA/data/users $VESTA/data/firewall \
$VESTA/data/sessions
@@ -771,7 +943,7 @@ rm -f /var/log/vesta
ln -s $VESTA/log /var/log/vesta
chmod 770 $VESTA/data/sessions
-# Generating vesta configuration
+echo "== Generating vesta.conf"
rm -f $VESTA/conf/vesta.conf 2>/dev/null
touch $VESTA/conf/vesta.conf
chmod 660 $VESTA/conf/vesta.conf
@@ -801,7 +973,7 @@ if [ "$apache" = 'no' ] && [ "$nginx" = 'yes' ]; then
echo "WEB_PORT='80'" >> $VESTA/conf/vesta.conf
echo "WEB_SSL_PORT='443'" >> $VESTA/conf/vesta.conf
echo "WEB_SSL='openssl'" >> $VESTA/conf/vesta.conf
- if [ "$release" -eq 9 ] || [ "$release" -eq 10 ]; then
+ if [ "$release" -gt 8 ]; then
if [ "$phpfpm" = 'yes' ]; then
echo "WEB_BACKEND='php-fpm'" >> $VESTA/conf/vesta.conf
fi
@@ -833,7 +1005,11 @@ if [ "$exim" = 'yes' ]; then
echo "ANTIVIRUS_SYSTEM='clamav-daemon'" >> $VESTA/conf/vesta.conf
fi
if [ "$spamd" = 'yes' ]; then
- echo "ANTISPAM_SYSTEM='spamassassin'" >> $VESTA/conf/vesta.conf
+ if [ "$release" -lt 12 ]; then
+ echo "ANTISPAM_SYSTEM='spamassassin'" >> $VESTA/conf/vesta.conf
+ else
+ echo "ANTISPAM_SYSTEM='spamd'" >> $VESTA/conf/vesta.conf
+ fi
fi
if [ "$dovecot" = 'yes' ]; then
echo "IMAP_SYSTEM='dovecot'" >> $VESTA/conf/vesta.conf
@@ -865,14 +1041,14 @@ echo "LANGUAGE='$lang'" >> $VESTA/conf/vesta.conf
# Version
echo "VERSION='0.9.8'" >> $VESTA/conf/vesta.conf
-# Installing hosting packages
+echo "== Copying packages"
cp -rf $vestacp/packages $VESTA/data/
-# Installing templates
+echo "== Copying templates"
cp -rf $vestacp/templates $VESTA/data/
if [ "$release" -eq 10 ]; then
- # Symlink missing templates
+ echo "== Symlink missing templates"
ln -s /usr/local/vesta/data/templates/web/nginx/hosting.sh /usr/local/vesta/data/templates/web/nginx/default.sh
ln -s /usr/local/vesta/data/templates/web/nginx/hosting.tpl /usr/local/vesta/data/templates/web/nginx/default.tpl
ln -s /usr/local/vesta/data/templates/web/nginx/hosting.stpl /usr/local/vesta/data/templates/web/nginx/default.stpl
@@ -887,8 +1063,56 @@ if [ "$release" -eq 10 ]; then
ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.stpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-73.stpl
ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.tpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-73.tpl
fi
+if [ "$release" -eq 11 ]; then
+ echo "== Symlink missing templates"
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.sh /usr/local/vesta/data/templates/web/nginx/default.sh
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.tpl /usr/local/vesta/data/templates/web/nginx/default.tpl
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.stpl /usr/local/vesta/data/templates/web/nginx/default.stpl
-# Set nameservers
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh /usr/local/vesta/data/templates/web/apache2/hosting.sh
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl /usr/local/vesta/data/templates/web/apache2/hosting.tpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl /usr/local/vesta/data/templates/web/apache2/hosting.stpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh /usr/local/vesta/data/templates/web/apache2/default.sh
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl /usr/local/vesta/data/templates/web/apache2/default.tpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl /usr/local/vesta/data/templates/web/apache2/default.stpl
+
+ ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.stpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-74.stpl
+ ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.tpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-74.tpl
+fi
+if [ "$release" -eq 12 ]; then
+ echo "== Symlink missing templates"
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.sh /usr/local/vesta/data/templates/web/nginx/default.sh
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.tpl /usr/local/vesta/data/templates/web/nginx/default.tpl
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.stpl /usr/local/vesta/data/templates/web/nginx/default.stpl
+
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-82.sh /usr/local/vesta/data/templates/web/apache2/hosting.sh
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-82.tpl /usr/local/vesta/data/templates/web/apache2/hosting.tpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-82.stpl /usr/local/vesta/data/templates/web/apache2/hosting.stpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-82.sh /usr/local/vesta/data/templates/web/apache2/default.sh
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-82.tpl /usr/local/vesta/data/templates/web/apache2/default.tpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-82.stpl /usr/local/vesta/data/templates/web/apache2/default.stpl
+
+ ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.stpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-82.stpl
+ ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.tpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-82.tpl
+fi
+if [ "$release" -eq 13 ]; then
+ echo "== Symlink missing templates"
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.sh /usr/local/vesta/data/templates/web/nginx/default.sh
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.tpl /usr/local/vesta/data/templates/web/nginx/default.tpl
+ ln -s /usr/local/vesta/data/templates/web/nginx/hosting.stpl /usr/local/vesta/data/templates/web/nginx/default.stpl
+
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-84.sh /usr/local/vesta/data/templates/web/apache2/hosting.sh
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-84.tpl /usr/local/vesta/data/templates/web/apache2/hosting.tpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-84.stpl /usr/local/vesta/data/templates/web/apache2/hosting.stpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-84.sh /usr/local/vesta/data/templates/web/apache2/default.sh
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-84.tpl /usr/local/vesta/data/templates/web/apache2/default.tpl
+ ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-84.stpl /usr/local/vesta/data/templates/web/apache2/default.stpl
+
+ ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.stpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-84.stpl
+ ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.tpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-84.tpl
+fi
+
+echo "== Set nameservers address"
sed -i "s/YOURHOSTNAME1/ns1.$servername/" /usr/local/vesta/data/packages/default.pkg
sed -i "s/YOURHOSTNAME2/ns2.$servername/" /usr/local/vesta/data/packages/default.pkg
sed -i "s/ns1.domain.tld/ns1.$servername/" /usr/local/vesta/data/packages/default.pkg
@@ -896,26 +1120,30 @@ sed -i "s/ns2.domain.tld/ns2.$servername/" /usr/local/vesta/data/packages/defaul
sed -i "s/ns1.example.com/ns1.$servername/" /usr/local/vesta/data/packages/default.pkg
sed -i "s/ns2.example.com/ns2.$servername/" /usr/local/vesta/data/packages/default.pkg
-# Copying index.html to default documentroot
+echo "== Copying index.html to default documentroot"
cp $VESTA/data/templates/web/skel/public_html/index.html /var/www/
sed -i 's/%domain%/It worked!/g' /var/www/index.html
-# Installing firewall rules
+echo "== Copying firewall rules"
cp -rf $vestacp/firewall $VESTA/data/
-# Configuring server hostname
+echo "== Configuring server hostname: $servername"
$VESTA/bin/v-change-sys-hostname $servername 2>/dev/null
-# Generating SSL certificate
+echo "== Generating myVesta unsigned SSL certificate"
$VESTA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
- 'San Francisco' 'Vesta Control Panel' 'IT' > /tmp/vst.pem
+ 'San Francisco' 'myVesta Control Panel' 'IT' > /tmp/vst.pem
# Parsing certificate file
crt_end=$(grep -n "END CERTIFICATE-" /tmp/vst.pem |cut -f 1 -d:)
-key_start=$(grep -n "BEGIN RSA" /tmp/vst.pem |cut -f 1 -d:)
-key_end=$(grep -n "END RSA" /tmp/vst.pem |cut -f 1 -d:)
+if [ "$release" -lt 12 ]; then
+ key_start=$(grep -n "BEGIN RSA" /tmp/vst.pem |cut -f 1 -d:)
+ key_end=$(grep -n "END RSA" /tmp/vst.pem |cut -f 1 -d:)
+else
+ key_start=$(grep -n "BEGIN PRIVATE KEY" /tmp/vst.pem |cut -f 1 -d:)
+ key_end=$(grep -n "END PRIVATE KEY" /tmp/vst.pem |cut -f 1 -d:)
+fi
-# Adding SSL certificate
cd $VESTA/ssl
sed -n "1,${crt_end}p" /tmp/vst.pem > certificate.crt
sed -n "$key_start,${key_end}p" /tmp/vst.pem > certificate.key
@@ -929,18 +1157,34 @@ rm /tmp/vst.pem
#----------------------------------------------------------#
if [ "$nginx" = 'yes' ]; then
+ echo "=== Configure nginx"
rm -f /etc/nginx/conf.d/*.conf
cp -f $vestacp/nginx/nginx.conf /etc/nginx/
cp -f $vestacp/nginx/status.conf /etc/nginx/conf.d/
cp -f $vestacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
- cp -f $vestacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
+ if [ "$release" -lt 12 ]; then
+ cp -f $vestacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
+ fi
cp -f $vestacp/nginx/webmail.inc /etc/nginx/conf.d/
cp -f $vestacp/logrotate/nginx /etc/logrotate.d/
+
+ # default user/pass for private-hosting.tpl: private / folder
+ echo 'private:$apr1$0MYnchM5$yVi/OTfp7o3lGNst/a8.90' > /etc/nginx/.htpasswd
+
echo > /etc/nginx/conf.d/vesta.conf
mkdir -p /var/log/nginx/domains
- update-rc.d nginx defaults
- service nginx start
- check_result $? "nginx start failed"
+
+ if [ "$apache" = 'yes' ]; then
+ # SSL fix for Apache 2.4.65+
+ echo -e "proxy_ssl_server_name on;\nproxy_ssl_name \$host;\nproxy_ssl_session_reuse off;" > /etc/nginx/conf.d/fixssl.conf
+ touch /usr/local/vesta/data/upgrades/fixssl.conf
+ fi
+
+ #update-rc.d nginx defaults
+ #service nginx start
+ currentservice='nginx'
+ ensure_startup $currentservice
+ ensure_start $currentservice
fi
@@ -949,6 +1193,7 @@ fi
#----------------------------------------------------------#
if [ "$apache" = 'yes' ]; then
+ echo "=== Configure Apache"
cp -f $vestacp/apache2/apache2.conf /etc/apache2/
cp -f $vestacp/apache2/status.conf /etc/apache2/mods-enabled/
cp -f $vestacp/logrotate/apache2 /etc/logrotate.d/
@@ -971,12 +1216,16 @@ if [ "$apache" = 'yes' ]; then
chmod a+x /var/log/apache2
chmod 640 /var/log/apache2/access.log /var/log/apache2/error.log
chmod 751 /var/log/apache2/domains
- update-rc.d apache2 defaults
- service apache2 start
- check_result $? "apache2 start failed"
+ #update-rc.d apache2 defaults
+ #service apache2 start
+ currentservice='apache2'
+ ensure_startup $currentservice
+ ensure_start $currentservice
else
- update-rc.d apache2 disable >/dev/null 2>&1
- service apache2 stop >/dev/null 2>&1
+ #update-rc.d apache2 disable >/dev/null 2>&1
+ #service apache2 stop >/dev/null 2>&1
+ systemctl disable apache2
+ systemctl stop apache2
fi
@@ -985,21 +1234,43 @@ fi
#----------------------------------------------------------#
if [ "$phpfpm" = 'yes' ]; then
- if [ "$release" -eq 10 ]; then
+ echo "=== Configure PHP-FPM"
+ if [ "$release" -eq 13 ]; then
+ cp -f $vestacp/php-fpm/www.conf /etc/php/8.4/fpm/pool.d/www.conf
+ #update-rc.d php8.4-fpm defaults
+ currentservice='php8.4-fpm'
+ ensure_startup $currentservice
+ ensure_start $currentservice
+ elif [ "$release" -eq 12 ]; then
+ cp -f $vestacp/php-fpm/www.conf /etc/php/8.2/fpm/pool.d/www.conf
+ #update-rc.d php8.2-fpm defaults
+ currentservice='php8.2-fpm'
+ ensure_startup $currentservice
+ ensure_start $currentservice
+ elif [ "$release" -eq 11 ]; then
+ cp -f $vestacp/php-fpm/www.conf /etc/php/7.4/fpm/pool.d/www.conf
+ #update-rc.d php7.4-fpm defaults
+ currentservice='php7.4-fpm'
+ ensure_startup $currentservice
+ ensure_start $currentservice
+ elif [ "$release" -eq 10 ]; then
cp -f $vestacp/php-fpm/www.conf /etc/php/7.3/fpm/pool.d/www.conf
- update-rc.d php7.3-fpm defaults
- service php7.3-fpm start
- check_result $? "php-fpm start failed"
+ #update-rc.d php7.3-fpm defaults
+ currentservice='php7.3-fpm'
+ ensure_startup $currentservice
+ ensure_start $currentservice
elif [ "$release" -eq 9 ]; then
cp -f $vestacp/php-fpm/www.conf /etc/php/7.0/fpm/pool.d/www.conf
- update-rc.d php7.0-fpm defaults
- service php7.0-fpm start
- check_result $? "php-fpm start failed"
+ #update-rc.d php7.0-fpm defaults
+ currentservice='php7.0-fpm'
+ ensure_startup $currentservice
+ ensure_start $currentservice
else
cp -f $vestacp/php5-fpm/www.conf /etc/php5/fpm/pool.d/www.conf
- update-rc.d php5-fpm defaults
- service php5-fpm start
- check_result $? "php-fpm start failed"
+ #update-rc.d php5-fpm defaults
+ currentservice='php5-fpm'
+ ensure_startup $currentservice
+ ensure_start $currentservice
fi
fi
@@ -1008,6 +1279,7 @@ fi
# Configure PHP #
#----------------------------------------------------------#
+echo "=== Configure PHP timezone"
ZONE=$(timedatectl 2>/dev/null|grep Timezone|awk '{print $2}')
if [ -z "$ZONE" ]; then
ZONE='UTC'
@@ -1023,10 +1295,12 @@ done
#----------------------------------------------------------#
if [ "$vsftpd" = 'yes' ]; then
+ echo "=== Configure VSFTPD"
cp -f $vestacp/vsftpd/vsftpd.conf /etc/
- update-rc.d vsftpd defaults
- service vsftpd start
- check_result $? "vsftpd start failed"
+ #update-rc.d vsftpd defaults
+ currentservice='vsftpd'
+ ensure_startup $currentservice
+ ensure_start $currentservice
# To be deleted after release 0.9.8-18
echo "/sbin/nologin" >> /etc/shells
@@ -1038,11 +1312,20 @@ fi
#----------------------------------------------------------#
if [ "$proftpd" = 'yes' ]; then
+ echo "=== Configure ProFTPD"
echo "127.0.0.1 $servername" >> /etc/hosts
cp -f $vestacp/proftpd/proftpd.conf /etc/proftpd/
- update-rc.d proftpd defaults
- service proftpd start
- check_result $? "proftpd start failed"
+ cp -f $vestacp/proftpd/tls.conf /etc/proftpd/
+ #update-rc.d proftpd defaults
+ currentservice='proftpd'
+ ensure_startup $currentservice
+ ensure_start $currentservice
+
+ # Temporary ProFTPD fix for Debian12
+ if [ "$release" -eq 12 ]; then
+ systemctl disable --now proftpd.socket
+ systemctl enable --now proftpd.service
+ fi
fi
@@ -1050,39 +1333,52 @@ fi
# Configure MySQL/MariaDB #
#----------------------------------------------------------#
-if [ "$mysql" = 'yes' ]; then
- mycnf="my-small.cnf"
- if [ $memory -gt 1200000 ]; then
- mycnf="my-medium.cnf"
+if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
+
+ if [ "$mysql" = 'yes' ]; then
+ touch $VESTA/conf/mariadb_installed
fi
- if [ $memory -gt 3900000 ]; then
- mycnf="my-large.cnf"
+ if [ "$mysql8" = 'yes' ]; then
+ touch $VESTA/conf/mysql8_installed
fi
- # MySQL configuration
- cp -f $vestacp/mysql/$mycnf /etc/mysql/my.cnf
- mysql_install_db
- update-rc.d mysql defaults
- service mysql start
- check_result $? "mysql start failed"
+ if [ "$mysql" = 'yes' ]; then
+ echo "=== Configure MariaDB"
+ mycnf="my-small.cnf"
+ if [ $memory -gt 1200000 ]; then
+ mycnf="my-medium.cnf"
+ fi
+ if [ $memory -gt 3900000 ]; then
+ mycnf="my-large.cnf"
+ fi
- # Securing MySQL installation
- mpass=$(gen_pass)
- mysqladmin -u root password $mpass
- echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
- chmod 600 /root/.my.cnf
- mysql -e "DELETE FROM mysql.user WHERE User=''"
- mysql -e "DROP DATABASE test" >/dev/null 2>&1
- mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"
- mysql -e "DELETE FROM mysql.user WHERE user='' or password='';"
- mysql -e "FLUSH PRIVILEGES"
+ # MySQL configuration
+ cp -f $vestacp/mysql/$mycnf /etc/mysql/my.cnf
+ mysql_install_db
+ # update-rc.d mysql defaults
+ currentservice='mysql'
+ ensure_startup $currentservice
+ ensure_start $currentservice
+
+ # Securing MySQL installation
+ mpass=$(gen_pass)
+ mysqladmin -u root password $mpass
+ echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
+ chmod 600 /root/.my.cnf
+ mysql -e "DELETE FROM mysql.user WHERE User=''"
+ mysql -e "DROP DATABASE test" >/dev/null 2>&1
+ mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"
+ mysql -e "DELETE FROM mysql.user WHERE user='' or password='';"
+ mysql -e "FLUSH PRIVILEGES"
+ fi
# Configuring phpMyAdmin
+ echo "=== Configure phpMyAdmin"
+ if [ "$release" -eq 10 ]; then
+ mkdir /etc/phpmyadmin
+ mkdir -p /var/lib/phpmyadmin/tmp
+ fi
if [ "$apache" = 'yes' ]; then
- if [ "$release" -eq 10 ]; then
- mkdir /etc/phpmyadmin
- mkdir -p /var/lib/phpmyadmin/tmp
- fi
cp -f $vestacp/pma/apache.conf /etc/phpmyadmin/
ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
fi
@@ -1093,8 +1389,8 @@ if [ "$mysql" = 'yes' ]; then
mkdir /root/phpmyadmin
mkdir /usr/share/phpmyadmin
- pma_v='4.9.1'
- echo "(*) Installing phpMyAdmin version v$pma_v..."
+ pma_v='4.9.7'
+ echo "=== Installing phpMyAdmin version v$pma_v (Debian10 custom part)"
cd /root/phpmyadmin
@@ -1127,6 +1423,29 @@ if [ "$mysql" = 'yes' ]; then
bash /root/phpmyadmin/pma.sh
blowfish=$(gen_pass)
echo "\$cfg['blowfish_secret'] = '$blowfish';" >> /etc/phpmyadmin/config.inc.php
+
+ # disable root login
+ echo "\$cfg['Servers'][\$i]['AllowRoot'] = FALSE;" >> /etc/phpmyadmin/config.inc.php
+ fi
+ if [ "$release" -gt 10 ]; then
+ echo "=== Configure phpMyAdmin (Debian11 custom part)"
+ # Set config and log directory
+ sed -i "s|define('CONFIG_DIR', '');|define('CONFIG_DIR', '/etc/phpmyadmin/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
+ sed -i "s|define('TEMP_DIR', './tmp/');|define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
+
+ # Create temporary folder and change permission
+ mkdir /usr/share/phpmyadmin/tmp
+ chmod 777 /usr/share/phpmyadmin/tmp
+
+ mkdir /root/phpmyadmin
+ wget -nv -O /root/phpmyadmin/pma.sh http://c.myvestacp.com/debian/11/pma/pma.sh
+ wget -nv -O /root/phpmyadmin/create_tables.sql http://c.myvestacp.com/debian/11/pma/create_tables.sql
+ bash /root/phpmyadmin/pma.sh
+ blowfish=$(gen_pass)
+ echo "\$cfg['blowfish_secret'] = '$blowfish';" >> /etc/phpmyadmin/config.inc.php
+
+ # disable root login
+ echo "\$cfg['Servers'][\$i]['AllowRoot'] = FALSE;" >> /etc/phpmyadmin/config.inc.php
fi
fi
@@ -1135,16 +1454,21 @@ fi
#----------------------------------------------------------#
if [ "$postgresql" = 'yes' ]; then
+ echo "=== Configure PostgreSQL"
ppass=$(gen_pass)
cp -f $vestacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
- service postgresql restart
+ currentservice='postgresql'
+ ensure_startup $currentservice
+ ensure_start $currentservice
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$ppass'"
# Configuring phpPgAdmin
- if [ "$apache" = 'yes' ]; then
- cp -f $vestacp/pga/phppgadmin.conf /etc/apache2/conf.d/
+ if [ "$release" -lt 12 ]; then
+ if [ "$apache" = 'yes' ]; then
+ cp -f $vestacp/pga/phppgadmin.conf /etc/apache2/conf.d/
+ fi
+ cp -f $vestacp/pga/config.inc.php /etc/phppgadmin/
fi
- cp -f $vestacp/pga/config.inc.php /etc/phppgadmin/
fi
@@ -1153,6 +1477,7 @@ fi
#----------------------------------------------------------#
if [ "$named" = 'yes' ]; then
+ echo "=== Configure Bind9"
cp -f $vestacp/bind/named.conf /etc/bind/
sed -i "s%listen-on%//listen%" /etc/bind/named.conf.options
chown root:bind /etc/bind/named.conf
@@ -1164,12 +1489,13 @@ if [ "$named" = 'yes' ]; then
sed -i "s#/etc/bind/\*\* r,#/etc/bind/\*\* rw,\n /home/\*\* rwm,#g" /etc/apparmor.d/usr.sbin.named
# service apparmor status >/dev/null 2>&1
# if [ $? -ne 0 ]; then
- service apparmor restart
+ systemctl restart apparmor
# fi
fi
- update-rc.d bind9 defaults
- service bind9 start
- check_result $? "bind9 start failed"
+ # update-rc.d bind9 defaults
+ currentservice='bind9'
+ ensure_startup $currentservice
+ ensure_start $currentservice
fi
#----------------------------------------------------------#
@@ -1177,12 +1503,17 @@ fi
#----------------------------------------------------------#
if [ "$exim" = 'yes' ]; then
+ echo "=== Configure Exim"
gpasswd -a Debian-exim mail
cp -f $vestacp/exim/exim4.conf.template /etc/exim4/
cp -f $vestacp/exim/dnsbl.conf /etc/exim4/
cp -f $vestacp/exim/spam-blocks.conf /etc/exim4/
cp -f $vestacp/exim/deny_senders /etc/exim4/
touch /etc/exim4/white-blocks.conf
+ touch /etc/exim4/limit_per_email_account_max_sent_emails_per_hour
+ touch /etc/exim4/limit_per_email_account_max_recipients
+ touch /etc/exim4/limit_per_hosting_account_max_sent_emails_per_hour
+ touch /etc/exim4/limit_per_hosting_account_max_recipients
if [ "$spamd" = 'yes' ]; then
sed -i "s/#SPAM/SPAM/g" /etc/exim4/exim4.conf.template
@@ -1191,6 +1522,12 @@ if [ "$exim" = 'yes' ]; then
sed -i "s/#CLAMD/CLAMD/g" /etc/exim4/exim4.conf.template
fi
+ # Generating SRS KEY - the code is taken from HestiaCP
+ srs=$(gen_pass 16)
+ echo $srs > /etc/exim4/srs.conf
+ chmod 640 /etc/exim4/srs.conf
+ chown root:Debian-exim /etc/exim4/srs.conf
+
chmod 640 /etc/exim4/exim4.conf.template
rm -rf /etc/exim4/domains
mkdir -p /etc/exim4/domains
@@ -1202,8 +1539,11 @@ if [ "$exim" = 'yes' ]; then
update-rc.d -f postfix remove > /dev/null 2>&1
service postfix stop > /dev/null 2>&1
- update-rc.d exim4 defaults
- service exim4 start
+ #update-rc.d exim4 defaults
+ currentservice='exim4'
+ ensure_startup $currentservice
+ systemctl restart $currentservice
+ # ensure_start $currentservice
fi
@@ -1212,13 +1552,15 @@ fi
#----------------------------------------------------------#
if [ "$dovecot" = 'yes' ]; then
+ echo "=== Configure Dovecot"
gpasswd -a dovecot mail
cp -rf $vestacp/dovecot /etc/
cp -f $vestacp/logrotate/dovecot /etc/logrotate.d/
chown -R root:root /etc/dovecot*
- update-rc.d dovecot defaults
- service dovecot start
- check_result $? "dovecot start failed"
+ # update-rc.d dovecot defaults
+ currentservice='dovecot'
+ ensure_startup $currentservice
+ ensure_start $currentservice
fi
@@ -1227,13 +1569,20 @@ fi
#----------------------------------------------------------#
if [ "$clamd" = 'yes' ]; then
+ echo "=== Configure ClamAV"
gpasswd -a clamav mail
gpasswd -a clamav Debian-exim
cp -f $vestacp/clamav/clamd.conf /etc/clamav/
mkdir -p /var/lib/clamav
/usr/bin/freshclam
- update-rc.d clamav-daemon defaults
- if [ ! -d "/var/run/clamav" ]; then
+
+ # update-rc.d clamav-daemon defaults
+ currentservice='clamav-daemon'
+ ensure_startup $currentservice
+ currentservice='clamav-freshclam'
+ ensure_startup $currentservice
+
+ if [ ! -d "/var/run/clamav" ]; then
mkdir /var/run/clamav
fi
chown -R clamav:clamav /var/run/clamav
@@ -1249,8 +1598,11 @@ if [ "$clamd" = 'yes' ]; then
wget -nv -O $clamavfolder/foxhole_all.cdb http://c.myvestacp.com/tools/clamav/foxhole_all.cdb
chown clamav:clamav $clamavfolder/foxhole_all.cdb
fi
- service clamav-daemon start
- check_result $? "clamav-daeom start failed"
+
+ currentservice='clamav-daemon'
+ ensure_start $currentservice
+ currentservice='clamav-freshclam'
+ ensure_start $currentservice
fi
@@ -1259,14 +1611,35 @@ fi
#----------------------------------------------------------#
if [ "$spamd" = 'yes' ]; then
- update-rc.d spamassassin defaults
- sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
- service spamassassin start
- check_result $? "spamassassin start failed"
- unit_files="$(systemctl list-unit-files |grep spamassassin)"
- if [[ "$unit_files" =~ "disabled" ]]; then
- systemctl enable spamassassin
+ echo "=== Configure SpamAssassin"
+ #update-rc.d spamassassin defaults
+ if [ "$release" -lt 12 ]; then
+ sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
+ currentservice='spamassassin'
+ else
+ currentservice='spamd'
fi
+
+ echo "=== Creating spamassassin /nonexistent folder"
+ mkdir /nonexistent
+ mkdir /nonexistent/.spamassassin
+ chown -R nobody:debian-spamd /nonexistent
+
+ echo "=== Patching spamassassin dns_server"
+ sed -i "s/report_safe 1/report_safe 1\n\ndns_server 127.0.0.1/g" /etc/spamassassin/local.cf
+
+ echo "== Adding myVesta rules to SpamAssassin"
+ cat < /etc/spamassassin/myvesta.cf
+score RCVD_IN_RP_SAFE 0
+score RCVD_IN_RP_CERTIFIED 0
+score SPF_FAIL 3.0
+score SPF_SOFTFAIL 4.0
+score SPF_NONE 4.0
+EOF
+
+ wget -nv -O /etc/spamassassin/barracuda.cf http://c.myvestacp.com/tools/spamassassin/barracuda.cf
+ ensure_startup $currentservice
+ systemctl restart $currentservice
fi
@@ -1274,7 +1647,8 @@ fi
# Configure RoundCube #
#----------------------------------------------------------#
-if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+if [ "$exim" = 'yes' ] && { [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; } then
+ echo "=== Configure RoundCube"
if [ "$apache" = 'yes' ]; then
cp -f $vestacp/roundcube/apache.conf /etc/roundcube/
ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
@@ -1290,21 +1664,27 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
cp -f $vestacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
r="$(gen_pass)"
mysql -e "CREATE DATABASE roundcube"
- mysql -e "GRANT ALL ON roundcube.*
- TO roundcube@localhost IDENTIFIED BY '$r'"
+ if [ "$mysql8" = 'yes' ]; then
+ mysql -e "CREATE USER 'roundcube'@'localhost' IDENTIFIED BY '$r';"
+ mysql -e "GRANT ALL ON roundcube.*
+ TO roundcube@localhost"
+ else
+ mysql -e "GRANT ALL ON roundcube.*
+ TO roundcube@localhost IDENTIFIED BY '$r'"
+ fi
sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php
sed -i "s/localhost/$servername/g" \
/etc/roundcube/plugins/password/config.inc.php
mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
chmod a+r /etc/roundcube/main.inc.php
- if [ "$release" -eq 8 ] || [ "$release" -eq 9 ] || [ "$release" -eq 10 ]; then
- mv -f /etc/roundcube/main.inc.php /etc/roundcube/config.inc.php
- mv -f /etc/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
- chmod 640 /etc/roundcube/debian-db-roundcube.php
- chmod 640 /etc/roundcube/config.inc.php
- chown root:www-data /etc/roundcube/debian-db-roundcube.php
- chown root:www-data /etc/roundcube/config.inc.php
- fi
+ mv -f /etc/roundcube/main.inc.php /etc/roundcube/config.inc.php
+ mv -f /etc/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
+ chmod 640 /etc/roundcube/debian-db-roundcube.php
+ chmod 640 /etc/roundcube/config.inc.php
+ chown root:www-data /etc/roundcube/debian-db-roundcube.php
+ chown root:www-data /etc/roundcube/config.inc.php
+ sed -i "s#^\$config\['smtp_user'\].*#\$config\['smtp_user'\] = '%u';#g" /etc/roundcube/defaults.inc.php
+ sed -i "s#^\$config\['smtp_pass'\].*#\$config\['smtp_pass'\] = '%p';#g" /etc/roundcube/defaults.inc.php
if [ "$release" -eq 8 ]; then
# RoundCube tinyMCE fix
tinymceFixArchiveURL=$vestacp/roundcube/roundcube-tinymce.tar.gz
@@ -1338,6 +1718,7 @@ fi
#----------------------------------------------------------#
if [ "$fail2ban" = 'yes' ]; then
+ echo "=== Configure Fail2Ban"
cp -rf $vestacp/fail2ban /etc/
if [ "$dovecot" = 'no' ]; then
fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
@@ -1358,9 +1739,31 @@ if [ "$fail2ban" = 'yes' ]; then
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local
fi
- update-rc.d fail2ban defaults
- service fail2ban start
- check_result $? "fail2ban start failed"
+ if [ ! -e /var/log/auth.log ]; then
+ # Debian workaround: auth logging was moved to systemd
+ # We took this fix from HestiaCP
+ touch /var/log/auth.log
+ chmod 640 /var/log/auth.log
+ chown root:adm /var/log/auth.log
+ fi
+ if [ "$proftpd" = 'yes' ]; then
+ cat <> /etc/fail2ban/jail.local
+
+[proftpd]
+enabled = true
+filter = proftpd
+action = vesta[name=FTP]
+port = ftp,ftp-data,ftps,ftps-data
+logpath = %(proftpd_log)s
+backend = %(proftpd_backend)s
+maxretry = 5
+EOF
+ fi
+
+ #update-rc.d fail2ban defaults
+ currentservice='fail2ban'
+ ensure_startup $currentservice
+ ensure_start $currentservice
fi
@@ -1368,7 +1771,13 @@ fi
# Configure Admin User #
#----------------------------------------------------------#
-# Deleting old admin user
+echo "=== Configure Admin User"
+if [ "$release" -gt 10 ]; then
+ echo "=== Switching to sha512"
+ sed -i "s/yescrypt/sha512/g" /etc/pam.d/common-password
+fi
+
+echo "== Deleting old admin user"
if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then
chattr -i /home/admin/conf > /dev/null 2>&1
userdel -f admin >/dev/null 2>&1
@@ -1380,14 +1789,14 @@ if [ ! -z "$(grep ^admin: /etc/group)" ]; then
groupdel admin > /dev/null 2>&1
fi
-# Adding vesta account
+echo "== Adding vesta account"
$VESTA/bin/v-add-user admin $vpass $email default System Administrator
check_result $? "can't create admin user"
$VESTA/bin/v-change-user-shell admin bash
$VESTA/bin/v-change-user-language admin $lang
-# RoundCube permissions fix
-if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+if [ "$exim" = 'yes' ] && { [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; } then
+ echo "== RoundCube permissions fix"
if [ ! -d "/var/log/roundcube" ]; then
mkdir /var/log/roundcube
fi
@@ -1397,28 +1806,40 @@ fi
# Vesta data sessions permissions
chown admin:admin $VESTA/data/sessions
-# Configuring system ips
+echo "== Configuring system ips (this can take a few minutes, relax)"
$VESTA/bin/v-update-sys-ip
-# Get main ip
+echo "== Get main ip"
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
local_ip=$ip
+# Writing '$ip $servername' to /etc/hosts
+echo "== Writing '$ip $servername' to /etc/hosts"
+sed -i "/$servername/d" /etc/hosts
+subdomain=$(echo "$servername" | cut -d . -f-1)
+if [ "$servername" != "$subdomain" ]; then
+ echo "$ip $servername $subdomain" >> /etc/hosts
+else
+ echo "$ip $servername" >> /etc/hosts
+fi
+
# Firewall configuration
if [ "$iptables" = 'yes' ]; then
+ echo "== Firewall configuration"
$VESTA/bin/v-update-firewall
fi
-# Get public ip
-pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
+echo "== Get public ip"
+pub_ip=$(curl -4 -s https://scripts.myvestacp.com/ip.php)
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
+ echo "== NAT detected"
$VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
ip=$pub_ip
fi
-# Configuring libapache2-mod-remoteip
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
+ echo "== Configuring libapache2-mod-remoteip"
cd /etc/apache2/mods-available
echo "" > remoteip.conf
echo " RemoteIPHeader X-Real-IP" >> remoteip.conf
@@ -1437,30 +1858,31 @@ if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
service apache2 restart
fi
-# Configuring mysql host
-if [ "$mysql" = 'yes' ]; then
- $VESTA/bin/v-add-database-host mysql localhost root $mpass
- # $VESTA/bin/v-add-database admin default default $(gen_pass) mysql
+if [ "$mysql" = 'yes' ] || [ "$mysql8" = 'yes' ]; then
+ echo "== Configuring mysql host"
+ $VESTA/bin/v-add-database-host mysql localhost root $mpass
+ # $VESTA/bin/v-add-database admin default default $(gen_pass) mysql
fi
-# Configuring pgsql host
if [ "$postgresql" = 'yes' ]; then
+ echo "== Configuring pgsql host"
$VESTA/bin/v-add-database-host pgsql localhost postgres $ppass
$VESTA/bin/v-add-database admin db db $(gen_pass) pgsql
fi
-# Adding default domain
+echo "== Adding default domain"
$VESTA/bin/v-add-domain admin $servername
check_result $? "can't create $servername domain"
if [ "$named" = 'yes' ]; then
- # Adding ns1 and ns2 A records
+ echo "== Adding ns1 and ns2 A records"
/usr/local/vesta/bin/v-add-dns-record 'admin' "$servername" 'ns1' 'A' "$pub_ip"
/usr/local/vesta/bin/v-add-dns-record 'admin' "$servername" 'ns2' 'A' "$pub_ip"
fi
if [ "$release" -eq 10 ]; then
if [ -f "/etc/php/7.3/fpm/pool.d/$servername.conf" ]; then
+ echo "== FPM pool.d $servername tweaks"
sed -i "/^group =/c\group = www-data" /etc/php/7.3/fpm/pool.d/$servername.conf
sed -i "/max_execution_time/c\php_admin_value[max_execution_time] = 900" /etc/php/7.3/fpm/pool.d/$servername.conf
sed -i "/request_terminate_timeout/c\request_terminate_timeout = 900s" /etc/php/7.3/fpm/pool.d/$servername.conf
@@ -1471,8 +1893,48 @@ if [ "$release" -eq 10 ]; then
/usr/local/vesta/bin/v-change-web-domain-proxy-tpl 'admin' "$servername" 'hosting-webmail-phpmyadmin' 'jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,woff,woff2' 'no'
fi
fi
+if [ "$release" -eq 11 ]; then
+ if [ -f "/etc/php/7.4/fpm/pool.d/$servername.conf" ]; then
+ echo "== FPM pool.d $servername tweaks"
+ sed -i "/^group =/c\group = www-data" /etc/php/7.4/fpm/pool.d/$servername.conf
+ sed -i "/max_execution_time/c\php_admin_value[max_execution_time] = 900" /etc/php/7.4/fpm/pool.d/$servername.conf
+ sed -i "/request_terminate_timeout/c\request_terminate_timeout = 900s" /etc/php/7.4/fpm/pool.d/$servername.conf
+ sed -i "s|80M|800M|g" /etc/php/7.4/fpm/pool.d/$servername.conf
+ sed -i "s|256M|512M|g" /etc/php/7.4/fpm/pool.d/$servername.conf
+ service php7.4-fpm restart
+ ln -s /var/lib/roundcube /var/lib/roundcube/webmail
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl 'admin' "$servername" 'hosting-webmail-phpmyadmin' 'jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,woff,woff2' 'yes'
+ fi
+fi
+if [ "$release" -eq 12 ]; then
+ if [ -f "/etc/php/8.2/fpm/pool.d/$servername.conf" ]; then
+ echo "== FPM pool.d $servername tweaks"
+ sed -i "/^group =/c\group = www-data" /etc/php/8.2/fpm/pool.d/$servername.conf
+ sed -i "/max_execution_time/c\php_admin_value[max_execution_time] = 900" /etc/php/8.2/fpm/pool.d/$servername.conf
+ sed -i "/request_terminate_timeout/c\request_terminate_timeout = 900s" /etc/php/8.2/fpm/pool.d/$servername.conf
+ sed -i "s|80M|800M|g" /etc/php/8.2/fpm/pool.d/$servername.conf
+ sed -i "s|256M|512M|g" /etc/php/8.2/fpm/pool.d/$servername.conf
+ service php8.2-fpm restart
+ ln -s /var/lib/roundcube /var/lib/roundcube/webmail
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl 'admin' "$servername" 'hosting-webmail-phpmyadmin' 'jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,woff,woff2' 'yes'
+ fi
+fi
+if [ "$release" -eq 13 ]; then
+ if [ -f "/etc/php/8.4/fpm/pool.d/$servername.conf" ]; then
+ echo "== FPM pool.d $servername tweaks"
+ sed -i "/^group =/c\group = www-data" /etc/php/8.4/fpm/pool.d/$servername.conf
+ sed -i "/max_execution_time/c\php_admin_value[max_execution_time] = 900" /etc/php/8.4/fpm/pool.d/$servername.conf
+ sed -i "/request_terminate_timeout/c\request_terminate_timeout = 900s" /etc/php/8.4/fpm/pool.d/$servername.conf
+ sed -i "s|80M|800M|g" /etc/php/8.4/fpm/pool.d/$servername.conf
+ sed -i "s|256M|512M|g" /etc/php/8.4/fpm/pool.d/$servername.conf
+ service php8.4-fpm restart
+ ln -s /var/lib/roundcube /var/lib/roundcube/webmail
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl 'admin' "$servername" 'hosting-webmail-phpmyadmin' 'jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,woff,woff2' 'yes'
+ fi
+fi
-# Adding cron jobs
+
+echo "== Adding cron jobs"
command="sudo $VESTA/bin/v-update-sys-queue disk"
$VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
command="sudo $VESTA/bin/v-update-sys-queue traffic"
@@ -1482,36 +1944,43 @@ $VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command"
command="sudo $VESTA/bin/v-update-sys-queue backup"
$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
command="sudo $VESTA/bin/v-backup-users"
-$VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command"
+$VESTA/bin/v-add-cron-job 'admin' '10' '01' '*' '*' '6' "$command"
command="sudo $VESTA/bin/v-update-user-stats"
$VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
command="sudo $VESTA/bin/v-update-sys-rrd"
$VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
-service cron restart
+command="sudo $VESTA/bin/v-fix-website-permissions-for-all-websites-only-php"
+$VESTA/bin/v-add-cron-job 'admin' '05' '03' '*' '*' '*' "$command"
+command="sudo $VESTA/bin/v-df-snapshot-make"
+$VESTA/bin/v-add-cron-job 'admin' '05' '04' '*' '*' '*' "$command"
+command="sudo $VESTA/bin/v-df-snapshot-logs-cleaner"
+$VESTA/bin/v-add-cron-job 'admin' '10' '04' '*' '*' '*' "$command"
+systemctl restart cron.service
-# Building inititall rrd images
+echo "== Building inititall rrd images"
$VESTA/bin/v-update-sys-rrd
-# Enabling file system quota
if [ "$quota" = 'yes' ]; then
+ echo "== Enabling file system quota"
$VESTA/bin/v-add-sys-quota
fi
-# Enabling softaculous plugin
+echo "== Enabling softaculous plugin"
if [ "$softaculous" = 'yes' ]; then
$VESTA/bin/v-add-vesta-softaculous
fi
# Starting vesta service
-update-rc.d vesta defaults
-service vesta start
-check_result $? "vesta start failed"
+#update-rc.d vesta defaults
+currentservice='vesta'
+ensure_startup $currentservice
+ensure_start $currentservice
chown admin:admin $VESTA/data/sessions
-# Adding notifications
+echo "== Adding notifications"
$VESTA/upd/add_notifications.sh
-# Adding cronjob for autoupdates
+echo "== Adding cronjob for autoupdates"
$VESTA/bin/v-add-cron-vesta-autoupdate
@@ -1521,29 +1990,42 @@ $VESTA/bin/v-add-cron-vesta-autoupdate
echo "=== Installing additional PHP libs"
if [ "$release" -eq 9 ]; then
- apt-get -y install php7.0-apcu php7.0-mbstring php7.0-bcmath php7.0-curl php7.0-gd php7.0-intl php7.0-mcrypt php7.0-mysql php7.0-mysqlnd php7.0-pdo php7.0-soap php7.0-json php7.0-xml php7.0-zip php7.0-memcache php7.0-memcached php7.0-zip
+ apt-get -y install php7.0-apcu php7.0-mbstring php7.0-bcmath php7.0-curl php7.0-gd php7.0-intl php7.0-mcrypt php7.0-mysql php7.0-mysqlnd php7.0-pdo php7.0-soap php7.0-json php7.0-xml php7.0-zip php7.0-memcache php7.0-memcached php7.0-zip php7.0-imagick php7.0-imap
fi
if [ "$release" -eq 10 ]; then
- apt-get -y install php7.3-apcu php7.3-mbstring php7.3-bcmath php7.3-curl php7.3-gd php7.3-intl php7.3-mysql php7.3-mysqlnd php7.3-pdo php7.3-soap php7.3-json php7.3-xml php7.3-zip php7.3-memcache php7.3-memcached php7.3-zip
+ apt-get -y install php7.3-apcu php7.3-mbstring php7.3-bcmath php7.3-curl php7.3-gd php7.3-intl php7.3-mysql php7.3-mysqlnd php7.3-pdo php7.3-soap php7.3-json php7.3-xml php7.3-zip php7.3-memcache php7.3-memcached php7.3-zip php7.3-imagick php7.3-imap
+fi
+if [ "$release" -eq 11 ]; then
+ apt-get -y install php7.4-apcu php7.4-mbstring php7.4-bcmath php7.4-curl php7.4-gd php7.4-intl php7.4-mysql php7.4-mysqlnd php7.4-pdo php7.4-soap php7.4-json php7.4-xml php7.4-zip php7.4-memcache php7.4-memcached php7.4-zip php7.4-imagick php7.4-imap
+fi
+if [ "$release" -eq 12 ]; then
+ apt-get -y install php8.2-apcu php8.2-mbstring php8.2-bcmath php8.2-curl php8.2-gd php8.2-intl php8.2-mysql php8.2-mysqlnd php8.2-pdo php8.2-soap php8.2-xml php8.2-zip php8.2-memcache php8.2-memcached php8.2-zip php8.2-imagick php8.2-imap
+fi
+if [ "$release" -eq 13 ]; then
+ apt-get -y install php8.4-apcu php8.4-mbstring php8.4-bcmath php8.4-curl php8.4-gd php8.4-intl php8.4-mysql php8.4-mysqlnd php8.4-pdo php8.4-soap php8.4-xml php8.4-zip php8.4-memcache php8.4-memcached php8.4-zip php8.4-imagick php8.4-imap
fi
touch /var/log/php-mail.log
chmod a=rw /var/log/php-mail.log
if [ "$release" -eq 9 ]; then
- if [ $memory -lt 10000000 ]; then
- echo "=== Patching php7.0-vps"
- mkdir -p /root/vesta-temp-dl/vesta/patch
- cp $vestacp/php/php7.0-vps.patch /root/vesta-temp-dl/vesta/patch/php7.0-vps.patch
- patch -p1 --directory=/ < /root/vesta-temp-dl/vesta/patch/php7.0-vps.patch
- fi
- if [ $memory -gt 9999999 ]; then
- echo "=== Patching php7.0-dedi"
- mkdir -p /root/vesta-temp-dl/vesta/patch
- cp $vestacp/php/php7.0-dedi.patch /root/vesta-temp-dl/vesta/patch/php7.0-dedi.patch
- patch -p1 --directory=/ < /root/vesta-temp-dl/vesta/patch/php7.0-dedi.patch
+ if [ "$apache" = 'yes' ]; then
+ if [ $memory -lt 10000000 ]; then
+ echo "=== Patching php7.0-vps"
+ mkdir -p /root/vesta-temp-dl/vesta/patch
+ cp $vestacp/php/php7.0-vps.patch /root/vesta-temp-dl/vesta/patch/php7.0-vps.patch
+ patch -p1 --directory=/ < /root/vesta-temp-dl/vesta/patch/php7.0-vps.patch
+ fi
+ if [ $memory -gt 9999999 ]; then
+ echo "=== Patching php7.0-dedi"
+ mkdir -p /root/vesta-temp-dl/vesta/patch
+ cp $vestacp/php/php7.0-dedi.patch /root/vesta-temp-dl/vesta/patch/php7.0-dedi.patch
+ patch -p1 --directory=/ < /root/vesta-temp-dl/vesta/patch/php7.0-dedi.patch
+ fi
fi
+ update-alternatives --set php /usr/bin/php7.0
fi
+
if [ "$release" -eq 10 ]; then
if [ $memory -lt 10000000 ]; then
echo "=== Patching php7.3-vps"
@@ -1553,9 +2035,37 @@ if [ "$release" -eq 10 ]; then
echo "=== Patching php7.3-dedi"
patch /etc/php/7.3/fpm/php.ini < $vestacp/php/php7.3-dedi.patch
fi
+ update-alternatives --set php /usr/bin/php7.3
service php7.3-fpm restart
fi
+if [ "$release" -eq 11 ]; then
+ if [ $memory -lt 10000000 ]; then
+ echo "=== Patching php7.4-vps"
+ patch /etc/php/7.4/fpm/php.ini < $vestacp/php/php7.4-vps.patch
+ fi
+ if [ $memory -gt 9999999 ]; then
+ echo "=== Patching php7.4-dedi"
+ patch /etc/php/7.4/fpm/php.ini < $vestacp/php/php7.4-dedi.patch
+ fi
+ update-alternatives --set php /usr/bin/php7.4
+ service php7.4-fpm restart
+fi
+
+if [ "$release" -eq 12 ]; then
+ echo "=== Patching php8.2"
+ patch /etc/php/8.2/fpm/php.ini < /usr/local/vesta/src/deb/for-download/tools/patches/php8.2.patch
+ update-alternatives --set php /usr/bin/php8.2
+ service php8.2-fpm restart
+fi
+
+if [ "$release" -eq 13 ]; then
+ echo "=== Patching php8.4"
+ patch /etc/php/8.4/fpm/php.ini < /usr/local/vesta/src/deb/for-download/tools/patches/php8.2.patch
+ update-alternatives --set php /usr/bin/php8.4
+ service php8.4-fpm restart
+fi
+
# echo "=== Patching rcube_vcard.php"
# wget -nv https://c.myvestacp.com/tools/patches/rcube_vcard.patch -O /root/rcube_vcard.patch
# patch /usr/share/roundcube/program/lib/Roundcube/rcube_vcard.php < /root/rcube_vcard.patch
@@ -1563,7 +2073,7 @@ fi
# Comparing hostname and ip
make_ssl=0
host_ip=$(host $servername | head -n 1 | awk '{print $NF}')
-if [ "$host_ip" != "$ip" ]; then
+if [ "$host_ip" != "$pub_ip" ]; then
echo "***** PROBLEM: Hostname $servername is not pointing to your server (IP address $ip)"
echo "Without pointing your hostname to your IP, LetsEncrypt SSL will not be generated for your server hostname."
echo "Try to setup an A record in your DNS, pointing your hostname $servername to IP address $ip and then press ENTER."
@@ -1584,7 +2094,7 @@ if [ $make_ssl -eq 1 ]; then
# Check if www is also pointing to our IP
www_host="www.$servername"
www_host_ip=$(host $www_host | head -n 1 | awk '{print $NF}')
- if [ "$www_host_ip" != "$ip" ]; then
+ if [ "$www_host_ip" != "$pub_ip" ]; then
if [ "$named" = 'yes' ]; then
echo "=== Deleting www to server hostname"
$VESTA/bin/v-delete-web-domain-alias 'admin' "$servername" "$www_host" 'no'
@@ -1612,13 +2122,30 @@ if [ ! -d "/usr/local/vesta/data/upgrades" ]; then
mkdir -p /usr/local/vesta/data/upgrades
fi
touch /usr/local/vesta/data/upgrades/tune-fpm-config-files-v1
+touch /usr/local/vesta/data/upgrades/tune-fpm-config-files-v2
touch /usr/local/vesta/data/upgrades/allow-backup-anytime
touch /usr/local/vesta/data/upgrades/fix-sudoers
touch /usr/local/vesta/data/upgrades/change-clamav-socket-v2
+touch /usr/local/vesta/data/upgrades/change-clamav-socket-v3
+touch /usr/local/vesta/data/upgrades/change-clamav-socket-v4
touch /usr/local/vesta/data/upgrades/keeping-mpm-event
+touch /usr/local/vesta/data/upgrades/keeping-mpm-event-2
+touch /usr/local/vesta/data/upgrades/keeping-mpm-event-3
touch /usr/local/vesta/data/upgrades/fix_ssl_directive_in_templates
touch /usr/local/vesta/data/upgrades/clamav_block_exe_in_archives
touch /usr/local/vesta/data/upgrades/clearing-letsencrypt-pipe
+touch /usr/local/vesta/data/upgrades/limit_max_recipients
+touch /usr/local/vesta/data/upgrades/roundcube_smtp_auth
+touch /usr/local/vesta/data/upgrades/apache_status_public_access
+touch /usr/local/vesta/data/upgrades/update-cloudflare-ips
+touch /usr/local/vesta/data/upgrades/enable-tls-in-proftpd
+touch /usr/local/vesta/data/upgrades/enable_cookie_httponly
+touch /usr/local/vesta/data/upgrades/fix_exim_494_autoreply
+touch /usr/local/vesta/data/upgrades/freshclam_start
+touch /usr/local/vesta/data/upgrades/barracuda_rbl
+touch /usr/local/vesta/data/upgrades/spamhaus_dnsbl_removed
+touch /usr/local/vesta/data/upgrades/v-df-snapshot-make
+touch /usr/local/vesta/data/upgrades/fix-website-permissions-for-all-websites-only-php
# Secret URL
secretquery=''
@@ -1633,18 +2160,24 @@ if [ "$port" != "8083" ]; then
$VESTA/bin/v-change-vesta-port $port
fi
-echo "=== Set URL for phpmyadmin"
echo "DB_PMA_URL='https://$servername/phpmyadmin/'" >> $VESTA/conf/vesta.conf
-if [ "$release" -eq 10 ]; then
+if [ "$release" -gt 9 ]; then
echo "=== Set max_length_of_MySQL_username=80"
+ echo "MAX_DBUSER_LEN=80" >> $VESTA/conf/vesta.conf
fi
-echo "MAX_DBUSER_LEN=80" >> $VESTA/conf/vesta.conf
echo "ALLOW_BACKUP_ANYTIME='yes'" >> $VESTA/conf/vesta.conf
echo "NOTIFY_ADMIN_FULL_BACKUP='$email'" >> $VESTA/conf/vesta.conf
-echo "================================================================"
+echo "=== Adding FileManager license to vesta.conf"
+echo "FILEMANAGER_KEY='FREEFM'" >> $VESTA/conf/vesta.conf
# Removing old PHP sessions files
-crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab -
+touch /var/spool/cron/crontabs/root
+echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;" >> /var/spool/cron/crontabs/root
+
+if [ -f "/root/.bash_profile" ]; then
+ echo "=== Adding v-cd-www alias to root bash profile"
+ echo "alias v-cd-www='source /usr/local/vesta/bin/v-change-dir-www'" >> /root/.bash_profile
+fi
#----------------------------------------------------------#
# myVesta Access Info #
@@ -1652,13 +2185,13 @@ crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -e
# Sending notification to admin email
echo -e "Congratulations, you have just successfully installed \
-Vesta Control Panel
+myVesta Control Panel
https://$ip:$port/$secretquery
username: admin
password: $vpass
-We hope that you enjoy your installation of Vesta. Please \
+We hope that you enjoy your installation of myVesta. Please \
feel free to contact us anytime if you have any questions.
Thank you.
@@ -1668,16 +2201,17 @@ myvestacp.com team
" > $tmpfile
send_mail="$VESTA/web/inc/mail-wrapper.php"
-cat $tmpfile | $send_mail -s "Vesta Control Panel" $email
+cat $tmpfile | $send_mail -s "myVesta Control Panel" $email
# Congrats
-echo '======================================================='
+echo '=========================================='
echo
-echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| '
-echo ' _| _| _| _| _| _| _| '
-echo ' _| _| _|_|_| _|_| _| _|_|_|_| '
-echo ' _| _| _| _| _| _| _| '
-echo ' _| _|_|_|_| _|_|_| _| _| _| '
+echo " __ __ _ "
+echo " _ __ ___ _ \ \ / /__ ___| |_ __ _ "
+echo " | '_ \` _ \| | | \ \ / / _ \/ __| __/ _\` |"
+echo " | | | | | | |_| |\ V / __/\__ \ || (_| |"
+echo " |_| |_| |_|\__, | \_/ \___||___/\__\__,_|"
+echo " |___/ "
echo
echo
cat $tmpfile
diff --git a/src/deb/for-download/nginx/nginx-deb12.conf b/src/deb/for-download/nginx/nginx-deb12.conf
new file mode 100644
index 00000000..cf236824
--- /dev/null
+++ b/src/deb/for-download/nginx/nginx-deb12.conf
@@ -0,0 +1,128 @@
+user admin;
+worker_processes 1;
+error_log /usr/local/vesta/log/nginx-error.log;
+pid /var/run/vesta-nginx.pid;
+
+events {
+ worker_connections 128;
+ use epoll;
+}
+
+http {
+ # Main settings
+ sendfile on;
+ tcp_nopush on;
+ tcp_nodelay on;
+ client_header_timeout 1m;
+ client_body_timeout 3m;
+ client_header_buffer_size 2k;
+ client_body_buffer_size 256k;
+ client_max_body_size 256m;
+ large_client_header_buffers 4 8k;
+ send_timeout 30;
+ keepalive_timeout 60 60;
+ reset_timedout_connection on;
+ server_tokens off;
+ server_name_in_redirect off;
+ server_names_hash_max_size 512;
+ server_names_hash_bucket_size 512;
+
+
+ # Log format
+ log_format main '$remote_addr - $remote_user [$time_local] $request '
+ '"$status" $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+ log_format bytes '$body_bytes_sent';
+ access_log /usr/local/vesta/log/nginx-access.log main;
+
+
+ # SSL PCI Compliance
+ ssl_protocols TLSv1.1 TLSv1.2;
+ ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
+ ssl_session_cache shared:SSL:10m;
+ ssl_prefer_server_ciphers on;
+
+
+ # Mime settings
+ include /usr/local/vesta/nginx/conf/mime.types;
+ default_type application/octet-stream;
+
+
+ # Compression
+ gzip on;
+ gzip_comp_level 9;
+ gzip_min_length 512;
+ gzip_buffers 8 64k;
+ gzip_types text/plain text/css text/javascript
+ application/x-javascript application/javascript;
+ gzip_proxied any;
+
+
+ # Proxy settings
+ proxy_redirect off;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_pass_header Set-Cookie;
+ proxy_connect_timeout 90;
+ proxy_send_timeout 90;
+ proxy_read_timeout 90;
+ proxy_buffers 32 4k;
+ fastcgi_read_timeout 300;
+
+ # Error pages
+ error_page 403 /error/403.html;
+ error_page 404 /error/404.html;
+ error_page 502 503 504 /error/50x.html;
+
+
+ # Vhost
+ server {
+ listen 8083 ssl;
+ server_name _;
+ root /usr/local/vesta/web;
+ charset utf-8;
+
+ # Fix error "The plain HTTP request was sent to HTTPS port"
+ error_page 497 https://$host:$server_port$request_uri;
+
+ # ssl on;
+ ssl_certificate /usr/local/vesta/ssl/certificate.crt;
+ ssl_certificate_key /usr/local/vesta/ssl/certificate.key;
+ ssl_session_cache shared:SSL:10m;
+ ssl_session_timeout 10m;
+
+ error_page 404 /error/404/index.html;
+ error_page 403 /error/index.html;
+ error_page 500 /error/index.html;
+
+ location / {
+ expires max;
+ index index.php;
+ }
+
+ location /error/ {
+ expires max;
+ index index.html;
+ }
+
+ location /rrd/ {
+ expires off;
+ internal;
+ }
+
+ location /backup/ {
+ root /;
+ internal;
+ }
+
+ location ~ \.php$ {
+ include /usr/local/vesta/nginx/conf/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /usr/local/vesta/web/$fastcgi_script_name;
+ fastcgi_param QUERY_STRING $query_string;
+ fastcgi_pass unix:/var/run/vesta-php.sock;
+ fastcgi_intercept_errors on;
+ break;
+ }
+ }
+}
diff --git a/src/deb/for-download/php/php-fpm.conf b/src/deb/for-download/php/php-fpm.conf
index d9a04795..cd0005f8 100644
--- a/src/deb/for-download/php/php-fpm.conf
+++ b/src/deb/for-download/php/php-fpm.conf
@@ -32,3 +32,5 @@ php_admin_value[upload_max_filesize] = 512M
php_admin_value[max_execution_time] = 600
php_admin_value[max_input_time] = 600
php_admin_value[session.save_path] = /usr/local/vesta/data/sessions
+php_admin_flag[session.cookie_httponly] = on
+php_admin_flag[session.cookie_secure] = on
diff --git a/src/deb/for-download/tools/W3TC.json b/src/deb/for-download/tools/W3TC.json
new file mode 100644
index 00000000..0ca4cf8d
--- /dev/null
+++ b/src/deb/for-download/tools/W3TC.json
@@ -0,0 +1,953 @@
+{
+ "version": "2.2.7",
+ "cluster.messagebus.debug": false,
+ "cluster.messagebus.enabled": false,
+ "cluster.messagebus.sns.region": "",
+ "cluster.messagebus.sns.api_key": "",
+ "cluster.messagebus.sns.api_secret": "",
+ "cluster.messagebus.sns.topic_arn": "",
+ "dbcache.configuration_overloaded": false,
+ "dbcache.debug": false,
+ "dbcache.debug_purge": false,
+ "dbcache.enabled": true,
+ "dbcache.engine": "memcached",
+ "dbcache.file.gc": 7200,
+ "dbcache.file.locking": false,
+ "dbcache.lifetime": 3600,
+ "dbcache.memcached.persistent": true,
+ "dbcache.memcached.aws_autodiscovery": false,
+ "dbcache.memcached.servers": [
+ "127.0.0.1:11211"
+ ],
+ "dbcache.memcached.username": "",
+ "dbcache.memcached.password": "",
+ "dbcache.memcached.binary_protocol": true,
+ "dbcache.redis.persistent": true,
+ "dbcache.redis.servers": [
+ "127.0.0.1:6379"
+ ],
+ "dbcache.redis.verify_tls_certificates": true,
+ "dbcache.redis.password": "",
+ "dbcache.redis.dbid": 0,
+ "dbcache.redis.timeout": 0,
+ "dbcache.redis.retry_interval": 0,
+ "dbcache.redis.read_timeout": 0,
+ "dbcache.use_filters": false,
+ "dbcache.reject.constants": [
+ "APP_REQUEST",
+ "DOING_CRON",
+ "DONOTCACHEDB",
+ "SHORTINIT",
+ "XMLRPC_REQUEST"
+ ],
+ "dbcache.reject.cookie": [],
+ "dbcache.reject.logged": true,
+ "dbcache.reject.sql": [
+ "gdsr_",
+ "wp_rg_",
+ "_wp_session_",
+ "_wc_session_"
+ ],
+ "dbcache.reject.uri": [
+ ""
+ ],
+ "dbcache.reject.words": [
+ "^\\s*insert\\b",
+ "^\\s*delete\\b",
+ "^\\s*update\\b",
+ "^\\s*replace\\b",
+ "^\\s*create\\b",
+ "^\\s*alter\\b",
+ "^\\s*show\\b",
+ "^\\s*set\\b",
+ "\\bautoload\\s+=\\s+'yes'",
+ "\\bsql_calc_found_rows\\b",
+ "\\bfound_rows\\(\\)"
+ ],
+ "docroot_fix.enable": false,
+ "lazyload.enabled": false,
+ "lazyload.threshold": "",
+ "lazyload.process_img": true,
+ "lazyload.process_background": true,
+ "lazyload.googlemaps.google_maps_easy": false,
+ "lazyload.googlemaps.wp_google_maps": false,
+ "lazyload.googlemaps.wp_google_map_plugin": false,
+ "lazyload.exclude": [
+ "avia-bg-style-fixed",
+ "data-bgposition=",
+ "data-envira-src=",
+ "data-large_image=",
+ "data-lazy-original=",
+ "data-lazy-src=",
+ "data-lazyload=",
+ "data-lazysrc=",
+ "data-no-lazy=",
+ "data-src=",
+ "data-srcset=",
+ "fullurl=",
+ "lazy-slider-img=",
+ "loading=\"eager\"",
+ "no-lazy",
+ "rev-slidebg",
+ "skip-lazy",
+ "soliloquy-image",
+ "swatch-img",
+ "w3-total-cache",
+ "woocommerce\/assets\/images\/placeholder.png",
+ "wpcf7_captcha"
+ ],
+ "lazyload.embed_method": "async_head",
+ "objectcache.configuration_overloaded": false,
+ "objectcache.enabled": true,
+ "objectcache.debug": false,
+ "objectcache.debug_purge": false,
+ "objectcache.enabled_for_wp_admin": false,
+ "objectcache.fallback_transients": true,
+ "objectcache.engine": "memcached",
+ "objectcache.file.gc": 7200,
+ "objectcache.file.locking": false,
+ "objectcache.memcached.servers": [
+ "127.0.0.1:11211"
+ ],
+ "objectcache.memcached.persistent": true,
+ "objectcache.memcached.aws_autodiscovery": false,
+ "objectcache.memcached.username": "",
+ "objectcache.memcached.password": "",
+ "objectcache.memcached.binary_protocol": true,
+ "objectcache.redis.persistent": true,
+ "objectcache.redis.servers": [
+ "127.0.0.1:6379"
+ ],
+ "objectcache.redis.verify_tls_certificates": true,
+ "objectcache.redis.password": "",
+ "objectcache.redis.dbid": 0,
+ "objectcache.redis.timeout": 0,
+ "objectcache.redis.retry_interval": 0,
+ "objectcache.redis.read_timeout": 0,
+ "objectcache.groups.global": [
+ "users",
+ "userlogins",
+ "usermeta",
+ "user_meta",
+ "site-transient",
+ "site-options",
+ "site-lookup",
+ "blog-lookup",
+ "blog-details",
+ "rss",
+ "global-posts"
+ ],
+ "objectcache.groups.nonpersistent": [
+ "counts",
+ "plugins"
+ ],
+ "objectcache.lifetime": 3600,
+ "objectcache.purge.all": false,
+ "pgcache.configuration_overloaded": false,
+ "pgcache.enabled": true,
+ "pgcache.comment_cookie_ttl": 86400,
+ "pgcache.debug": false,
+ "pgcache.debug_purge": false,
+ "pgcache.engine": "file_generic",
+ "pgcache.file.gc": 3600,
+ "pgcache.file.nfs": false,
+ "pgcache.file.locking": false,
+ "pgcache.lifetime": 86400,
+ "pgcache.memcached.servers": [
+ "127.0.0.1:11211"
+ ],
+ "pgcache.memcached.persistent": true,
+ "pgcache.memcached.aws_autodiscovery": false,
+ "pgcache.memcached.username": "",
+ "pgcache.memcached.password": "",
+ "pgcache.memcached.binary_protocol": true,
+ "pgcache.redis.persistent": true,
+ "pgcache.redis.servers": [
+ "127.0.0.1:6379"
+ ],
+ "pgcache.redis.verify_tls_certificates": true,
+ "pgcache.redis.password": "",
+ "pgcache.redis.dbid": 0,
+ "pgcache.redis.timeout": 0,
+ "pgcache.redis.retry_interval": 0,
+ "pgcache.redis.read_timeout": 0,
+ "pgcache.cache.query": false,
+ "pgcache.cache.home": true,
+ "pgcache.cache.feed": false,
+ "pgcache.cache.nginx_handle_xml": false,
+ "pgcache.cache.ssl": true,
+ "pgcache.cache.404": false,
+ "pgcache.cache.headers": [
+ "Last-Modified",
+ "Content-Type",
+ "X-Pingback",
+ "P3P",
+ "Link"
+ ],
+ "pgcache.compatibility": false,
+ "pgcache.remove_charset": false,
+ "pgcache.accept.uri": [
+ "sitemap(_index)?\\.xml(\\.gz)?",
+ "([a-z0-9_\\-]+)?sitemap\\.xsl",
+ "[a-z0-9_\\-]+-sitemap([0-9]+)?\\.xml(\\.gz)?"
+ ],
+ "pgcache.accept.files": [
+ "wp-comments-popup.php",
+ "wp-links-opml.php",
+ "wp-locations.php"
+ ],
+ "pgcache.accept.qs": [
+ ""
+ ],
+ "pgcache.late_init": false,
+ "pgcache.late_caching": false,
+ "pgcache.mirrors.enabled": false,
+ "pgcache.mirrors.home_urls": [
+ ""
+ ],
+ "pgcache.reject.front_page": false,
+ "pgcache.reject.logged": true,
+ "pgcache.reject.logged_roles": false,
+ "pgcache.reject.roles": [
+ ""
+ ],
+ "pgcache.reject.uri": [
+ "wp-.*\\.php",
+ "index\\.php"
+ ],
+ "pgcache.reject.categories": [
+ ""
+ ],
+ "pgcache.reject.tags": [
+ ""
+ ],
+ "pgcache.reject.authors": [
+ ""
+ ],
+ "pgcache.reject.custom": [
+ ""
+ ],
+ "pgcache.reject.ua": [
+ ""
+ ],
+ "pgcache.reject.cookie": [
+ "wptouch_switch_toggle"
+ ],
+ "pgcache.reject.request_head": false,
+ "pgcache.purge.front_page": true,
+ "pgcache.purge.home": true,
+ "pgcache.purge.post": true,
+ "pgcache.purge.comments": false,
+ "pgcache.purge.author": false,
+ "pgcache.purge.terms": false,
+ "pgcache.purge.archive.daily": false,
+ "pgcache.purge.archive.monthly": false,
+ "pgcache.purge.archive.yearly": false,
+ "pgcache.purge.feed.blog": true,
+ "pgcache.purge.feed.comments": false,
+ "pgcache.purge.feed.author": false,
+ "pgcache.purge.feed.terms": false,
+ "pgcache.purge.feed.types": [
+ "rss2"
+ ],
+ "pgcache.purge.postpages_limit": 10,
+ "pgcache.purge.pages": [
+ ""
+ ],
+ "pgcache.purge.sitemap_regex": "([a-z0-9_\\-]*?)sitemap([a-z0-9_\\-]*)?\\.xml",
+ "pgcache.prime.enabled": false,
+ "pgcache.prime.interval": 900,
+ "pgcache.prime.limit": 10,
+ "pgcache.prime.sitemap": "",
+ "pgcache.prime.post.enabled": false,
+ "pgcache.rest": "",
+ "pgcache.cookiegroups.enabled": false,
+ "pgcache.cookiegroups.groups": {
+ "mobile": {
+ "enabled": false,
+ "cache": true,
+ "cookies": [
+ "wptouch-pro-view=mobile",
+ "wptouch-pro-cache-state=mobile"
+ ]
+ },
+ "loggedin": {
+ "enabled": false,
+ "cache": true,
+ "cookies": [
+ "wordpress_logged_in_.*"
+ ]
+ },
+ "subscribers": {
+ "enabled": false,
+ "cache": true,
+ "cookies": [
+ "role=subscriber",
+ "role=member"
+ ]
+ }
+ },
+ "stats.enabled": false,
+ "stats.slot_seconds": 60,
+ "stats.slots_count": 60,
+ "stats.cpu.enabled": false,
+ "stats.access_log.enabled": false,
+ "stats.access_log.filename": "",
+ "stats.access_log.format": "%h %l %u %t \\\"%r\\\" %>s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"",
+ "stats.access_log.webserver": "apache",
+ "minify.configuration_overloaded": false,
+ "minify.enabled": false,
+ "minify.auto": true,
+ "minify.debug": false,
+ "minify.engine": "file",
+ "minify.error.notification": "",
+ "minify.file.gc": 86400,
+ "minify.file.nfs": false,
+ "minify.file.locking": false,
+ "minify.memcached.servers": [
+ "127.0.0.1:11211"
+ ],
+ "minify.memcached.persistent": true,
+ "minify.memcached.aws_autodiscovery": false,
+ "minify.memcached.username": "",
+ "minify.memcached.password": "",
+ "minify.memcached.binary_protocol": true,
+ "minify.redis.persistent": true,
+ "minify.redis.servers": [
+ "127.0.0.1:6379"
+ ],
+ "minify.redis.verify_tls_certificates": true,
+ "minify.redis.password": "",
+ "minify.redis.dbid": 0,
+ "minify.redis.timeout": 0,
+ "minify.redis.retry_interval": 0,
+ "minify.redis.read_timeout": 0,
+ "minify.rewrite": true,
+ "minify.options": [],
+ "minify.symlinks": [],
+ "minify.lifetime": 86400,
+ "minify.upload": true,
+ "minify.html.enable": false,
+ "minify.html.engine": "html",
+ "minify.html.reject.feed": false,
+ "minify.html.inline.css": false,
+ "minify.html.inline.js": false,
+ "minify.html.strip.crlf": false,
+ "minify.html.comments.ignore": [
+ "google_ad_",
+ "RSPEAK_",
+ "mfunc"
+ ],
+ "minify.css.enable": true,
+ "minify.css.engine": "css",
+ "minify.css.method": "both",
+ "minify.css.http2push": false,
+ "minify.css.strip.comments": false,
+ "minify.css.strip.crlf": false,
+ "minify.css.embed": false,
+ "minify.css.imports": "",
+ "minify.css.groups": [],
+ "minify.js.http2push": false,
+ "minify.js.enable": true,
+ "minify.js.engine": "js",
+ "minify.js.method": "both",
+ "minify.js.combine.header": false,
+ "minify.js.header.embed_type": "blocking",
+ "minify.js.combine.body": false,
+ "minify.js.body.embed_type": "blocking",
+ "minify.js.combine.footer": false,
+ "minify.js.footer.embed_type": "blocking",
+ "minify.js.strip.comments": false,
+ "minify.js.strip.crlf": false,
+ "minify.js.groups": [],
+ "minify.yuijs.path.java": "java",
+ "minify.yuijs.path.jar": "yuicompressor.jar",
+ "minify.yuijs.options.line-break": 5000,
+ "minify.yuijs.options.nomunge": false,
+ "minify.yuijs.options.preserve-semi": false,
+ "minify.yuijs.options.disable-optimizations": false,
+ "minify.yuicss.path.java": "java",
+ "minify.yuicss.path.jar": "yuicompressor.jar",
+ "minify.yuicss.options.line-break": 5000,
+ "minify.ccjs.path.java": "java",
+ "minify.ccjs.path.jar": "compiler.jar",
+ "minify.ccjs.options.compilation_level": "SIMPLE_OPTIMIZATIONS",
+ "minify.ccjs.options.formatting": "",
+ "minify.csstidy.options.remove_bslash": true,
+ "minify.csstidy.options.compress_colors": false,
+ "minify.csstidy.options.compress_font-weight": false,
+ "minify.csstidy.options.lowercase_s": false,
+ "minify.csstidy.options.optimise_shorthands": 0,
+ "minify.csstidy.options.remove_last_;": false,
+ "minify.csstidy.options.remove_space_before_important": false,
+ "minify.csstidy.options.case_properties": 1,
+ "minify.csstidy.options.sort_properties": false,
+ "minify.csstidy.options.sort_selectors": false,
+ "minify.csstidy.options.merge_selectors": 0,
+ "minify.csstidy.options.discard_invalid_selectors": false,
+ "minify.csstidy.options.discard_invalid_properties": false,
+ "minify.csstidy.options.css_level": "CSS3.0",
+ "minify.csstidy.options.preserve_css": false,
+ "minify.csstidy.options.timestamp": false,
+ "minify.csstidy.options.template": "highest_compression",
+ "minify.htmltidy.options.clean": false,
+ "minify.htmltidy.options.hide-comments": true,
+ "minify.htmltidy.options.wrap": 0,
+ "minify.reject.logged": false,
+ "minify.reject.ua": [],
+ "minify.reject.uri": [],
+ "minify.reject.files.js": [],
+ "minify.reject.files.css": [],
+ "minify.cache.files": [
+ ""
+ ],
+ "minify.cache.files_regexp": false,
+ "cdn.configuration_overloaded": false,
+ "cdn.enabled": false,
+ "cdn.debug": false,
+ "cdn.flush_manually": false,
+ "cdn.engine": "stackpath2",
+ "cdn.uploads.enable": true,
+ "cdn.includes.enable": true,
+ "cdn.includes.files": "*.css;*.js;*.gif;*.png;*.jpg;*.xml",
+ "cdn.theme.enable": true,
+ "cdn.theme.files": "*.css;*.js;*.gif;*.png;*.jpg;*.ico;*.ttf;*.otf;*.woff;*.woff2;*.less",
+ "cdn.minify.enable": true,
+ "cdn.custom.enable": true,
+ "cdn.custom.files": [
+ "favicon.ico",
+ "{wp_content_dir}\/gallery\/*",
+ "{wp_content_dir}\/uploads\/avatars\/*",
+ "{plugins_dir}\/wordpress-seo\/css\/xml-sitemap.xsl",
+ "{plugins_dir}\/wp-minify\/min*",
+ "{plugins_dir}\/*.js",
+ "{plugins_dir}\/*.css",
+ "{plugins_dir}\/*.gif",
+ "{plugins_dir}\/*.jpg",
+ "{plugins_dir}\/*.png"
+ ],
+ "cdn.import.files": false,
+ "cdn.queue.interval": 900,
+ "cdn.queue.limit": 25,
+ "cdn.force.rewrite": false,
+ "cdn.autoupload.enabled": false,
+ "cdn.autoupload.interval": 3600,
+ "cdn.canonical_header": false,
+ "cdn.admin.media_library": false,
+ "cdn.cors_header": true,
+ "cdn.ftp.host": "",
+ "cdn.ftp.type": "",
+ "cdn.ftp.user": "",
+ "cdn.ftp.pass": "",
+ "cdn.ftp.path": "",
+ "cdn.ftp.pasv": false,
+ "cdn.ftp.domain": [],
+ "cdn.ftp.ssl": "auto",
+ "cdn.ftp.default_keys": true,
+ "cdn.ftp.pubkey": "",
+ "cdn.ftp.privkey": "",
+ "cdn.google_drive.client_id": "",
+ "cdn.google_drive.refresh_token": "",
+ "cdn.google_drive.folder.id": "",
+ "cdn.google_drive.folder.title": "",
+ "cdn.google_drive.folder.url": "",
+ "cdn.highwinds.account_hash": "",
+ "cdn.highwinds.api_token": "",
+ "cdn.highwinds.host.hash_code": "",
+ "cdn.highwinds.host.domains": [],
+ "cdn.highwinds.ssl": "auto",
+ "cdn.s3.key": "",
+ "cdn.s3.secret": "",
+ "cdn.s3.bucket": "",
+ "cdn.s3.bucket.location": "us-east-1",
+ "cdn.s3.cname": [],
+ "cdn.s3.ssl": "auto",
+ "cdn.s3.public_objects": "enabled",
+ "cdn.s3_compatible.api_host": "auto",
+ "cdn.cf.key": "",
+ "cdn.cf.secret": "",
+ "cdn.cf.bucket": "",
+ "cdn.cf.bucket.location": "us-east-1",
+ "cdn.cf.id": "",
+ "cdn.cf.cname": [],
+ "cdn.cf.ssl": "auto",
+ "cdn.cf.public_objects": "enabled",
+ "cdn.cf2.key": "",
+ "cdn.cf2.secret": "",
+ "cdn.cf2.id": "",
+ "cdn.cf2.cname": [],
+ "cdn.cf2.ssl": "",
+ "cdn.rscf.user": "",
+ "cdn.rscf.key": "",
+ "cdn.rscf.location": "us",
+ "cdn.rscf.container": "",
+ "cdn.rscf.cname": [],
+ "cdn.rscf.ssl": "auto",
+ "cdn.rackspace_cdn.user_name": "",
+ "cdn.rackspace_cdn.api_key": "",
+ "cdn.rackspace_cdn.region": "",
+ "cdn.rackspace_cdn.service.access_url": "",
+ "cdn.rackspace_cdn.service.id": "",
+ "cdn.rackspace_cdn.service.name": "",
+ "cdn.rackspace_cdn.service.protocol": "http",
+ "cdn.rackspace_cdn.domains": [],
+ "cdn.azure.user": "",
+ "cdn.azure.key": "",
+ "cdn.azure.container": "",
+ "cdn.azure.cname": [],
+ "cdn.azure.ssl": "auto",
+ "cdn.mirror.domain": [],
+ "cdn.mirror.ssl": "auto",
+ "cdn.limelight.short_name": "",
+ "cdn.limelight.username": "",
+ "cdn.limelight.api_key": "",
+ "cdn.limelight.host.domains": [],
+ "cdn.limelight.ssl": "auto",
+ "cdn.maxcdn.authorization_key": "",
+ "cdn.maxcdn.domain": [],
+ "cdn.maxcdn.ssl": "auto",
+ "cdn.maxcdn.zone_id": 0,
+ "cdn.cotendo.username": "",
+ "cdn.cotendo.password": "",
+ "cdn.cotendo.zones": [],
+ "cdn.cotendo.domain": [],
+ "cdn.cotendo.ssl": "auto",
+ "cdn.akamai.username": "",
+ "cdn.akamai.password": "",
+ "cdn.akamai.email_notification": [],
+ "cdn.akamai.action": "invalidate",
+ "cdn.akamai.zone": "production",
+ "cdn.akamai.domain": [],
+ "cdn.akamai.ssl": "auto",
+ "cdn.edgecast.account": "",
+ "cdn.edgecast.token": "",
+ "cdn.edgecast.domain": [],
+ "cdn.edgecast.ssl": "auto",
+ "cdn.att.account": "",
+ "cdn.att.token": "",
+ "cdn.att.domain": [],
+ "cdn.att.ssl": "auto",
+ "cdn.stackpath.authorization_key": "",
+ "cdn.stackpath.domain": [],
+ "cdn.stackpath.ssl": "auto",
+ "cdn.stackpath.zone_id": 0,
+ "cdn.stackpath2.client_id": "",
+ "cdn.stackpath2.client_secret": "",
+ "cdn.stackpath2.stack_id": "",
+ "cdn.stackpath2.site_id": 0,
+ "cdn.stackpath2.site_root_domain": 0,
+ "cdn.stackpath2.domain": [],
+ "cdn.stackpath2.ssl": "auto",
+ "cdn.reject.admins": false,
+ "cdn.reject.logged_roles": false,
+ "cdn.reject.roles": [],
+ "cdn.reject.ua": [],
+ "cdn.reject.uri": [],
+ "cdn.reject.files": [
+ "{uploads_dir}\/wpcf7_captcha\/*",
+ "{uploads_dir}\/imagerotator.swf",
+ "{plugins_dir}\/wp-fb-autoconnect\/facebook-platform\/channel.html"
+ ],
+ "cdn.reject.ssl": false,
+ "cdnfsd.enabled": false,
+ "cdnfsd.engine": "",
+ "cdnfsd.debug": false,
+ "cdnfsd.cloudfront.access_key": "",
+ "cdnfsd.cloudfront.secret_key": "",
+ "cdnfsd.cloudfront.distribution_id": "",
+ "cdnfsd.limelight.short_name": "",
+ "cdnfsd.limelight.username": "",
+ "cdnfsd.limelight.api_key": "",
+ "cdnfsd.maxcdn.api_key": "",
+ "cdnfsd.maxcdn.zone_id": 0,
+ "cdnfsd.stackpath.api_key": "",
+ "cdnfsd.stackpath.zone_id": 0,
+ "cdnfsd.stackpath2.client_id": "",
+ "cdnfsd.stackpath2.client_secret": "",
+ "cdnfsd.stackpath2.stack_id": "",
+ "cdnfsd.stackpath2.site_id": 0,
+ "cdnfsd.stackpath2.site_root_domain": 0,
+ "cdnfsd.stackpath2.domain": [],
+ "cdnfsd.stackpath2.ssl": "auto",
+ "cdnfsd.transparentcdn.client_id": "",
+ "cdnfsd.transparentcdn.client_secret": "",
+ "cdnfsd.transparentcdn.company_id": "",
+ "varnish.configuration_overloaded": false,
+ "varnish.enabled": false,
+ "varnish.debug": false,
+ "varnish.servers": [
+ ""
+ ],
+ "browsercache.configuration_overloaded": false,
+ "browsercache.enabled": false,
+ "browsercache.rewrite": false,
+ "browsercache.no404wp": false,
+ "browsercache.no404wp.exceptions": [
+ "robots\\.txt",
+ "[a-z0-9_\\-]*sitemap[a-z0-9_\\.\\-]*\\.(xml|xsl|html)(\\.gz)?"
+ ],
+ "browsercache.cssjs.last_modified": true,
+ "browsercache.cssjs.compression": true,
+ "browsercache.cssjs.brotli": false,
+ "browsercache.cssjs.expires": true,
+ "browsercache.cssjs.lifetime": 31536000,
+ "browsercache.cssjs.nocookies": true,
+ "browsercache.cssjs.cache.control": false,
+ "browsercache.cssjs.cache.policy": "cache_public_maxage",
+ "browsercache.cssjs.etag": true,
+ "browsercache.cssjs.w3tc": false,
+ "browsercache.cssjs.replace": false,
+ "browsercache.cssjs.querystring": false,
+ "browsercache.html.compression": true,
+ "browsercache.html.brotli": false,
+ "browsercache.html.last_modified": true,
+ "browsercache.html.expires": false,
+ "browsercache.html.lifetime": 3600,
+ "browsercache.html.cache.control": false,
+ "browsercache.html.cache.policy": "cache_public_maxage",
+ "browsercache.html.etag": true,
+ "browsercache.html.w3tc": false,
+ "browsercache.html.replace": false,
+ "browsercache.other.last_modified": true,
+ "browsercache.other.compression": true,
+ "browsercache.other.brotli": false,
+ "browsercache.other.expires": true,
+ "browsercache.other.lifetime": 31536000,
+ "browsercache.other.nocookies": true,
+ "browsercache.other.cache.control": false,
+ "browsercache.other.cache.policy": "cache_public_maxage",
+ "browsercache.other.etag": true,
+ "browsercache.other.w3tc": false,
+ "browsercache.other.replace": false,
+ "browsercache.other.querystring": false,
+ "browsercache.replace.exceptions": [],
+ "browsercache.security.session.cookie_httponly": "",
+ "browsercache.security.session.cookie_secure": "",
+ "browsercache.security.session.use_only_cookies": "",
+ "browsercache.hsts": false,
+ "browsercache.security.hsts.directive": "maxage",
+ "browsercache.security.xfo": false,
+ "browsercache.security.xfo.directive": "same",
+ "browsercache.security.xfo.allow": "",
+ "browsercache.security.xss": false,
+ "browsercache.security.xss.directive": "block",
+ "browsercache.security.xcto": false,
+ "browsercache.security.pkp": false,
+ "browsercache.security.pkp.pin": "",
+ "browsercache.security.pkp.pin.backup": "",
+ "browsercache.security.pkp.extra": "maxage",
+ "browsercache.security.pkp.report.url": "",
+ "browsercache.security.pkp.report.only": "0",
+ "browsercache.security.referrer.policy": "false",
+ "browsercache.security.referrer.policy.directive": "no-referrer-when-downgrade",
+ "browsercache.security.csp": false,
+ "browsercache.security.csp.base": "",
+ "browsercache.security.csp.frame": "",
+ "browsercache.security.csp.connect": "",
+ "browsercache.security.csp.font": "",
+ "browsercache.security.csp.script": "",
+ "browsercache.security.csp.style": "",
+ "browsercache.security.csp.img": "",
+ "browsercache.security.csp.media": "",
+ "browsercache.security.csp.object": "",
+ "browsercache.security.csp.plugin": "",
+ "browsercache.security.csp.form": "",
+ "browsercache.security.csp.frame.ancestors": "",
+ "browsercache.security.csp.sandbox": "",
+ "browsercache.security.csp.default": "",
+ "browsercache.security.fp": false,
+ "browsercache.security.fp.values": [],
+ "mobile.configuration_overloaded": false,
+ "mobile.enabled": false,
+ "mobile.rgroups": {
+ "tablets": {
+ "theme": "",
+ "enabled": false,
+ "redirect": "",
+ "agents": [
+ "a1-32ab0",
+ "a210",
+ "a211",
+ "b6000-h",
+ "b8000-h",
+ "bnrv200",
+ "bntv400",
+ "darwin",
+ "gt-n8005",
+ "gt-p3105",
+ "gt-p6810",
+ "gt-p7510",
+ "hmj37",
+ "hp-tablet",
+ "hp\\sslate",
+ "hp\\sslatebook",
+ "ht7s3",
+ "ideatab_a1107",
+ "ideataba2109a",
+ "ideos\\ss7",
+ "imm76d",
+ "ipad",
+ "k00f",
+ "kfjwi",
+ "kfot",
+ "kftt",
+ "kindle",
+ "l-06c",
+ "lg-f200k",
+ "lg-f200l",
+ "lg-f200s",
+ "m470bsa",
+ "m470bse",
+ "maxwell",
+ "me173x",
+ "mediapad",
+ "midc497",
+ "msi\\senjoy\\s10\\splus",
+ "mz601",
+ "mz616",
+ "nexus",
+ "nookcolor",
+ "pg09410",
+ "pg41200",
+ "pmp5570c",
+ "pmp5588c",
+ "pocketbook",
+ "qmv7a",
+ "sgp311",
+ "sgpt12",
+ "shv-e230k",
+ "shw-m305w",
+ "shw-m380w",
+ "sm-p605",
+ "smarttab",
+ "sonysgp321",
+ "sph-p500",
+ "surfpad",
+ "tab07-200",
+ "tab10-201",
+ "tab465euk",
+ "tab474",
+ "tablet",
+ "tegranote",
+ "tf700t",
+ "thinkpad",
+ "viewpad",
+ "voltaire"
+ ]
+ },
+ "phones": {
+ "theme": "",
+ "enabled": false,
+ "redirect": "",
+ "agents": [
+ "(android|bb\\d+|meego).+mobile",
+ "240x320",
+ "2.0\\ mmp",
+ "\\bppc\\b",
+ "acer\\ s100",
+ "alcatel",
+ "amoi",
+ "archos5",
+ "asus",
+ "au-mic",
+ "audiovox",
+ "avantgo",
+ "bada",
+ "benq",
+ "bird",
+ "blackberry",
+ "blazer",
+ "cdm",
+ "cellphone",
+ "cupcake",
+ "danger",
+ "ddipocket",
+ "docomo",
+ "docomo\\ ht-03a",
+ "dopod",
+ "dream",
+ "elaine\/3.0",
+ "ericsson",
+ "eudoraweb",
+ "fly",
+ "froyo",
+ "googlebot-mobile",
+ "haier",
+ "hiptop",
+ "hp.ipaq",
+ "htc",
+ "htc\\ hero",
+ "htc\\ magic",
+ "htc_dream",
+ "htc_magic",
+ "huawei",
+ "i-mobile",
+ "iemobile",
+ "iemobile\/7",
+ "iemobile\/7.0",
+ "iemobile\/9",
+ "incognito",
+ "iphone",
+ "ipod",
+ "j-phone",
+ "kddi",
+ "konka",
+ "kwc",
+ "kyocera\/wx310k",
+ "lenovo",
+ "lg",
+ "lg\/u990",
+ "lg-gw620",
+ "lge\\ vx",
+ "liquid\\ build",
+ "maemo",
+ "midp",
+ "midp-2.0",
+ "mmef20",
+ "mmp",
+ "mobilephone",
+ "mot-mb200",
+ "mot-mb300",
+ "mot-v",
+ "motorola",
+ "msie\\ 10.0",
+ "netfront",
+ "newgen",
+ "newt",
+ "nexus\\ 7",
+ "nexus\\ one",
+ "nintendo\\ ds",
+ "nintendo\\ wii",
+ "nitro",
+ "nokia",
+ "novarra",
+ "openweb",
+ "opera\\ mini",
+ "opera\\ mobi",
+ "opera.mobi",
+ "p160u",
+ "palm",
+ "panasonic",
+ "pantech",
+ "pdxgw",
+ "pg",
+ "philips",
+ "phone",
+ "playbook",
+ "playstation\\ portable",
+ "portalmmm",
+ "proxinet",
+ "psp",
+ "qtek",
+ "s8000",
+ "sagem",
+ "samsung",
+ "samsung-s8000",
+ "sanyo",
+ "sch",
+ "sch-i800",
+ "sec",
+ "sendo",
+ "series60.*webkit",
+ "series60\/5.0",
+ "sgh",
+ "sharp",
+ "sharp-tq-gx10",
+ "small",
+ "smartphone",
+ "softbank",
+ "sonyericsson",
+ "sonyericssone10",
+ "sonyericssonu20",
+ "sonyericssonx10",
+ "sph",
+ "symbian",
+ "symbian\\ os",
+ "symbianos",
+ "t-mobile\\ mytouch\\ 3g",
+ "t-mobile\\ opal",
+ "tattoo",
+ "toshiba",
+ "touch",
+ "treo",
+ "ts21i-10",
+ "up.browser",
+ "up.link",
+ "uts",
+ "vertu",
+ "vodafone",
+ "wap",
+ "webmate",
+ "webos",
+ "willcome",
+ "windows\\ ce",
+ "windows.ce",
+ "winwap",
+ "xda",
+ "xoom",
+ "zte"
+ ]
+ }
+ },
+ "referrer.configuration_overloaded": false,
+ "referrer.enabled": false,
+ "referrer.rgroups": {
+ "search_engines": {
+ "theme": "",
+ "enabled": false,
+ "redirect": "",
+ "referrers": [
+ "google\\.com",
+ "yahoo\\.com",
+ "bing\\.com",
+ "ask\\.com",
+ "msn\\.com"
+ ]
+ }
+ },
+ "common.track_usage": true,
+ "common.tweeted": false,
+ "config.check": true,
+ "config.path": "",
+ "widget.latest.items": 3,
+ "widget.latest_news.items": 5,
+ "widget.pagespeed.enabled": false,
+ "widget.pagespeed.key": "",
+ "widget.pagespeed.key.restrict.referrer": "",
+ "widget.pagespeed.show_in_admin_bar": false,
+ "timelimit.email_send": 180,
+ "timelimit.varnish_purge": 300,
+ "timelimit.cache_flush": 600,
+ "timelimit.cache_gc": 600,
+ "timelimit.cdn_upload": 600,
+ "timelimit.cdn_delete": 300,
+ "timelimit.cdn_purge": 300,
+ "timelimit.cdn_import": 600,
+ "timelimit.cdn_test": 300,
+ "timelimit.domain_rename": 120,
+ "timelimit.minify_recommendations": 600,
+ "common.instance_id": 1165104676,
+ "common.force_master": true,
+ "extensions.active": {
+ "fragmentcache": "w3-total-cache\/Extension_FragmentCache_Plugin.php"
+ },
+ "extensions.active_frontend": [],
+ "extensions.active_dropin": [],
+ "plugin.license_key": "",
+ "plugin.type": "",
+ "jquerymigrate.disabled": false,
+ "imageservice": {
+ "compression": "lossy",
+ "auto": "enabled",
+ "visibility": "never"
+ },
+ "imageservice.configuration_overloaded": true,
+ "robots_block.enable": false,
+ "fragmentcache": {
+ "engine": "memcached"
+ },
+ "pgcache.bad_behavior_path": "",
+ "newrelic": {
+ "monitoring_type": "apm"
+ }
+}
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.sh
index 4f54592d..081aaf19 100755
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.sh
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.sh
@@ -18,7 +18,7 @@ group = $1
pm = ondemand
pm.max_children = 8
-request_terminate_timeout = 90s
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 30
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -46,6 +46,7 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
write_file=0
if [ ! -f "$pool_file_56" ]; then
@@ -58,7 +59,8 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "/etc/php/5.6/fpm/pool.d/www.conf" ]; then
rm /etc/php/5.6/fpm/pool.d/www.conf
@@ -66,27 +68,39 @@ fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
+
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
if [ -f "$pool_file_73" ]; then
rm $pool_file_73
- service php7.3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
if [ -f "$pool_file_74" ]; then
rm $pool_file_74
- service php7.4-fpm restart
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
fi
exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.stpl
index eb5631db..a24b368f 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.stpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.tpl
index cd4e797d..55bc8233 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.tpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-56.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.sh
index fefdf195..10c58c57 100755
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.sh
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.sh
@@ -18,7 +18,7 @@ group = $1
pm = ondemand
pm.max_children = 8
-request_terminate_timeout = 90s
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 30
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -46,10 +46,12 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
write_file=0
@@ -63,7 +65,8 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
if [ -f "/etc/php/7.0/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.0/fpm/pool.d/www.conf
@@ -71,22 +74,32 @@ fi
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
if [ -f "$pool_file_73" ]; then
rm $pool_file_73
- service php7.3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
if [ -f "$pool_file_74" ]; then
rm $pool_file_74
- service php7.4-fpm restart
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
fi
exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.stpl
index 38285302..5d944c0f 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.stpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.tpl
index 7d30d39c..c9378152 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.tpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-70.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.sh
index 8688598c..90230674 100755
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.sh
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.sh
@@ -18,7 +18,7 @@ group = $1
pm = ondemand
pm.max_children = 8
-request_terminate_timeout = 90s
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 30
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -46,15 +46,18 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
write_file=0
@@ -68,7 +71,8 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "/etc/php/7.1/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.1/fpm/pool.d/www.conf
@@ -76,17 +80,27 @@ fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
+
if [ -f "$pool_file_73" ]; then
rm $pool_file_73
- service php7.3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
if [ -f "$pool_file_74" ]; then
rm $pool_file_74
- service php7.4-fpm restart
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
fi
exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.stpl
index c5d284f7..a718b21f 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.stpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.tpl
index 695b9937..9f0cf8a7 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.tpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-71.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.sh
index 33442862..cc76256e 100755
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.sh
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.sh
@@ -18,7 +18,7 @@ group = $1
pm = ondemand
pm.max_children = 8
-request_terminate_timeout = 90s
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 30
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -46,20 +46,24 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
write_file=0
@@ -73,7 +77,8 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
if [ -f "/etc/php/7.2/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.2/fpm/pool.d/www.conf
@@ -81,12 +86,20 @@ fi
if [ -f "$pool_file_73" ]; then
rm $pool_file_73
- service php7.3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
if [ -f "$pool_file_74" ]; then
rm $pool_file_74
- service php7.4-fpm restart
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
fi
exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.stpl
index 2b4363b4..20792e92 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.stpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.tpl
index be2ca7ae..89b19147 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.tpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-72.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.sh
index 1cddda74..a2fea927 100755
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.sh
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.sh
@@ -17,8 +17,8 @@ user = $1
group = $1
pm = ondemand
-pm.max_children = 16
-request_terminate_timeout = 30s
+pm.max_children = 8
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 20
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -46,25 +46,30 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
write_file=0
@@ -78,7 +83,8 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_73
- service php7.3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
if [ -f "/etc/php/7.3/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.3/fpm/pool.d/www.conf
@@ -86,7 +92,14 @@ fi
if [ -f "$pool_file_74" ]; then
rm $pool_file_74
- service php7.4-fpm restart
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
fi
-exit 0
\ No newline at end of file
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.stpl
index 9660c234..39777224 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.stpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.tpl
index 892c0d1f..b6e306d7 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.tpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73-public.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.sh
index 72f9cec6..a2fea927 100755
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.sh
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.sh
@@ -18,7 +18,7 @@ group = $1
pm = ondemand
pm.max_children = 8
-request_terminate_timeout = 90s
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 30
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -46,25 +46,30 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
write_file=0
@@ -78,7 +83,8 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_73
- service php7.3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
if [ -f "/etc/php/7.3/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.3/fpm/pool.d/www.conf
@@ -86,7 +92,14 @@ fi
if [ -f "$pool_file_74" ]; then
rm $pool_file_74
- service php7.4-fpm restart
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
fi
exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.stpl
index 28224413..902d647a 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.stpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.tpl
index 7bec5e73..40df2629 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.tpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-73.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.sh
index 64cbaaf6..e72bb003 100755
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.sh
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.sh
@@ -17,8 +17,8 @@ user = $1
group = $1
pm = ondemand
-pm.max_children = 16
-request_terminate_timeout = 30s
+pm.max_children = 8
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 20
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -46,30 +46,36 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
if [ -f "$pool_file_73" ]; then
rm $pool_file_73
- service php7-3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
write_file=0
@@ -83,10 +89,17 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_74
- service php7.4-fpm restart
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
fi
if [ -f "/etc/php/7.4/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.4/fpm/pool.d/www.conf
fi
-exit 0
\ No newline at end of file
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.stpl
index fdbc26f9..739cb48d 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.stpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.tpl
index 614f20c3..f31ed5a8 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.tpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74-public.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.sh
index 552cd112..e72bb003 100755
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.sh
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.sh
@@ -18,7 +18,7 @@ group = $1
pm = ondemand
pm.max_children = 8
-request_terminate_timeout = 90s
+request_terminate_timeout = 360s
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
@@ -26,10 +26,10 @@ pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/$1/tmp
php_admin_value[session.save_path] = /home/$1/tmp
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
-php_admin_value[upload_max_filesize] = 80M
-php_admin_value[max_execution_time] = 30
-php_admin_value[post_max_size] = 80M
-php_admin_value[memory_limit] = 256M
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
php_admin_flag[mysql.allow_persistent] = off
php_admin_flag[safe_mode] = off
@@ -46,30 +46,36 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
if [ -f "$pool_file_56" ]; then
rm $pool_file_56
- service php5.6-fpm restart
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
fi
if [ -f "$pool_file_70" ]; then
rm $pool_file_70
- service php7.0-fpm restart
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
fi
if [ -f "$pool_file_71" ]; then
rm $pool_file_71
- service php7.1-fpm restart
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
fi
if [ -f "$pool_file_72" ]; then
rm $pool_file_72
- service php7.2-fpm restart
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
fi
if [ -f "$pool_file_73" ]; then
rm $pool_file_73
- service php7-3-fpm restart
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
fi
write_file=0
@@ -83,10 +89,17 @@ else
fi
if [ $write_file -eq 1 ]; then
echo "$pool_conf" > $pool_file_74
- service php7.4-fpm restart
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
fi
if [ -f "/etc/php/7.4/fpm/pool.d/www.conf" ]; then
rm /etc/php/7.4/fpm/pool.d/www.conf
fi
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.stpl
index df607247..fbc1d9c6 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.stpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.stpl
@@ -17,7 +17,7 @@
AllowOverride All
SSLRequireSSL
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
SSLEngine on
SSLVerifyClient none
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.tpl
index 7b6e2cb5..aaf8f62c 100644
--- a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.tpl
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-74.tpl
@@ -16,7 +16,7 @@
AllowOverride All
- Options +Includes -Indexes +ExecCGI
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
#
# RMode config
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.sh
new file mode 100644
index 00000000..a4842ac9
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.0-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_80" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_80)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+if [ -f "/etc/php/8.0/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.0/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.stpl
new file mode 100644
index 00000000..b1335a44
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.stpl
@@ -0,0 +1,44 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %sdocroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+#
+# RMode config
+# RUidGid %user% %group%
+# RGroups www-data
+#
+#
+# AssignUserID %user% %group%
+#
+
+
+ SetHandler "proxy:unix:/run/php/php8.0-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.tpl
new file mode 100644
index 00000000..1b0a610c
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80-public.tpl
@@ -0,0 +1,38 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %docroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+#
+# RMode config
+# RUidGid %user% %group%
+# RGroups www-data
+#
+#
+# AssignUserID %user% %group%
+#
+
+
+ SetHandler "proxy:unix:/run/php/php8.0-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.sh
new file mode 100644
index 00000000..a4842ac9
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.0-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_80" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_80)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+if [ -f "/etc/php/8.0/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.0/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.stpl
new file mode 100644
index 00000000..fae336fc
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.stpl
@@ -0,0 +1,44 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+#
+# RMode config
+# RUidGid %user% %group%
+# RGroups www-data
+#
+#
+# AssignUserID %user% %group%
+#
+
+
+ SetHandler "proxy:unix:/run/php/php8.0-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.tpl
new file mode 100644
index 00000000..64699c22
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-80.tpl
@@ -0,0 +1,38 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+#
+# RMode config
+# RUidGid %user% %group%
+# RGroups www-data
+#
+#
+# AssignUserID %user% %group%
+#
+
+
+ SetHandler "proxy:unix:/run/php/php8.0-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.sh
new file mode 100644
index 00000000..4b4f9d78
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.sh
@@ -0,0 +1,112 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.1-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_81" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_81)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+if [ -f "/etc/php/8.1/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.1/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.stpl
new file mode 100644
index 00000000..4116fd42
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.stpl
@@ -0,0 +1,44 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %sdocroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+#
+# RMode config
+# RUidGid %user% %group%
+# RGroups www-data
+#
+#
+# AssignUserID %user% %group%
+#
+
+
+ SetHandler "proxy:unix:/run/php/php8.1-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.tpl
new file mode 100644
index 00000000..ee319a20
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81-public.tpl
@@ -0,0 +1,38 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %docroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+#
+# RMode config
+# RUidGid %user% %group%
+# RGroups www-data
+#
+#
+# AssignUserID %user% %group%
+#
+
+
+ SetHandler "proxy:unix:/run/php/php8.1-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.sh
new file mode 100644
index 00000000..4b4f9d78
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.sh
@@ -0,0 +1,112 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.1-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_81" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_81)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+if [ -f "/etc/php/8.1/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.1/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.stpl
new file mode 100644
index 00000000..5822a27a
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.stpl
@@ -0,0 +1,44 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+#
+# RMode config
+# RUidGid %user% %group%
+# RGroups www-data
+#
+#
+# AssignUserID %user% %group%
+#
+
+
+ SetHandler "proxy:unix:/run/php/php8.1-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.tpl
new file mode 100644
index 00000000..7864b3a4
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-81.tpl
@@ -0,0 +1,38 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+#
+# RMode config
+# RUidGid %user% %group%
+# RGroups www-data
+#
+#
+# AssignUserID %user% %group%
+#
+
+
+ SetHandler "proxy:unix:/run/php/php8.1-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.sh
new file mode 100644
index 00000000..a4deb752
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.sh
@@ -0,0 +1,119 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.2-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+pool_file_82="/etc/php/8.2/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+if [ -f "$pool_file_81" ]; then
+ rm $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_82" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_82)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_82
+ systemctl reset-failed php8.2-fpm
+ systemctl restart php8.2-fpm
+fi
+if [ -f "/etc/php/8.2/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.2/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.stpl
new file mode 100644
index 00000000..809e7f33
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.stpl
@@ -0,0 +1,36 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %sdocroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+
+
+ SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.tpl
new file mode 100644
index 00000000..679d1409
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82-public.tpl
@@ -0,0 +1,30 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %docroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+
+
+ SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.sh
new file mode 100644
index 00000000..a4deb752
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.sh
@@ -0,0 +1,119 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.2-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+pool_file_82="/etc/php/8.2/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+if [ -f "$pool_file_81" ]; then
+ rm $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_82" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_82)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_82
+ systemctl reset-failed php8.2-fpm
+ systemctl restart php8.2-fpm
+fi
+if [ -f "/etc/php/8.2/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.2/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.stpl
new file mode 100644
index 00000000..e0d04794
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.stpl
@@ -0,0 +1,36 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+
+
+ SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.tpl
new file mode 100644
index 00000000..eba95935
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-82.tpl
@@ -0,0 +1,30 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+
+
+ SetHandler "proxy:unix:/run/php/php8.2-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.sh
new file mode 100644
index 00000000..f5e7c6fd
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.sh
@@ -0,0 +1,126 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.3-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+pool_file_82="/etc/php/8.2/fpm/pool.d/$2.conf"
+pool_file_83="/etc/php/8.3/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+if [ -f "$pool_file_81" ]; then
+ rm $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+
+if [ -f "$pool_file_82" ]; then
+ rm $pool_file_82
+ systemctl reset-failed php8.2-fpm
+ systemctl restart php8.2-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_83" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_83)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_83
+ systemctl reset-failed php8.3-fpm
+ systemctl restart php8.3-fpm
+fi
+if [ -f "/etc/php/8.3/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.3/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.stpl
new file mode 100644
index 00000000..cceed0ee
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.stpl
@@ -0,0 +1,36 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %sdocroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+
+
+ SetHandler "proxy:unix:/run/php/php8.3-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.tpl
new file mode 100644
index 00000000..ac952817
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83-public.tpl
@@ -0,0 +1,30 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %docroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+
+
+ SetHandler "proxy:unix:/run/php/php8.3-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.sh
new file mode 100644
index 00000000..f5e7c6fd
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.sh
@@ -0,0 +1,126 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.3-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+pool_file_82="/etc/php/8.2/fpm/pool.d/$2.conf"
+pool_file_83="/etc/php/8.3/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+if [ -f "$pool_file_81" ]; then
+ rm $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+
+if [ -f "$pool_file_82" ]; then
+ rm $pool_file_82
+ systemctl reset-failed php8.2-fpm
+ systemctl restart php8.2-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_83" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_83)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_83
+ systemctl reset-failed php8.3-fpm
+ systemctl restart php8.3-fpm
+fi
+if [ -f "/etc/php/8.3/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.3/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.stpl
new file mode 100644
index 00000000..f043bfa8
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.stpl
@@ -0,0 +1,36 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+
+
+ SetHandler "proxy:unix:/run/php/php8.3-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.tpl
new file mode 100644
index 00000000..9b5bf916
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-83.tpl
@@ -0,0 +1,30 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+
+
+ SetHandler "proxy:unix:/run/php/php8.3-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.sh
new file mode 100644
index 00000000..cbea2de9
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.sh
@@ -0,0 +1,133 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.4-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+pool_file_82="/etc/php/8.2/fpm/pool.d/$2.conf"
+pool_file_83="/etc/php/8.3/fpm/pool.d/$2.conf"
+pool_file_84="/etc/php/8.4/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+if [ -f "$pool_file_81" ]; then
+ rm $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+
+if [ -f "$pool_file_82" ]; then
+ rm $pool_file_82
+ systemctl reset-failed php8.2-fpm
+ systemctl restart php8.2-fpm
+fi
+
+if [ -f "$pool_file_83" ]; then
+ rm $pool_file_83
+ systemctl reset-failed php8.3-fpm
+ systemctl restart php8.3-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_84" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_84)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_84
+ systemctl reset-failed php8.4-fpm
+ systemctl restart php8.4-fpm
+fi
+if [ -f "/etc/php/8.4/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.4/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.stpl
new file mode 100644
index 00000000..91e05b17
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.stpl
@@ -0,0 +1,36 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %sdocroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+
+
+ SetHandler "proxy:unix:/run/php/php8.4-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.tpl
new file mode 100644
index 00000000..94acbf15
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84-public.tpl
@@ -0,0 +1,30 @@
+
+
+ ServerName %domain_idn%
+ %alias_string%
+ ServerAdmin %email%
+ DocumentRoot %docroot%/public
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+
+
+ SetHandler "proxy:unix:/run/php/php8.4-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.sh b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.sh
new file mode 100644
index 00000000..cbea2de9
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.sh
@@ -0,0 +1,133 @@
+#!/bin/bash
+# Adding php pool conf
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+pool_conf="[$2]
+
+listen = /run/php/php8.4-fpm-$2.sock
+listen.owner = $1
+listen.group = $1
+listen.mode = 0666
+
+user = $1
+group = $1
+
+pm = ondemand
+pm.max_children = 8
+request_terminate_timeout = 360s
+pm.max_requests = 4000
+pm.process_idle_timeout = 10s
+pm.status_path = /status
+
+php_admin_value[upload_tmp_dir] = /home/$1/tmp
+php_admin_value[session.save_path] = /home/$1/tmp
+php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcube:/var/log/roundcube:/var/lib/roundcube
+php_admin_value[upload_max_filesize] = 800M
+php_admin_value[max_execution_time] = 300
+php_admin_value[post_max_size] = 800M
+php_admin_value[memory_limit] = 512M
+php_admin_value[sendmail_path] = \"/usr/sbin/sendmail -t -i -f info@$2\"
+php_admin_flag[mysql.allow_persistent] = off
+php_admin_flag[safe_mode] = off
+
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /home/$1/tmp
+env[TMPDIR] = /home/$1/tmp
+env[TEMP] = /home/$1/tmp
+"
+
+pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
+pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
+pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
+pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
+pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
+pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
+pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
+pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
+pool_file_82="/etc/php/8.2/fpm/pool.d/$2.conf"
+pool_file_83="/etc/php/8.3/fpm/pool.d/$2.conf"
+pool_file_84="/etc/php/8.4/fpm/pool.d/$2.conf"
+
+if [ -f "$pool_file_56" ]; then
+ rm $pool_file_56
+ systemctl reset-failed php5.6-fpm
+ systemctl restart php5.6-fpm
+fi
+
+if [ -f "$pool_file_70" ]; then
+ rm $pool_file_70
+ systemctl reset-failed php7.0-fpm
+ systemctl restart php7.0-fpm
+fi
+
+if [ -f "$pool_file_71" ]; then
+ rm $pool_file_71
+ systemctl reset-failed php7.1-fpm
+ systemctl restart php7.1-fpm
+fi
+
+if [ -f "$pool_file_72" ]; then
+ rm $pool_file_72
+ systemctl reset-failed php7.2-fpm
+ systemctl restart php7.2-fpm
+fi
+
+if [ -f "$pool_file_73" ]; then
+ rm $pool_file_73
+ systemctl reset-failed php7.3-fpm
+ systemctl restart php7.3-fpm
+fi
+
+if [ -f "$pool_file_74" ]; then
+ rm $pool_file_74
+ systemctl reset-failed php7.4-fpm
+ systemctl restart php7.4-fpm
+fi
+
+if [ -f "$pool_file_80" ]; then
+ rm $pool_file_80
+ systemctl reset-failed php8.0-fpm
+ systemctl restart php8.0-fpm
+fi
+
+if [ -f "$pool_file_81" ]; then
+ rm $pool_file_81
+ systemctl reset-failed php8.1-fpm
+ systemctl restart php8.1-fpm
+fi
+
+if [ -f "$pool_file_82" ]; then
+ rm $pool_file_82
+ systemctl reset-failed php8.2-fpm
+ systemctl restart php8.2-fpm
+fi
+
+if [ -f "$pool_file_83" ]; then
+ rm $pool_file_83
+ systemctl reset-failed php8.3-fpm
+ systemctl restart php8.3-fpm
+fi
+
+write_file=0
+if [ ! -f "$pool_file_84" ]; then
+ write_file=1
+else
+ user_count=$(grep -c "/home/$1/" $pool_file_84)
+ if [ $user_count -eq 0 ]; then
+ write_file=1
+ fi
+fi
+if [ $write_file -eq 1 ]; then
+ echo "$pool_conf" > $pool_file_84
+ systemctl reset-failed php8.4-fpm
+ systemctl restart php8.4-fpm
+fi
+if [ -f "/etc/php/8.4/fpm/pool.d/www.conf" ]; then
+ rm /etc/php/8.4/fpm/pool.d/www.conf
+fi
+
+exit 0
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.stpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.stpl
new file mode 100644
index 00000000..848abf7c
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.stpl
@@ -0,0 +1,36 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ SSLRequireSSL
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+ SSLEngine on
+ SSLVerifyClient none
+ SSLCertificateFile %ssl_crt%
+ SSLCertificateKeyFile %ssl_key%
+ %ssl_ca_str%SSLCertificateChainFile %ssl_ca%
+
+
+ SetHandler "proxy:unix:/run/php/php8.4-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/s%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.tpl b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.tpl
new file mode 100644
index 00000000..065c1f89
--- /dev/null
+++ b/src/deb/for-download/tools/apache-fpm-tpl/PHP-FPM-84.tpl
@@ -0,0 +1,30 @@
+
+
+ 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
+
+ AllowOverride All
+
+
+ AllowOverride All
+ Options +Includes -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
+
+
+
+ SetHandler "proxy:unix:/run/php/php8.4-fpm-%domain%.sock|fcgi://localhost/"
+
+ SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
+
+ IncludeOptional %home%/%user%/conf/web/%web_system%.%domain%.conf*
+
+
+
diff --git a/src/deb/for-download/tools/convert-vesta-to-myvesta.sh b/src/deb/for-download/tools/convert-vesta-to-myvesta.sh
index 0154297f..0455d1da 100644
--- a/src/deb/for-download/tools/convert-vesta-to-myvesta.sh
+++ b/src/deb/for-download/tools/convert-vesta-to-myvesta.sh
@@ -1,6 +1,8 @@
#!/bin/bash
# *** Debian only ***
+# This script is NOT recommended, because a lot of myVesta features will not be added to server this way.
+# Better way is described here - https://forum.myvestacp.com/viewtopic.php?f=14&t=50
wget -O - http://apt.myvestacp.com/deb_signing.key | sudo apt-key add -
codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
diff --git a/src/deb/for-download/tools/create_wp_http b/src/deb/for-download/tools/create_wp_http
deleted file mode 100644
index a3d69cf4..00000000
--- a/src/deb/for-download/tools/create_wp_http
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/bash
-
-if [ $# -lt 1 ]; then
- echo usage: create_wp_http domain [db_name] [email]
- exit 1
-fi
-
-domain=$1
-
-PATH=$PATH:/usr/local/vesta/bin
-export PATH
-
-user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
-
-START_DB="wp";
-if [ $# -gt 1 ]; then
- START_DB=$2
-fi
-
-email="info@$domain";
-if [ $# -gt 2 ]; then
- email=$3
-fi
-
-if [ ! -d "/home/$user" ]; then
- echo "User doesn't exist";
- exit 1;
-fi
-
-if [ ! -d "/home/$user/web/$domain/public_html" ]; then
- echo "Domain doesn't exist";
- exit 1;
-fi
-
-WORKINGDIR="/home/$user/web/$domain/public_html"
-# FILE=latest.tar.gz
-
-rm -rf $WORKINGDIR/*
-
-#DBUSERSUF=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 5 | head -n 1)
-DBUSERSUF="$START_DB";
-DBUSERSUFB="$START_DB";
-DBUSER=$user\_$DBUSERSUFB;
-DB_OK=0;
-if [ ! -d "/var/lib/mysql/$DBUSER" ]; then
- DB_OK=1;
-fi
-
-if [ "$DB_OK" -eq "0" ]; then
-i=1;
-while [ $i -lt 99 ]
-do
-i=$((i+1));
-DBUSERSUF="${DBUSERSUFB}${i}";
-DBUSER=$user\_$DBUSERSUF;
-if [ ! -d "/var/lib/mysql/$DBUSER" ]; then
-break;
-fi
-done
-fi
-
-PASSWDDB=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
-
-v-add-database $user $DBUSERSUF $DBUSERSUF $PASSWDDB mysql
-
-cd /home/$user
-
-rm -rf /home/$user/wp
-curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
-chmod +x wp-cli.phar
-sudo mv wp-cli.phar wp
-
-cd /home/$user/web/$domain/public_html
-
-sudo -H -u$user /home/$user/wp core download
-sudo -H -u$user /home/$user/wp core config --dbname=$DBUSER --dbuser=$DBUSER --dbpass=$PASSWDDB
-
-password=$(LC_CTYPE=C tr -dc A-Za-z0-9_\!\@\#\$\%\^\&\*\(\)-+= < /dev/urandom | head -c 12)
-
-sudo -H -u$user /home/$user/wp core install --url="$domain" --title="$domain" --admin_user="admin" --admin_password="$password" --admin_email="$email" --path=$WORKINGDIR
-
-#FIX za https://github.com/wp-cli/wp-cli/issues/2632
-
-mysql -u$DBUSER -p$PASSWDDB -e "USE $DBUSER; update wp_options set option_value = 'http://$domain' where option_name = 'siteurl'; update wp_options set option_value = 'http://$domain' where option_name = 'home';"
-
-# clear
-
-echo "================================================================="
-echo "Installation is complete. Your username/password is listed below."
-echo ""
-echo "Site: http://$domain/"
-echo ""
-echo "Login: http://$domain/wp-admin/"
-echo "Username: admin"
-echo "Password: $password"
-echo ""
-echo "================================================================="
-
-chown -R $user:$user $WORKINGDIR
-
-rm -rf /home/$user/wp
-
-echo "create_wp: Done."
-exit 0
\ No newline at end of file
diff --git a/src/deb/for-download/tools/create_wp_https b/src/deb/for-download/tools/create_wp_https
deleted file mode 100644
index edfb58c5..00000000
--- a/src/deb/for-download/tools/create_wp_https
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/bin/bash
-
-# WordPress installer in one command line
-# Credits to Luka Paunović for wp-cli implememtation
-
-if [ $# -lt 1 ]; then
- echo usage: create_wp_https domain [db_name] [email]
- exit 1
-fi
-
-domain=$1
-
-PATH=$PATH:/usr/local/vesta/bin
-export PATH
-
-user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
-
-START_DB="wp";
-if [ $# -gt 1 ]; then
- START_DB=$2
-fi
-
-email="info@$domain";
-if [ $# -gt 2 ]; then
- email=$3
-fi
-
-if [ ! -d "/home/$user" ]; then
- echo "User doesn't exist";
- exit 1;
-fi
-
-if [ ! -d "/home/$user/web/$domain/public_html" ]; then
- echo "Domain doesn't exist";
- exit 1;
-fi
-
-if [ ! -f "/home/$user/conf/web/ssl.$domain.pem" ]; then
- v-add-letsencrypt-domain "$user" "$domain" "www.$domain" "yes"
-fi
-if [ -f "/home/$user/conf/web/ssl.$domain.pem" ]; then
- if [ -f "/usr/local/vesta/data/templates/web/nginx/force-https.stpl" ]; then
- v-change-web-domain-proxy-tpl "$user" "$domain" "force-https" "jpeg,jpg,png,gif,bmp,ico,svg,tif,tiff,css,js,ttf,otf,webp,txt,csv,rtf,doc,docx,xls,xlsx,ppt,pptx,odf,odp,ods,odt,pdf,psd,ai,eot,eps,ps,zip,tar,tgz,gz,rar,bz2,7z,aac,m4a,mp3,mp4,ogg,wav,wma,3gp,avi,flv,m4v,mkv,mov,mpeg,mpg,wmv,exe,iso,dmg,swf,woff,woff2" "yes"
- fi
-else
- echo "Error: Can not generate SSL."
- exit 20
-fi
-
-WORKINGDIR="/home/$user/web/$domain/public_html"
-# FILE=latest.tar.gz
-
-rm -rf $WORKINGDIR/*
-
-#DBUSERSUF=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 5 | head -n 1)
-DBUSERSUF="$START_DB";
-DBUSERSUFB="$START_DB";
-DBUSER=$user\_$DBUSERSUFB;
-DB_OK=0;
-if [ ! -d "/var/lib/mysql/$DBUSER" ]; then
- DB_OK=1;
-fi
-
-if [ "$DB_OK" -eq "0" ]; then
-i=1;
-while [ $i -lt 99 ]
-do
-i=$((i+1));
-DBUSERSUF="${DBUSERSUFB}${i}";
-DBUSER=$user\_$DBUSERSUF;
-if [ ! -d "/var/lib/mysql/$DBUSER" ]; then
-break;
-fi
-done
-fi
-
-PASSWDDB=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
-
-v-add-database $user $DBUSERSUF $DBUSERSUF $PASSWDDB mysql
-
-cd /home/$user
-
-rm -rf /home/$user/wp
-curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
-chmod +x wp-cli.phar
-sudo mv wp-cli.phar wp
-
-cd /home/$user/web/$domain/public_html
-
-sudo -H -u$user /home/$user/wp core download
-sudo -H -u$user /home/$user/wp core config --dbname=$DBUSER --dbuser=$DBUSER --dbpass=$PASSWDDB
-
-password=$(LC_CTYPE=C tr -dc A-Za-z0-9_\!\@\#\$\%\^\&\*\(\)-+= < /dev/urandom | head -c 12)
-
-sudo -H -u$user /home/$user/wp core install --url="$domain" --title="$domain" --admin_user="admin" --admin_password="$password" --admin_email="$email" --path=$WORKINGDIR
-
-#FIX za https://github.com/wp-cli/wp-cli/issues/2632
-
-mysql -u$DBUSER -p$PASSWDDB -e "USE $DBUSER; update wp_options set option_value = 'https://$domain' where option_name = 'siteurl'; update wp_options set option_value = 'https://$domain' where option_name = 'home';"
-
-# clear
-
-echo "================================================================="
-echo "Installation is complete. Your username/password is listed below."
-echo ""
-echo "Site: https://$domain/"
-echo ""
-echo "Login: https://$domain/wp-admin/"
-echo "Username: admin"
-echo "Password: $password"
-echo ""
-echo "================================================================="
-
-chown -R $user:$user $WORKINGDIR
-
-rm -rf /home/$user/wp
-
-echo "create_wp_https: Done."
-exit 0
diff --git a/src/deb/for-download/tools/default-pool.d/5.6/www.conf b/src/deb/for-download/tools/default-pool.d/5.6/www.conf
new file mode 100644
index 00000000..6bc161d0
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/5.6/www.conf
@@ -0,0 +1,417 @@
+; Start a new pool named 'www'.
+; the variable $pool can we used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all IPv4 addresses on a
+; specific port;
+; '[::]:port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php5.6-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 65535
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is differrent than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/5.6/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{miliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some exemples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; exectute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/7.0/www.conf b/src/deb/for-download/tools/default-pool.d/7.0/www.conf
new file mode 100644
index 00000000..5eafe960
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/7.0/www.conf
@@ -0,0 +1,420 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php7.0-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is differrent than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/7.0/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{miliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some exemples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/7.1/www.conf b/src/deb/for-download/tools/default-pool.d/7.1/www.conf
new file mode 100644
index 00000000..fc09b4c0
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/7.1/www.conf
@@ -0,0 +1,420 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php7.1-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is differrent than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/7.1/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{miliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some exemples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/7.2/www.conf b/src/deb/for-download/tools/default-pool.d/7.2/www.conf
new file mode 100644
index 00000000..86aca4cc
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/7.2/www.conf
@@ -0,0 +1,424 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php7.2-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is differrent than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/7.2/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{miliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some exemples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; Depth of slow log stack trace.
+; Default Value: 20
+;request_slowlog_trace_depth = 20
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/7.3/www.conf b/src/deb/for-download/tools/default-pool.d/7.3/www.conf
new file mode 100644
index 00000000..03ce7b03
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/7.3/www.conf
@@ -0,0 +1,439 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php7.3-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is differrent than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/7.3/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{miliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some exemples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; Depth of slow log stack trace.
+; Default Value: 20
+;request_slowlog_trace_depth = 20
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; The timeout set by 'request_terminate_timeout' ini option is not engaged after
+; application calls 'fastcgi_finish_request' or when application has finished and
+; shutdown functions are being called (registered via register_shutdown_function).
+; This option will enable timeout limit to be applied unconditionally
+; even in such cases.
+; Default Value: no
+;request_terminate_timeout_track_finished = no
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Decorate worker output with prefix and suffix containing information about
+; the child that writes to the log and if stdout or stderr is used as well as
+; log level and time. This options is used only if catch_workers_output is yes.
+; Settings to "no" will output data as written to the stdout or stderr.
+; Default value: yes
+;decorate_workers_output = no
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/7.4/www.conf b/src/deb/for-download/tools/default-pool.d/7.4/www.conf
new file mode 100644
index 00000000..8ef08a99
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/7.4/www.conf
@@ -0,0 +1,439 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php7.4-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is differrent than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: (min_spare_servers + max_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/7.4/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{miliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some exemples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; Depth of slow log stack trace.
+; Default Value: 20
+;request_slowlog_trace_depth = 20
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; The timeout set by 'request_terminate_timeout' ini option is not engaged after
+; application calls 'fastcgi_finish_request' or when application has finished and
+; shutdown functions are being called (registered via register_shutdown_function).
+; This option will enable timeout limit to be applied unconditionally
+; even in such cases.
+; Default Value: no
+;request_terminate_timeout_track_finished = no
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Decorate worker output with prefix and suffix containing information about
+; the child that writes to the log and if stdout or stderr is used as well as
+; log level and time. This options is used only if catch_workers_output is yes.
+; Settings to "no" will output data as written to the stdout or stderr.
+; Default value: yes
+;decorate_workers_output = no
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/8.0/www.conf b/src/deb/for-download/tools/default-pool.d/8.0/www.conf
new file mode 100644
index 00000000..e21e6158
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/8.0/www.conf
@@ -0,0 +1,455 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php8.0-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is different than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: (min_spare_servers + max_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following information:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/8.0/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The address on which to accept FastCGI status request. This creates a new
+; invisible pool that can handle requests independently. This is useful
+; if the main pool is busy with long running requests because it is still possible
+; to get the status before finishing the long running requests.
+;
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Default Value: value of the listen option
+;pm.status_listen = 127.0.0.1:9001
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{milliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some examples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsuled in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; Depth of slow log stack trace.
+; Default Value: 20
+;request_slowlog_trace_depth = 20
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; The timeout set by 'request_terminate_timeout' ini option is not engaged after
+; application calls 'fastcgi_finish_request' or when application has finished and
+; shutdown functions are being called (registered via register_shutdown_function).
+; This option will enable timeout limit to be applied unconditionally
+; even in such cases.
+; Default Value: no
+;request_terminate_timeout_track_finished = no
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environment, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Decorate worker output with prefix and suffix containing information about
+; the child that writes to the log and if stdout or stderr is used as well as
+; log level and time. This options is used only if catch_workers_output is yes.
+; Settings to "no" will output data as written to the stdout or stderr.
+; Default value: yes
+;decorate_workers_output = no
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/8.1/www.conf b/src/deb/for-download/tools/default-pool.d/8.1/www.conf
new file mode 100644
index 00000000..5278cea0
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/8.1/www.conf
@@ -0,0 +1,463 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php8.1-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
+; or group is different than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; pm.max_spawn_rate - the maximum number of rate to spawn child
+; processes at once.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: (min_spare_servers + max_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of rate to spawn child processes at once.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+; Default Value: 32
+;pm.max_spawn_rate = 32
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following information:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/8.1/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The address on which to accept FastCGI status request. This creates a new
+; invisible pool that can handle requests independently. This is useful
+; if the main pool is busy with long running requests because it is still possible
+; to get the status before finishing the long running requests.
+;
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Default Value: value of the listen option
+;pm.status_listen = 127.0.0.1:9001
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{milliseconds}d
+; - %{milli}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some examples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsulated in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsulated in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; Depth of slow log stack trace.
+; Default Value: 20
+;request_slowlog_trace_depth = 20
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; The timeout set by 'request_terminate_timeout' ini option is not engaged after
+; application calls 'fastcgi_finish_request' or when application has finished and
+; shutdown functions are being called (registered via register_shutdown_function).
+; This option will enable timeout limit to be applied unconditionally
+; even in such cases.
+; Default Value: no
+;request_terminate_timeout_track_finished = no
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environment, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Decorate worker output with prefix and suffix containing information about
+; the child that writes to the log and if stdout or stderr is used as well as
+; log level and time. This options is used only if catch_workers_output is yes.
+; Settings to "no" will output data as written to the stdout or stderr.
+; Default value: yes
+;decorate_workers_output = no
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/8.2/www.conf b/src/deb/for-download/tools/default-pool.d/8.2/www.conf
new file mode 100644
index 00000000..ffdd57b7
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/8.2/www.conf
@@ -0,0 +1,484 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php8.2-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on Linux, FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: user and group are set as the running user
+; mode is set to 0660
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Set the associated the route table (FIB). FreeBSD only
+; Default Value: -1
+;listen.setfib = 1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl for Linux or
+; PROC_TRACE_CTL procctl for FreeBSD) even if the process user
+; or group is different than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; pm.max_spawn_rate - the maximum number of rate to spawn child
+; processes at once.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: (min_spare_servers + max_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of rate to spawn child processes at once.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+; Default Value: 32
+;pm.max_spawn_rate = 32
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following information:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/8.2/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The address on which to accept FastCGI status request. This creates a new
+; invisible pool that can handle requests independently. This is useful
+; if the main pool is busy with long running requests because it is still possible
+; to get the status before finishing the long running requests.
+;
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Default Value: value of the listen option
+;pm.status_listen = 127.0.0.1:9001
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{milliseconds}d
+; - %{milli}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some examples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsulated in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsulated in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
+
+; A list of request_uri values which should be filtered from the access log.
+;
+; As a security precuation, this setting will be ignored if:
+; - the request method is not GET or HEAD; or
+; - there is a request body; or
+; - there are query parameters; or
+; - the response code is outwith the successful range of 200 to 299
+;
+; Note: The paths are matched against the output of the access.format tag "%r".
+; On common configurations, this may look more like SCRIPT_NAME than the
+; expected pre-rewrite URI.
+;
+; Default Value: not set
+;access.suppress_path[] = /ping
+;access.suppress_path[] = /health_check.php
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; Depth of slow log stack trace.
+; Default Value: 20
+;request_slowlog_trace_depth = 20
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; The timeout set by 'request_terminate_timeout' ini option is not engaged after
+; application calls 'fastcgi_finish_request' or when application has finished and
+; shutdown functions are being called (registered via register_shutdown_function).
+; This option will enable timeout limit to be applied unconditionally
+; even in such cases.
+; Default Value: no
+;request_terminate_timeout_track_finished = no
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environment, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Decorate worker output with prefix and suffix containing information about
+; the child that writes to the log and if stdout or stderr is used as well as
+; log level and time. This options is used only if catch_workers_output is yes.
+; Settings to "no" will output data as written to the stdout or stderr.
+; Default value: yes
+;decorate_workers_output = no
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/default-pool.d/8.3/www.conf b/src/deb/for-download/tools/default-pool.d/8.3/www.conf
new file mode 100644
index 00000000..f18939a3
--- /dev/null
+++ b/src/deb/for-download/tools/default-pool.d/8.3/www.conf
@@ -0,0 +1,490 @@
+; Start a new pool named 'www'.
+; the variable $pool can be used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'access.log'
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of the child processes. This can be used only if the master
+; process running user is root. It is set after the child process is created.
+; The user and group can be specified either by their name or by their numeric
+; IDs.
+; Note: If the user is root, the executable needs to be started with
+; --allow-to-run-as-root option to work.
+; Default Values: The user is set to master process running user by default.
+; If the group is not set, the user's group is used.
+user = www-data
+group = www-data
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /run/php/php8.3-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 511 (-1 on Linux, FreeBSD and OpenBSD)
+;listen.backlog = 511
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. The owner
+; and group can be specified either by name or by their numeric IDs.
+; Default Values: Owner is set to the master process running user. If the group
+; is not set, the owner's group is used. Mode is set to 0660.
+listen.owner = www-data
+listen.group = www-data
+;listen.mode = 0660
+
+; When POSIX Access Control Lists are supported you can set them using
+; these options, value is a comma separated list of user/group names.
+; When set, listen.owner and listen.group are ignored
+;listen.acl_users =
+;listen.acl_groups =
+
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Set the associated the route table (FIB). FreeBSD only
+; Default Value: -1
+;listen.setfib = 1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Set the process dumpable flag (PR_SET_DUMPABLE prctl for Linux or
+; PROC_TRACE_CTL procctl for FreeBSD) even if the process user
+; or group is different than the master process user. It allows to create process
+; core dump and ptrace the process for the pool user.
+; Default Value: no
+; process.dumpable = yes
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; pm.max_spawn_rate - the maximum number of rate to spawn child
+; processes at once.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: (min_spare_servers + max_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of rate to spawn child processes at once.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+; Default Value: 32
+;pm.max_spawn_rate = 32
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following information:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: /usr/share/php/8.3/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The address on which to accept FastCGI status request. This creates a new
+; invisible pool that can handle requests independently. This is useful
+; if the main pool is busy with long running requests because it is still possible
+; to get the status before finishing the long running requests.
+;
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
+; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses
+; (IPv6 and IPv4-mapped) on a specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Default Value: value of the listen option
+;pm.status_listen = 127.0.0.1:9001
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{milliseconds}d
+; - %{milli}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some examples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: output header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsulated in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; The strftime(3) format must be encapsulated in a %{}t tag
+; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
+
+; A list of request_uri values which should be filtered from the access log.
+;
+; As a security precuation, this setting will be ignored if:
+; - the request method is not GET or HEAD; or
+; - there is a request body; or
+; - there are query parameters; or
+; - the response code is outwith the successful range of 200 to 299
+;
+; Note: The paths are matched against the output of the access.format tag "%r".
+; On common configurations, this may look more like SCRIPT_NAME than the
+; expected pre-rewrite URI.
+;
+; Default Value: not set
+;access.suppress_path[] = /ping
+;access.suppress_path[] = /health_check.php
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; Depth of slow log stack trace.
+; Default Value: 20
+;request_slowlog_trace_depth = 20
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; The timeout set by 'request_terminate_timeout' ini option is not engaged after
+; application calls 'fastcgi_finish_request' or when application has finished and
+; shutdown functions are being called (registered via register_shutdown_function).
+; This option will enable timeout limit to be applied unconditionally
+; even in such cases.
+; Default Value: no
+;request_terminate_timeout_track_finished = no
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+;chdir = /var/www
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environment, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Decorate worker output with prefix and suffix containing information about
+; the child that writes to the log and if stdout or stderr is used as well as
+; log level and time. This options is used only if catch_workers_output is yes.
+; Settings to "no" will output data as written to the stdout or stderr.
+; Default value: yes
+;decorate_workers_output = no
+
+; Clear environment in FPM workers
+; Prevents arbitrary environment variables from reaching FPM worker processes
+; by clearing the environment in workers before env vars specified in this
+; pool configuration are added.
+; Setting to "no" will make all environment variables available to PHP code
+; via getenv(), $_ENV and $_SERVER.
+; Default Value: yes
+;clear_env = no
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; execute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5 .php7
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/src/deb/for-download/tools/imapsync/create-mail-sync.sh b/src/deb/for-download/tools/imapsync/create-mail-sync.sh
new file mode 100644
index 00000000..94762505
--- /dev/null
+++ b/src/deb/for-download/tools/imapsync/create-mail-sync.sh
@@ -0,0 +1,103 @@
+#!/bin/bash
+
+##################################
+# usage: ./create-mail-sync.sh SRCHOST EMAIL PASSWORD-ON-REMOTE-SERVER [PASSWORD-ON-THIS-SERVER] [TEST]
+##################################
+
+if [ $# -lt 3 ]; then
+ echo "usage: ./create-mail-sync.sh SRCHOST EMAIL PASSWORD-ON-REMOTE-SERVER [PASSWORD-ON-THIS-SERVER] [TEST]"
+ exit 1
+fi
+
+if [ $# -eq 3 ]; then
+SRCHOST=$1
+EMAIL=$2
+PASS=$3
+PASS2=$3
+TEST=1
+fi
+
+if [ $# -eq 4 ]; then
+SRCHOST=$1
+EMAIL=$2
+PASS=$3
+PASS2=$4
+TEST=1
+fi
+
+if [ $# -eq 5 ]; then
+SRCHOST=$1
+EMAIL=$2
+PASS=$3
+PASS2=$4
+TEST=$5
+fi
+
+TESTOPT=""
+if [[ $TEST -eq 1 ]]; then
+ TESTOPT="--justlogin"
+fi
+
+if [ ! -d "accounts" ]; then
+ mkdir accounts
+fi
+if [ -f "accounts/$EMAIL" ]; then
+ echo "********* EMAIL $EMAIL ALREADY EXISTS !!! ************"
+ exit 1;
+ exit
+fi
+
+euser=$(echo $EMAIL | cut -d '@' -f 1)
+domain=$(echo $EMAIL | cut -d '@' -f 2)
+user=$(/usr/local/vesta/bin/v-search-domain-owner $domain)
+if [ "$user" != "" ]; then
+ echo "=== Email '$EMAIL' has username email part '$euser', domain is '$domain', and belongs to myVesta account: $user"
+ if [ ! -d "/home/$user/mail/$domain" ]; then
+ echo "======= Creating '$domail' in MAIL section"
+ /usr/local/vesta/bin/v-add-mail-domain "$user" "$domain"
+ fi
+ if [ ! -d "/home/$user/mail/$domain/$euser" ]; then
+ echo "======= Creating '$euser' mail account for domain '$domain'"
+ /usr/local/vesta/bin/v-add-mail-account "$user" "$domain" "$euser" "$PASS2"
+ echo ""
+ fi
+fi
+
+
+echo "Writing to: accounts/$EMAIL"
+echo "#!/bin/bash
+
+# ---
+# SRCHOST = $SRCHOST
+# email = $EMAIL
+# pass = $PASS
+# pass2 = $PASS2
+# test = $TEST
+# ---
+
+/root/imapsync/imapsync --host1 $SRCHOST --user1 $EMAIL --password1 '$PASS' --ssl1 --host2 localhost --user2 $EMAIL --password2 '$PASS2' $TESTOPT --addheader --automap \"\$@\"
+
+exit;
+# ---
+" > accounts/$EMAIL
+
+chmod a=rwx accounts/$EMAIL
+
+if [[ $TEST -eq 0 ]]; then
+ exit 0;
+fi
+
+accounts/$EMAIL
+RET=$?
+
+if [ $RET -eq 0 ]; then
+ # echo "./create-mail-sync.sh $EMAIL $PASS $PASS2 $TEST"
+ sed -i "s/--justlogin//g" accounts/$EMAIL
+ echo "--- OK! ---"
+ echo "./create-mail-sync.sh '$SRCHOST' '$EMAIL' '$PASS' '$PASS2' $TEST" >> accounts.log
+else
+ echo "********* $EMAIL ERROR !!! [ret: $RET ] ************"
+ rm accounts/$EMAIL
+ read -p "=== Press ENTER to continue ===" entered
+fi
+exit $RET;
diff --git a/src/deb/for-download/tools/imapsync/import-from-file.sh b/src/deb/for-download/tools/imapsync/import-from-file.sh
new file mode 100644
index 00000000..ac0c42f4
--- /dev/null
+++ b/src/deb/for-download/tools/imapsync/import-from-file.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+#
+# This script reads email and password=s in following format:
+# email1 pass
+# email2 pass
+# email3 pass
+
+# The first parameter is the text file from which we read emails and passwords
+# The second parameter is SMTP Hostname
+# The third parameter is domain if lines contains only username part
+
+
+host=''
+if [ $# -gt 1 ]; then
+ host=$2
+else
+ echo "Usage: ./import-from-file.sh 'FILE' 'SMTPHOST' ['DOMAIN']"
+ exit 1;
+fi
+
+domain=''
+if [ $# -gt 2 ]; then
+ domain=$3
+fi
+
+end_of_file=0
+while [[ $end_of_file == 0 ]]; do
+
+ read -r line
+ end_of_file=$?
+
+ if [ "$line" == "" ]; then
+ if [[ $end_of_file == 1 ]]; then
+ echo "===EOF==="
+ break;
+ fi
+ continue
+ fi
+
+ email=$(echo "$line" | awk '{print $1}')
+ pass=$(echo "$line" | awk '{print $2}')
+
+ if [[ $email != *"@"* ]]; then
+ email="$email@$domain"
+ fi
+
+ echo "Extracted: '$email' = '$pass'"
+
+ ./create-mail-sync.sh "$host" "$email" "$pass"
+
+ if [[ $end_of_file == 1 ]]; then
+ echo "===EOF==="
+ break;
+ fi
+
+done < $1
diff --git a/src/deb/for-download/tools/imapsync/run-all.sh b/src/deb/for-download/tools/imapsync/run-all.sh
new file mode 100644
index 00000000..fa535927
--- /dev/null
+++ b/src/deb/for-download/tools/imapsync/run-all.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+cd accounts
+
+for name in *
+do
+ if [ -f "$name" ]; then
+ ./$name
+ fi
+done
diff --git a/src/deb/for-download/tools/install-new-roundcube.sh b/src/deb/for-download/tools/install-new-roundcube.sh
new file mode 100644
index 00000000..0f6a343a
--- /dev/null
+++ b/src/deb/for-download/tools/install-new-roundcube.sh
@@ -0,0 +1,225 @@
+#!/bin/bash
+
+USER='webmail'
+DOMAIN='' # enter domain or subdomain
+
+VERSION='1.6.6'
+DOWNLOAD="https://github.com/roundcube/roundcubemail/releases/download/$VERSION/roundcubemail-$VERSION-complete.tar.gz"
+
+LOGINMESSAGE1='Click here for NEW Webmail'
+LOGINMESSAGE2='(it is adapted for mobile phones too)'
+
+DATABASE_NAME_WITHOUT_PREFIX="roundcube"
+
+#############################################################################################################################
+
+if [ $# -gt 0 ]; then
+ USER=$1
+fi
+if [ $# -gt 1 ]; then
+ DOMAIN=$2
+fi
+
+DATABASE_NAME="${USER}_${DATABASE_NAME_WITHOUT_PREFIX}"
+
+if [ -z "$USER" ] || [ -z "$DOMAIN" ]; then
+ echo "Usage:"
+ echo "bash install-new-roundcube.sh VESTAUSER YOURDOMAIN.com"
+ exit 1
+fi
+
+source /usr/local/vesta/func/main.sh
+source /usr/local/vesta/func/db.sh
+
+# Defining password-gen function
+gen_pass() {
+ MATRIX='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
+ LENGTH=32
+ while [ ${n:=1} -le $LENGTH ]; do
+ PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}"
+ let n+=1
+ done
+ echo "$PASS"
+}
+DATABASE_PASSWORD=$(gen_pass)
+
+fix_ownership() {
+ chown -R $USER:$USER /home/$USER/web/$DOMAIN/public_html/
+ find /home/$USER/web/$DOMAIN/public_html/ -type d -exec chmod 755 {} +
+ find /home/$USER/web/$DOMAIN/public_html/ -type f -exec chmod 644 {} +
+}
+
+
+if [ ! -d "/home/$USER" ]; then
+ echo "== Creating user: $USER"
+ USER_PASSWORD=$(gen_pass)
+ /usr/local/vesta/bin/v-add-user "$USER" "$USER_PASSWORD" "admin@$DOMAIN" 'default' 'Webmail' 'Roundcube'
+ /usr/local/vesta/bin/v-change-user-language "$USER" 'en'
+fi
+
+if [ ! -d "/home/$USER/web/$DOMAIN" ]; then
+ echo "== Adding domain: $DOMAIN"
+ /usr/local/vesta/bin/v-add-domain "$USER" "$DOMAIN" "" "yes"
+ if [ ! -d "/home/$USER/web/$DOMAIN" ]; then
+ echo "ERROR: Can't create domain $DOMAIN, maybe it's already created under the other user?"
+ exit 1
+ fi
+ if [ -f "/usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl" ]; then
+ /usr/local/vesta/bin/v-change-web-domain-tpl "$USER" "$DOMAIN" 'PHP-FPM-74' 'yes'
+ fi
+fi
+
+pub_ip=$(curl -4 -s https://scripts.myvestacp.com/ip.php)
+domain_host_ip=$(host $DOMAIN | head -n 1 | awk '{print $NF}')
+if [ "$pub_ip" != "$domain_host_ip" ]; then
+ echo "ERROR:"
+ echo "$DOMAIN is not pointing to $pub_ip"
+ echo "I see it is pointing to $domain_host_ip"
+ read -p "Are you sure you want to continue? (y/n)" answer
+ if [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
+ echo "Okay, we will continue."
+ else
+ echo "OK, good bye!"
+ exit 1
+ fi
+fi
+
+number_of_files=$(ls /home/$USER/web/$DOMAIN/public_html | wc -l)
+if [ $number_of_files -ne 0 ]; then
+ if [ $number_of_files -eq 2 ] && [ -f "/home/$USER/web/$DOMAIN/public_html/index.html" ] && [ -f "/home/$USER/web/$DOMAIN/public_html/robots.txt" ]; then
+ rm /home/$USER/web/$DOMAIN/public_html/index.html
+ rm /home/$USER/web/$DOMAIN/public_html/robots.txt
+ else
+ echo "== public_html folder is not empty, aborting."
+ exit 1
+ fi
+fi
+
+if [ ! -f "/home/$USER/conf/web/ssl.$DOMAIN.ca" ]; then
+ www_host="www.$DOMAIN"
+ www_host_ip=$(host $www_host | head -n 1 | awk '{print $NF}')
+ if [ "$www_host_ip" != "$domain_host_ip" ]; then
+ echo "=== Deleting www"
+ /usr/local/vesta/bin/v-delete-web-domain-alias "$USER" "$DOMAIN" "$www_host" 'no'
+ /usr/local/vesta/bin/v-delete-dns-on-web-alias "$USER" "$DOMAIN" "$www_host" 'no'
+ www_host=""
+ fi
+ echo "== Installing LetsEncrypt SSL, please wait..."
+ /usr/local/vesta/bin/v-add-letsencrypt-domain "$USER" "$DOMAIN" "$www_host" 'yes'
+ /usr/local/vesta/bin/v-change-web-domain-proxy-tpl "$USER" "$DOMAIN" 'force-https' 'jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,woff,woff2' 'yes'
+fi
+
+echo "== Downloading Roundcube..."
+wget -nv "$DOWNLOAD" -O /root/roundcubemail.tar.gz
+
+echo "== Extracting Roundcube..."
+tar --directory /home/$USER/web/$DOMAIN/public_html --strip-components=1 -xzf /root/roundcubemail.tar.gz roundcubemail-$VERSION/
+
+fix_ownership
+
+DB_EXISTS=$(check_if_database_exists "$USER" "$DATABASE_NAME")
+if [ "$DB_EXISTS" = "no" ]; then
+ echo "== Creating database: $DATABASE_NAME"
+ /usr/local/vesta/bin/v-add-database "$USER" "$DATABASE_NAME_WITHOUT_PREFIX" "$DATABASE_NAME_WITHOUT_PREFIX" "$DATABASE_PASSWORD" 'mysql' 'localhost' 'utf8'
+else
+ echo "== Database $DATABASE_NAME already exists, and it's maybe used by another site. I will not continue. Please edit this script and enter other database name."
+ exit 1
+fi
+
+if [ -f "/usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.tpl" ]; then
+ echo "================================"
+ echo "== Installing php7.3-imap module"
+ apt update
+ apt install -y php7.3-imap
+ echo "================================"
+fi
+if [ -f "/usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl" ]; then
+ echo "================================"
+ echo "== Installing php7.4-imap module"
+ apt update
+ apt install -y php7.4-imap
+ echo "================================"
+fi
+if [ -f "/usr/local/vesta/data/templates/web/apache2/PHP-FPM-80.tpl" ]; then
+ echo "================================"
+ echo "== Installing php8.0-imap module"
+ apt update
+ apt install -y php8.0-imap
+ echo "================================"
+fi
+if [ -f "/usr/local/vesta/data/templates/web/apache2/PHP-FPM-81.tpl" ]; then
+ echo "================================"
+ echo "== Installing php8.1-imap module"
+ apt update
+ apt install -y php8.1-imap
+ echo "================================"
+fi
+if [ -f "/usr/local/vesta/data/templates/web/apache2/PHP-FPM-82.tpl" ]; then
+ echo "================================"
+ echo "== Installing php8.2-imap module"
+ apt update
+ apt install -y php8.2-imap
+ echo "================================"
+fi
+
+echo "-------------------------------------"
+echo "Go to:"
+echo "https://${DOMAIN}/installer/"
+echo "... and finish the Roundcube installation."
+echo ""
+echo "You will be asked for:"
+echo "Database host: localhost"
+echo "Database user: $DATABASE_NAME"
+echo "Database name: $DATABASE_NAME"
+echo "Database pass: $DATABASE_PASSWORD"
+echo ""
+echo "Suggestion: plugins to be enabled: new_user_dialog, password"
+echo "-------------------------------------"
+echo ""
+echo "=== When you click 'Initialize database' button (and see DB Write: OK), you can consider the installation as done."
+read -p "=== Then press Enter here, and this script will remove /home/$USER/web/$DOMAIN/public_html/installer folder ==="
+
+if [ ! -f "/home/$USER/web/$DOMAIN/public_html/config/config.inc.php" ]; then
+ echo "=== ERROR: You didn't finish the installation."
+ echo "=== Please read carefully what is written above."
+ read -p "=== Then press Enter when you finish installation ==="
+fi
+if [ ! -f "/home/$USER/web/$DOMAIN/public_html/config/config.inc.php" ]; then
+ echo "=== ERROR: You didn't finish the installation."
+ echo "=== Sorry, the script will exit now."
+ exit 1;
+fi
+
+rm -rf /home/$USER/web/$DOMAIN/public_html/installer
+
+if [ -d "/home/$USER/web/$DOMAIN/public_html/plugins/password" ]; then
+ cp /usr/share/roundcube/plugins/password/config.inc.php /home/$USER/web/$DOMAIN/public_html/plugins/password/config.inc.php
+ cp /usr/share/roundcube/plugins/password/drivers/vesta.php /home/$USER/web/$DOMAIN/public_html/plugins/password/drivers/vesta.php
+fi
+
+# wget -nv https://c.myvestacp.com/tools/roundcube-filters.tgz -O /root/roundcube-filters.tgz
+# tar --directory /home/$USER/web/$DOMAIN/public_html/plugins -xzf /root/roundcube-filters.tgz
+# sed -i "s/\$config\['plugins'\] = \[/\$config['plugins'] = ['filters', /g" /home/$USER/web/$DOMAIN/public_html/config/config.inc.php
+
+echo "\$config['session_lifetime'] = 1080;" >> /home/$USER/web/$DOMAIN/public_html/config/config.inc.php
+
+fix_ownership
+
+if [ -f "/usr/share/roundcube/skins/larry/templates/login.html" ]; then
+ check_grep=$(grep -c 'color: white; font-size: 12pt' /usr/share/roundcube/skins/larry/templates/login.html)
+ if [ "$check_grep" -eq 0 ]; then
+ sed -i "s||