Compare commits

...

59 Commits

Author SHA1 Message Date
alexey
27b237a3c7 Added support ansible instead of puppet 2026-03-29 12:21:10 +03:00
alexey
5349d46d71 Fixed resore proxy_fcgi 2026-03-29 11:07:01 +03:00
alexey
75df7a2554 Fixes for php remi 2026-03-28 20:16:08 +03:00
alexey
479a65e0dd Added remi php install fixes 2026-03-28 18:55:38 +03:00
alexey
aae561716c Fixes remi instllation 2026-03-28 18:31:39 +03:00
alexey
8a2ec261f5 Added fixes for non php-fpm installation 2026-03-28 01:29:23 +03:00
alexey
ec4bb73609 Fixed database size usage and disk usage output on the info pages 2026-03-26 22:52:45 +03:00
alexey
e37e8a0d1e Fixed nginx mod_rewrite templates 2026-03-21 23:17:24 +03:00
alexey
f398decba9 Added nginx+mod_rewrite support 2026-03-19 22:46:46 +03:00
Alexey Berezhok
ae8b90d66e Rename default rpm repository 2026-01-16 12:33:14 +03:00
Alexey Berezhok
5610859f17 Disable of MSVSphere build because of MSVSphere doesn.t exists anymore 2026-01-16 11:24:21 +03:00
Alexey Berezhok
598c9abdfb Added remit to local php script 2026-01-16 10:58:18 +03:00
Alexey Berezhok
5d461cc39b Fixed installation error for local php 2026-01-15 23:20:18 +03:00
Alexey Berezhok
8b2c076e2e Added php versions to upgrade.conf, fixed errors 2025-11-18 23:14:29 +03:00
Alexey Berezhok
f44fe71c28 Added php versions to upgrade.conf 2025-11-18 22:50:59 +03:00
Alexey Berezhok
7e9f0f1074 Merge branch 'devel' of ssh://dev.brepo.ru:9453/bayrepo/hestiacp into devel 2025-11-18 22:40:27 +03:00
Alexey Berezhok
be9c2de988 Fixed remi php version 2025-11-18 22:40:01 +03:00
Alexey Berezhok
f433895670 Update spec 2025-11-18 21:56:33 +03:00
Alexey Berezhok
e2c8835b6b Added php 8.4, 8.5 2025-11-17 23:56:25 +03:00
Alexey Berezhok
751814c48a Add fixes of installation 2025-11-17 23:50:57 +03:00
Alexey Berezhok
113cd37b9d Added php 8.4 and 8.5 2025-11-17 23:38:17 +03:00
Alexey Berezhok
ce83ca97a9 Added documentation fixes 2025-11-13 00:19:59 +03:00
Alexey Berezhok
bb547d1d9a Added local path of phpmyadmin 2025-11-11 23:46:20 +03:00
Alexey Berezhok
fd667cd08b Merge branch 'master' into devel 2025-10-18 23:45:07 +03:00
Alexey Berezhok
46fb25bcc0 Added default domain 2025-10-18 23:42:21 +03:00
Alexey Berezhok
bd56dcf5f5 Added fixes for last apache update 2025-10-14 23:08:27 +03:00
Alexey Berezhok
cc59572a59 Added fix for memory calculation 2025-06-05 23:14:09 +03:00
Alexey Berezhok
bf9de36753 Added fixes to changelog 2025-06-04 23:18:42 +03:00
Alexey Berezhok
56b3c3e5c9 Added fixes to changelog 2025-06-04 23:14:14 +03:00
Alexey Berezhok
c8b0f25247 Added fixes 2025-06-03 23:52:49 +03:00
Alexey Berezhok
f0086903a3 Added fixes 2025-06-01 23:31:48 +03:00
Alexey Berezhok
93ac9a2d5d Add devel mode install 2025-05-28 23:26:22 +03:00
Alexey Berezhok
08e5b49cab Backport github changes to the devel 2025-05-28 22:47:05 +03:00
Alexey Berezhok
4be77a30e1 Update hestia rpm 2025-04-27 23:44:55 +03:00
Alexey Berezhok
9eea39db23 Force fix 2025-04-27 23:32:25 +03:00
Alexey Berezhok
e621c84780 Restore some options behaviour by default 2025-04-27 23:22:29 +03:00
Alexey Berezhok
ec2e8ca836 Fixed install options 2025-03-26 22:56:46 +03:00
Alexey Berezhok
2b1157b0aa Fixed new repo path 2025-03-23 23:37:17 +03:00
Alexey Berezhok
e991cf4797 Fixed changelog 2025-02-04 23:41:46 +03:00
Alexey Berezhok
66bb1323a9 Added support some webapp applications. Part 2 2025-02-04 23:35:17 +03:00
Alexey Berezhok
e4624d9398 Added support some webapp applications 2025-02-04 23:34:14 +03:00
Alexey Berezhok
b7e404e18c Update composer for new version of fm and brepo/phpquoteshellarg 2025-02-04 21:53:22 +03:00
Alexey Berezhok
316ca0e292 Added alternative php. Part 14 2025-02-02 23:48:28 +03:00
Alexey Berezhok
6e7af9ea42 Added alternative php. Part 13 2025-02-02 22:07:18 +03:00
Alexey Berezhok
06fa9cb9c2 Added alternative php. Part 12 2025-02-01 23:48:29 +03:00
Alexey Berezhok
93ccae3f18 Added alternative php. Part 11 2025-01-31 23:41:28 +03:00
Alexey Berezhok
14af530339 Added alternative php. Part 10 2025-01-31 00:10:16 +03:00
Alexey Berezhok
57594e1a76 Added alternative php. Part 9 2025-01-22 23:29:41 +03:00
Alexey Berezhok
c25c8d8f64 Added alternative php. Part 8 2025-01-22 23:10:51 +03:00
Alexey Berezhok
b29a369515 Added alternative php. Part 7 2025-01-19 23:52:30 +03:00
Alexey Berezhok
7f3b5fdd27 Added alternative php. Part 5 2025-01-19 22:17:36 +03:00
Alexey Berezhok
221fe29cf0 Added alternative php. Part 4 2025-01-19 22:11:40 +03:00
Alexey Berezhok
f3b9d33016 Use local php. Part 3 2025-01-18 15:55:12 +03:00
Alexey Berezhok
2f91eee76d Use local php. Part 2 2025-01-17 21:33:34 +03:00
Alexey Berezhok
66e574dd33 Use local php. Part 1 2025-01-13 23:21:50 +03:00
Alexey Berezhok
8e2a9e1f42 Added quota 2025-01-10 22:45:19 +03:00
Alexey Berezhok
f01015c05d quota fix. Part 1 2025-01-09 23:49:05 +03:00
Alexey Berezhok
60eac545d6 Remove debian and ubuntu installer 2025-01-08 23:01:10 +03:00
Alexey Berezhok
95a0e87271 Added sha-512 authorization fix 2025-01-07 15:27:17 +03:00
170 changed files with 137274 additions and 59690 deletions

View File

@@ -2,7 +2,30 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [1.9.2.rpm] - Alpha release ## [1.9.6.rpm] - Release
- Fix error on all web and mail domains after Apache 2.4.64 update
- Fix error on local php installation and extension activation
- Added templates for nginx mod_rewrite activation
- Added nginx with mod_rewrite
- Fixed database size usage and disk usage output on the info pages
- Fixed installation of panel without PHP-FPM
- Fixed mod_php, fcgid, fcgi mode
## [1.9.5.rpm] - Release
- Added support installation of alternative php not only remi
- Fixed separate edition of php.ini in multiphp mode
- Added usemirrorclamav for install script for uieng Russian mirror for Clamav databases
- Added devel mode of installation for installing not from github by default. With this parameter installation will be from devel repo dev.brepo.ru
- Fixed memory calculation in service list
## [1.9.4.rpm] - Release
- Fixed sha-512 auth in hestiacp
- Added quota support for rpm based os
## [1.9.2.rpm] - Release
- Forked from 1.8.6 alpha and reworked for rpm based systems support - Forked from 1.8.6 alpha and reworked for rpm based systems support
- Added passenger support (https://hestiadocs.brepo.ru/docs/extensions/extended-modules.html#passenger-manager) - Added passenger support (https://hestiadocs.brepo.ru/docs/extensions/extended-modules.html#passenger-manager)

97
README.de.md Normal file
View File

@@ -0,0 +1,97 @@
<div align="center">
# [Hestia Control Panel (RPM-Edition)](https://hestiadocs.brepo.ru)
![HestiaCP Web-Oberfläche](./docs/public/images/demo.png)
## Leistungsstarkes und schlankes Serververwaltungspanel für moderne Hosting-Umgebungen
**Stabile Version:** 1.9.5 (RPM) |
[RPM-Edition](https://hestiadocs.brepo.ru) |
[Originalprojekt für Ubuntu/Debian](https://hestiacp.com) |
[Änderungsprotokoll](/CHANGELOG.md) |
[Support-Forum](https://forum.hestiacp.com)
<br><br>
[![Drone Build-Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp)
[![Lint-Status](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml/badge.svg)](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml)
[![Technischer Support](https://img.shields.io/badge/Gurubase-Fragen%20auf%20Englisch-006BFF)](https://gurubase.io/g/hestia)
</div>
Die Hestia Control Panel (RPM-Edition) wird von einem unabhängigen Team für RPM-basierte Betriebssysteme entwickelt. Durch Anpassungen nach dem Fork des Originalprojekts ist eine direkte Synchronisation mit der Ubuntu/Debian-Version nicht möglich. Bitte melden Sie Probleme direkt an dieses Projekt.
## **Willkommen!**
Hestia bietet Administratoren eine intuitive Weboberfläche und CLI zur zentralisierten Verwaltung von Webdomains, E-Mail-Konten, DNS-Zonen und Datenbanken ohne manuelle Konfiguration einzelner Komponenten.
## Funktionen & Dienste
- Apache2 & NGINX mit PHP-FPM
- Mehrere PHP-Versionen (7.4[EOL](https://www.php.net/supported-versions.php)8.3, Standard 8.2 aus Remi-Repo + Custom Builds)
- DNS-Server (Bind)
- E-Mail-Services mit Viren-/Spam-Schutz (ClamAV, SpamAssassin, Roundcube)
- MariaDB/MySQL & PostgreSQL Datenbanken
- Let's Encrypt SSL-Unterstützung
- Firewall mit Brute-Force-Schutz (iptables, fail2ban, ipset)
## Unterstützte Betriebssysteme
- **MSVSphere:** 9
- **AlmaLinux:** 9
- **RockyLinux:** 9
**Hinweise:**
- Keine Unterstützung für 32-Bit-Systeme!
- Bei OpenVZ 7 oder älter können DNS/Firewall-Probleme auftreten wir empfehlen KVM/LXC-basierte Virtualisierung.
## Installation
**Wichtig:** Frische OS-Installation erforderlich!
### Schritt 1: Anmeldung
Als **root** per SSH anmelden:
```bash
ssh root@Ihr-Server
```
### Schritt 2: Installationsskript herunterladen
```bash
wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh
```
### Schritt 3: Ausführung
Skript mit Berechtigungen ausführen:
```bash
bash hst-install.sh
```
### Custom Installation
Optionen anzeigen:
```bash
bash hst-install.sh -h
```
## Updates
Automatische Updates sind standardmäßig aktiviert (**Server-Einstellungen > Updates**). Manuelles Update:
```bash
dnf update
```
## Support
- Probleme mit RPM-Edition: [GitHub Issues](https://github.com/bayrepo/hestiacp-rpm/issues)
- Originalversion: [Hauptrepository](https://github.com/hestiacp/hestiacp)
## Lizenz
Hestia Control Panel ist unter der [GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE)-Lizenz lizenziert und basiert auf [VestaCP](https://vestacp.com/).

109
README.en.md Normal file
View File

@@ -0,0 +1,109 @@
<div align="center">
# [Hestia Control Panel (RPM Edition)](https://hestiadocs.brepo.ru)
![HestiaCP Web Interface screenshot](./docs/public/images/demo.png)
## A lightweight and powerful server control panel for modern web hosting environments
**Stable Version:** 1.9.5 (RPM) |
[RPM Edition](https://hestiadocs.brepo.ru) |
[Original Ubuntu/Debian Project](https://hestiacp.com) |
[Changelog](/CHANGELOG.md) |
[Support Forum](https://forum.hestiacp.com)
<br><br>
[![Drone Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp)
[![Lint Status](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml/badge.svg)](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml)
[![Gurubase](https://img.shields.io/badge/Gurubase-Ask%20Hestia%20Guru-006BFF)](https://gurubase.io/g/hestia)
</div>
Hestia Control Panel (RPM Edition) is maintained and developed by a separate team focused on RPM-based operating systems. Since forking from the original project, this edition has incorporated changes that prevent direct syncing with upstream updates from the Ubuntu/Debian version (not all features are relevant for RPM systems). Therefore, found issues should be reported specifically to this project.
Below is the general panel description.
## **Welcome!**
Hestia Control Panel aims to provide administrators with an easy-to-use web interface and CLI for quickly deploying and managing web domains, email accounts, DNS zones, and databases through a centralized panel - eliminating the need for manual configuration of individual components.
## Features & Services
- Apache2 & NGINX with PHP-FPM
- Multiple PHP versions (7.4[EOL](https://www.php.net/supported-versions.php) - 8.3, 8.2 default via Remi repo + custom PHP builds)
- DNS Server (Bind)
- Email services with antivirus/spam protection & webmail (POP/IMAP/SMTP, ClamAV, SpamAssassin, Sieve, Roundcube)
- MariaDB/MySQL & PostgreSQL databases
- Let's Encrypt SSL support
- Firewall with brute-force protection & IP management (iptables, fail2ban, ipset).
## Supported OS
- **MSVSphere:** 9
- **AlmaLinux:** 9
- **RockyLinux:** 9
**NOTES:**
- HestiaCP does not support 32-bit OS!
- HestiaCP combined with OpenVZ 7 or earlier may have DNS/firewall issues. For VPS, we strongly recommend KVM/LXC-based virtualization.
## Installing Hestia Control Panel
- **NOTE:** HestiaCP must be installed on a fresh OS for proper functionality.
While we strive to make installation and usage intuitive, basic Linux server setup knowledge is assumed.
### Step 1: Log in
Login as **root** or a superuser via SSH:
```bash
ssh root@your.server
```
### Step 2: Download
Get the latest installer script:
```bash
wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh
```
### Step 3: Execute
Run the script and follow on-screen instructions:
```bash
bash hst-install.sh
```
Upon completion, you'll receive a welcome email (if configured) and login details.
### Custom Installation
Use flags to select specific components. View options with:
```bash
bash hst-install.sh -h
```
## Updating Existing Installations
Automatic updates are enabled by default (managed via **Server Settings > Updates**). Manual updates:
```bash
dnf update
```
## Issues & Support
- For RPM edition issues: [Create GitHub Issue](https://github.com/bayrepo/hestiacp-rpm/issues)
- Original Debian/Ubuntu version: [Original Repository](https://github.com/hestiacp/hestiacp)
## Copyright
Original copyrights belong to [HestiaCP](https://github.com/hestiacp/hestiacp)
## License
Hestia Control Panel is licensed under [GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE) and based on [VestaCP](https://vestacp.com/).

99
README.es.md Normal file
View File

@@ -0,0 +1,99 @@
<div align="center">
# [Panel de Control Hestia (Edición RPM)](https://hestiadocs.brepo.ru)
![Captura de la interfaz web de HestiaCP](./docs/public/images/demo.png)
## Panel de servidor ligero y potente para entornos modernos de alojamiento web
**Versión estable:** 1.9.5 (RPM) |
[Edición RPM](https://hestiadocs.brepo.ru) |
[Proyecto original para Ubuntu/Debian](https://hestiacp.com) |
[Registro de cambios](/CHANGELOG.md) |
[Foro de soporte](https://forum.hestiacp.com)
<br><br>
[![Estado de compilación Drone](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp)
[![Estado de verificación](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml/badge.svg)](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml)
[![Soporte técnico](https://img.shields.io/badge/Gurubase-Preguntas_en_inglés-006BFF)](https://gurubase.io/g/hestia)
</div>
El Panel de Control Hestia (Edición RPM) es mantenido por un equipo independiente especializado en sistemas basados en RPM. Debido a cambios implementados tras la bifurcación del proyecto original, esta versión no puede sincronizarse directamente con las actualizaciones de Ubuntu/Debian. Reporte los problemas directamente a este proyecto.
## **¡Bienvenido!**
Hestia ofrece una interfaz web intuitiva y CLI para implementar y gestionar dominios web, cuentas de correo, zonas DNS y bases de datos de forma centralizada, sin configuración manual de componentes individuales.
## Características y servicios
- Apache2 & NGINX con PHP-FPM
- Múltiples versiones de PHP (7.4[EOL](https://www.php.net/supported-versions.php) - 8.3, predeterminado 8.2 desde repositorio Remi + compilaciones personalizadas)
- Servidor DNS (Bind)
- Servicios de correo con protección antivirus/anti-spam (ClamAV, SpamAssassin, Roundcube)
- Bases de datos MariaDB/MySQL & PostgreSQL
- Soporte Let's Encrypt SSL
- Cortafuegos con protección contra fuerza bruta (iptables, fail2ban, ipset)
## Sistemas compatibles
- **MSVSphere:** 9
- **AlmaLinux:** 9
- **RockyLinux:** 9
**Notas importantes:**
- ¡No compatible con sistemas de 32 bits!
- Pueden ocurrir problemas de DNS/cortafuegos en OpenVZ 7 o anteriores. Recomendamos virtualización basada en KVM/LXC.
## Instalación
**Requisito:** ¡Sistema operativo recién instalado!
### Paso 1: Iniciar sesión
Conéctese como **root** vía SSH:
```bash
ssh root@su-servidor
```
### Paso 2: Descargar script
Obtenga el instalador más reciente:
```bash
wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh
```
### Paso 3: Ejecutar
Ejecute el script con permisos:
```bash
bash hst-install.sh
```
### Instalación personalizada
Ver opciones disponibles:
```bash
bash hst-install.sh -h
```
## Actualizaciones
Las actualizaciones automáticas están activadas por defecto (**Configuración del servidor > Actualizaciones**). Actualización manual:
```bash
dnf update
```
## Soporte técnico
- Problemas con la edición RPM: [Reportar en GitHub](https://github.com/bayrepo/hestiacp-rpm/issues)
- Versión original: [Repositorio principal](https://github.com/hestiacp/hestiacp)
## Licencia
Hestia Control Panel se distribuye bajo licencia [GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE) y está basado en [VestaCP](https://vestacp.com/).

109
README.hi.md Normal file
View File

@@ -0,0 +1,109 @@
<div align="center">
# [हेस्टिया कंट्रोल पैनल (RPM संस्करण)](https://hestiadocs.brepo.ru)
![HestiaCP वेब इंटरफेस स्क्रीनशॉट](./docs/public/images/demo.png)
## आधुनिक वेब होस्टिंग वातावरण के लिए हल्का और शक्तिशाली सर्वर नियंत्रण पैनल
**स्थिर संस्करण:** 1.9.5 (RPM) |
[RPM संस्करण](https://hestiadocs.brepo.ru) |
[मूल Ubuntu/Debian प्रोजेक्ट](https://hestiacp.com) |
[परिवर्तन सूची](/CHANGELOG.md) |
[सहायता फोरम](https://forum.hestiacp.com)
<br><br>
[![Drone बिल्ड स्थिति](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp)
[![कोड लिंट स्थिति](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml/badge.svg)](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml)
[![तकनीकी प्रश्नोत्तर](https://img.shields.io/badge/Gurubase-हेस्टिया_फोरम_में_अंग्रेजी_में_पूछें-006BFF)](https://gurubase.io/g/hestia)
</div>
हेस्टिया कंट्रोल पैनल (RPM संस्करण) RHEL-आधारित वितरणों पर केंद्रित एक स्वतंत्र टीम द्वारा विकसित और बनाए रखा जाता है। मूल प्रोजेक्ट से फोर्क होने के बाद, यह संस्करण अपस्ट्रीम Ubuntu/Debian संस्करण के साथ सीधे सिंक नहीं होता (कुछ सुविधाएँ RPM सिस्टम के लिए लागू नहीं हैं)। कृपया इस संस्करण से संबंधित समस्याओं को सीधे इस प्रोजेक्ट में रिपोर्ट करें।
निम्नलिखित पैनल का सामान्य विवरण है।
## **आपका स्वागत है!**
हेस्टिया कंट्रोल पैनल का उद्देश्य व्यवस्थापकों को वेबसाइट, ईमेल खाते, DNS ज़ोन और डेटाबेस को तेज़ी से तैनात करने और प्रबंधित करने के लिए एक केंद्रीकृत वेब इंटरफेस और कमांड-लाइन टूल्स प्रदान करना है - बिना अलग-अलग घटकों को मैन्युअल रूप से कॉन्फ़िगर किए।
## सुविधाएँ और सेवाएँ
- Apache2 और NGINX PHP-FPM के साथ
- बहु-PHP संस्करण समर्थन (7.4[EOL](https://www.php.net/supported-versions.php) - 8.3, डिफ़ॉल्ट 8.2 Remi रिपॉजिटरी से + कस्टम PHP बिल्ड)
- DNS सर्वर (Bind)
- वायरस/स्पैम सुरक्षा के साथ ईमेल सेवाएँ और वेबमेल (POP/IMAP/SMTP, ClamAV, SpamAssassin, Sieve, Roundcube)
- MariaDB/MySQL और PostgreSQL डेटाबेस
- Let's Encrypt SSL समर्थन
- ब्रूट-फोर्स सुरक्षा और IP प्रबंधन के साथ फ़ायरवॉल (iptables, fail2ban, ipset)
## समर्थित सिस्टम
- **MSVSphere:** 9
- **AlmaLinux:** 9
- **RockyLinux:** 9
**ध्यान दें:**
- HestiaCP 32-बिट ऑपरेटिंग सिस्टम को समर्थन नहीं करता!
- OpenVZ 7 या पुराने संस्करणों पर HestiaCP का उपयोग करते समय DNS/फ़ायरवॉल समस्याएँ हो सकती हैं। KVM/LXC आधारित वर्चुअलाइजेशन विकल्पों की सिफारिश की जाती है।
## Hestia कंट्रोल पैनल इंस्टॉल करें
- **नोट:** पूर्ण कार्यक्षमता सुनिश्चित करने के लिए कृपया एक ताज़ा सर्वर इंस्टॉलेशन पर इंस्टॉल करें।
हालांकि हम इंस्टॉलेशन प्रक्रिया को सरल बनाने का प्रयास करते हैं, लेकिन उपयोगकर्ताओं को लिनक्स सर्वर प्रबंधन का बुनियादी ज्ञान होना आवश्यक है।
### चरण 1: लॉगिन
**root** या सुपरयूजर एक्सेस के साथ SSH के माध्यम से लॉगिन करें:
```bash
ssh root@your.server
```
### चरण 2: डाउनलोड करें
नवीनतम इंस्टॉल स्क्रिप्ट प्राप्त करें:
```bash
wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh
```
### चरण 3: निष्पादित करें
स्क्रिप्ट चलाएँ और स्क्रीन निर्देशों का पालन करें:
```bash
bash hst-install.sh
```
इंस्टॉलेशन पूरा होने पर, आपको एक स्वागत ईमेल (यदि कॉन्फ़िगर किया गया हो) और लॉगिन विवरण प्राप्त होंगे।
### कस्टम इंस्टॉलेशन
घटकों को चुनने के लिए पैरामीटर का उपयोग करें, विकल्प देखें:
```bash
bash hst-install.sh -h
```
## मौजूदा इंस्टॉलेशन अपडेट करें
स्वचालित अपडेट डिफ़ॉल्ट रूप से सक्षम हैं (**सर्वर सेटिंग्स > अपडेट** के माध्यम से प्रबंधित)। मैन्युअल अपडेट:
```bash
dnf update
```
## समस्याएँ और सहायता
- RPM संस्करण से संबंधित मुद्दे: [GitHub इश्यू दर्ज करें](https://github.com/bayrepo/hestiacp-rpm/issues)
- मूल Debian/Ubuntu संस्करण: [मूल प्रोजेक्ट रिपॉजिटरी](https://github.com/hestiacp/hestiacp)
## कॉपीराइट
मूल कॉपीराइट [HestiaCP](https://github.com/hestiacp/hestiacp) के पास है
## लाइसेंस
हेस्टिया कंट्रोल पैनल [GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE) लाइसेंस के तहत जारी किया गया है, और [VestaCP](https://vestacp.com/) पर आधारित है।

97
README.ja.md Normal file
View File

@@ -0,0 +1,97 @@
<div align="center">
# [Hestia コントロールパネル (RPM版)](https://hestiadocs.brepo.ru)
![HestiaCP Webインターフェーススクリーンショット](./docs/public/images/demo.png)
## 現代的なWebホスティング環境向け軽量で強力なサーバー管理パネル
**安定版:** 1.9.5 (RPM) |
[RPM版](https://hestiadocs.brepo.ru) |
[オリジナルUbuntu/Debian版](https://hestiacp.com) |
[更新履歴](/CHANGELOG.md) |
[サポートフォーラム](https://forum.hestiacp.com)
<br><br>
[![Droneビルドステータス](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp)
[![Lintステータス](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml/badge.svg)](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml)
[![技術Q&A](https://img.shields.io/badge/Gurubase-英語を使ってHestia開発者と議論する-006BFF)](https://gurubase.io/g/hestia)
</div>
Hestia コントロールパネルRPM版はRPMベースOS専用の開発チームによってメンテナンスされています。Ubuntu/Debian版との機能同期ができないため、問題報告は本プロジェクト宛てにお願いします。
## **ようこそ!**
Hestiaは直感的なWebインターフェースとCLIを提供し、ドメイン管理・メールアカウント・DNSゾーン・データベースの迅速なデプロイを可能にするサーバー管理パネルです。
## 主な機能
- Apache2 & NGINX + PHP-FPM連携
- マルチPHPバージョン7.4[EOL](https://www.php.net/supported-versions.php) - 8.3、Remiリポジトリ版+カスタムビルド)
- Bind DNSサーバー
- ウイルス/スパム対策付きメールサービスClamAV, SpamAssassin, Roundcube
- MariaDB/MySQL & PostgreSQLデータベース
- Let's Encrypt SSL対応
- ブルートフォース攻撃防御機能iptables, fail2ban, ipset
## 対応OS
- **MSVSphere:** 9
- **AlmaLinux:** 9
- **RockyLinux:** 9
**注意事項:**
- 32ビットOS非対応
- OpenVZ 7以前の環境ではDNS/ファイアウォール問題が発生する可能性あり
## インストール手順
### ステップ1: rootログイン
SSHでrootユーザーとしてログイン:
```bash
ssh root@your.server
```
### ステップ2: インストーラ取得
最新インストーラをダウンロード:
```bash
wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh
```
### ステップ3: 実行
スクリプトを実行し指示に従う:
```bash
bash hst-install.sh
```
### カスタムインストール
オプション確認:
```bash
bash hst-install.sh -h
```
## アップデート
自動更新はデフォルトで有効(**サーバー設定 > 更新**から管理)。手動更新:
```bash
dnf update
```
## サポート
- RPM版問題報告: [GitHub Issues](https://github.com/bayrepo/hestiacp-rpm/issues)
- オリジナル版: [公式リポジトリ](https://github.com/hestiacp/hestiacp)
## ライセンス
Hestiaコントロールパネルは[GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE)ライセンスで、[VestaCP](https://vestacp.com/)を基に開発されています。

125
README.md
View File

@@ -1,110 +1,123 @@
<h1 align="center">Hestia Control Panel</h1> <div align="center">
<h2 align="center">Lightweight and powerful control panel for the modern web</h2> # [Панель управления Hestia (RPM версия)](https://hestiadocs.brepo.ru)
<p align="center"><strong>Original project:</strong> | <a href="https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md">View Changelog</a> | ![Скриншот веб-интерфейса HestiaCP](./docs/public/images/demo.png)
<a href="https://www.hestiacp.com/">HestiaCP.com</a> |
<a href="https://docs.hestiacp.com/">Documentation</a> |
<a href="https://forum.hestiacp.com/">Forum</a>
<br/><br/></p>
## Легкая и мощная серверная панель для современных веб-сред
<p align="center"> **Стабильная версия:** 1.9.5 (RPM) |
<strong>RPM support project:</strong> | [RPM версия](https://hestiadocs.brepo.ru) |
<a href="https://hestiadocs.brepo.ru/">Documentation for version with RPM support</a> [Оригинальный проект для Ubuntu/Debian](https://hestiacp.com) |
</p> [История изменений](/CHANGELOG.md) |
[Форум поддержки](https://forum.hestiacp.com)
<br><br>
[![Статус сборки Drone](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp)
[![Статус проверки кода](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml/badge.svg)](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml)
[![Техподдержка](https://img.shields.io/badge/Gurubase-Обсуждениеа_английском_в_форуме_Hestia-006BFF)](https://gurubase.io/g/hestia)
## **Welcome!** </div>
Hestia Control Panel is designed to provide administrators an easy to use web and command line interface, enabling them to quickly deploy and manage web domains, mail accounts, DNS zones, and databases from one central dashboard without the hassle of manually deploying and configuring individual components or services. ## [English](README.en.md)
## Features and Services ## [Deutsch](README.de.md)
- Apache2 and NGINX with PHP-FPM ## [Español](README.es.md)
- Multiple PHP versions (5.6 - 8.2, 8.0 as default)
- DNS Server (Bind) with clustering capabilities
- POP/IMAP/SMTP mail services with Anti-Virus, Anti-Spam, and Webmail (ClamAV, SpamAssassin, Sieve, Roundcube)
- MariaDB/MySQL and/or PostgreSQL databases
- Let's Encrypt SSL support with wildcard certificates
- Firewall with brute-force attack detection and IP lists (iptables, fail2ban, and ipset).
## Supported platforms and operating systems ## [हिन्दी](README.hi.md)
## [日本語](README.ja.md)
## [简体中文](README.zh-Hans.md)
## [繁體中文](README.zh-Hant.md)
Панель управления Hestia (RPM версия) разрабатывается и поддерживается независимой командой, специализирующейся на RPM-ориентированных дистрибутивах. После ответвления от оригинального проекта данная версия включает изменения, которые не позволяют синхронизировать обновления с Ubuntu/Debian версией (некоторые функции не применимы к RPM-системам). Пожалуйста, сообщайте о проблемах непосредственно в этот проект.
Ниже представлено общее описание панели.
## **Добро пожаловать!**
Hestia Control Panel предоставляет администраторам простой веб-интерфейс и CLI-инструменты для быстрого развертывания доменов, почтовых аккаунтов, DNS-зон и баз данных через централизованную панель без ручной настройки отдельных компонентов.
## Функционал и сервисы
- Apache2 и NGINX с PHP-FPM
- Поддержка нескольких версий PHP (7.4[EOL](https://www.php.net/supported-versions.php)-8.3, по умолчанию 8.2 из репозитория Remi + кастомные сборки)
- DNS-сервер (Bind)
- Почтовый сервис с антивирусом/антиспамом и веб-почтой (POP/IMAP/SMTP, ClamAV, SpamAssassin, Sieve, Roundcube)
- Базы данных MariaDB/MySQL и PostgreSQL
- Поддержка SSL Let's Encrypt
- Фаервол с защитой от брутфорса и IP-менеджментом (iptables, fail2ban, ipset)
## Поддерживаемые системы
- **MSVSphere:** 9 - **MSVSphere:** 9
- **AlmaLinux:** 9 - **AlmaLinux:** 9
- **RockyLinux:** 9 - **RockyLinux:** 9
Currently stayed support of Debian and Ubuntu, but new functional will be available only for RPM based systems. For full supportin of Debian and Ubuntu use original [HestiaCP](https://github.com/hestiacp/hestiacp) **Важно:**
**NOTES:** - HestiaCP не поддерживает 32-битные ОС!
- На OpenVZ 7 и старых версиях возможны проблемы с DNS/фаерволом. Рекомендуем KVM/LXC-виртуализацию.
- Hestia Control Panel does not support 32 bit operating systems! ## Установка Hestia
- Hestia Control Panel in combination with OpenVZ 7 or lower might have issues with DNS and/or firewall. If you use a Virtual Private Server we strongly advice you to use something based on KVM or LXC!
## Installing Hestia Control Panel - **Примечание:** Для корректной работы устанавливайте на чистую ОС.
- **NOTE:** You must install Hestia Control Panel on top of a fresh operating system installation to ensure proper functionality. Требуются базовые знания администрирования Linux-серверов.
While we have taken every effort to make the installation process and the control panel interface as friendly as possible (even for new users), it is assumed that you will have some prior knowledge and understanding in the basics how to set up a Linux server before continuing. ### Шаг 1: Авторизация
### Step 1: Log in Войдите как **root** через SSH:
To start the installation, you will need to be logged in as **root** or a user with super-user privileges. You can perform the installation either directly from the command line console or remotely via SSH:
```bash ```bash
ssh root@your.server ssh root@ваш.сервер
``` ```
### Step 2: Download ### Шаг 2: Загрузка
Download the installation script for the latest release: Получите установочный скрипт:
```bash ```bash
wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh
``` ```
If the download fails due to an SSL validation error, please be sure you've installed the ca-certificate package on your system - you can do this with the following command: ### Шаг 3: Запуск
```bash Выполните скрипт и следуйте инструкциям:
yum update
```
### Step 3: Run
To begin the installation process, simply run the script and follow the on-screen prompts:
```bash ```bash
bash hst-install.sh bash hst-install.sh
``` ```
You will receive a welcome email at the address specified during installation (if applicable) and on-screen instructions after the installation is completed to log in and access your server. После установки вы получите приветственное письмо и данные для входа.
### Custom installation ### Кастомная установка
You may specify a number of various flags during installation to only install the features in which you need. To view a list of available options, run: Используйте параметры для выбора компонентов:
```bash ```bash
bash hst-install.sh -h bash hst-install.sh -h
``` ```
## How to upgrade an existing installation ## Обновление системы
Automatic Updates are enabled by default on new installations of Hestia Control Panel and can be managed from **Server Settings > Updates**. To manually check for and install available updates, use the system package manager: Автообновления включены по умолчанию (управление: **Настройки сервера > Обновления**). Ручное обновление:
```bash ```bash
dnf update dnf update
``` ```
## Issues & Support Requests ## Поддержка и отчеты
- If you encounter a general problem while using Hestia Control Panel for RPM based system use [issue report](https://github.com/bayrepo/hestiacp/issues) - Проблемы с RPM-версией: [GitHub Issues](https://github.com/bayrepo/hestiacp-rpm/issues)
- Оригинальная версия: [Репозиторий проекта](https://github.com/hestiacp/hestiacp)
For original HestiaCP for Debian and Ubuntu use [original version](https://github.com/hestiacp/hestiacp): ## Авторские права
## Copyright Оригинальный код: [HestiaCP](https://github.com/hestiacp/hestiacp)
See original copyright of [HestiaCP](https://github.com/hestiacp/hestiacp) ## Лицензия
## License Распространяется под лицензией [GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE), основан на [VestaCP](https://vestacp.com/).
Hestia Control Panel is licensed under [GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE) license, and is based on the [VestaCP](https://vestacp.com/) project.<br>

109
README.zh-Hans.md Normal file
View File

@@ -0,0 +1,109 @@
<div align="center">
# [Hestia 控制面板 (RPM 版)](https://hestiadocs.brepo.ru)
![HestiaCP 网页界面截图](./docs/public/images/demo.png)
## 面向现代网络托管环境的轻量级强大服务器控制面板
**稳定版本:** 1.9.5 (RPM) |
[RPM 版](https://hestiadocs.brepo.ru) |
[原版 Ubuntu/Debian 项目](https://hestiacp.com) |
[更新日志](/CHANGELOG.md) |
[支持论坛](https://forum.hestiacp.com)
<br>
[![Drone 构建状态](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp)
[![代码检查状态](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml/badge.svg)](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml)
[![技术问答](https://img.shields.io/badge/Gurubase-使用英文在Hestia论坛提问-006BFF)](https://gurubase.io/g/hestia)
</div>
Hestia 控制面板RPM 版由专注于RHEL系列发行版的独立团队维护开发。由于从原项目分叉后此版本已包含与上游 Ubuntu/Debian 版本无法直接同步的变更(部分功能不适用于 RPM 系统),因此相关问题请直接报告至本项目。
以下是面板的通用描述。
## **欢迎使用!**
Hestia 控制面板旨在通过集中式面板为管理员提供易用的网页界面和命令行工具快速部署和管理网站域名、邮箱账户、DNS 区域和数据库,无需手动配置独立组件。
## 功能与服务
- Apache2 和 NGINX 搭配 PHP-FPM
- 多版本 PHP 支持7.4[EOL](https://www.php.net/supported-versions.php) - 8.3,默认 8.2 来自 Remi 仓库 + 自定义 PHP 构建)
- DNS 服务器Bind
- 带病毒/垃圾邮件防护的邮件服务及网页邮箱POP/IMAP/SMTPClamAVSpamAssassinSieveRoundcube
- MariaDB/MySQL 和 PostgreSQL 数据库
- Let's Encrypt SSL 支持
- 防火墙含暴力破解防护和 IP 管理iptablesfail2banipset
## 支持系统
- **MSVSphere:** 9
- **AlmaLinux:** 9
- **RockyLinux:** 9
**注意事项:**
- HestiaCP 不支持 32 位操作系统!
- 在 OpenVZ 7 或更早版本上使用 HestiaCP 可能出现 DNS/防火墙问题。建议选择基于 KVM/LXC 的虚拟化方案。
## 安装 Hestia 控制面板
- **注意:** 为保证功能完整性,请在新装系统上进行安装。
尽管我们力求安装过程简单直观,但使用者需具备基础的 Linux 服务器配置知识。
### 步骤 1登录
使用 **root** 或超级用户权限通过 SSH 登录:
```bash
ssh root@your.server
```
### 步骤 2下载
获取最新安装脚本:
```bash
wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh
```
### 步骤 3执行
运行脚本并遵循屏幕指引:
```bash
bash hst-install.sh
```
安装完成后,您将收到欢迎邮件(如配置)和登录信息。
### 自定义安装
使用参数选择组件,查看选项:
```bash
bash hst-install.sh -h
```
## 更新现有安装
默认启用自动更新(通过 **服务器设置 > 更新** 管理)。手动更新:
```bash
dnf update
```
## 问题与支持
- RPM 版本问题反馈:[提交 GitHub Issue](https://github.com/bayrepo/hestiacp-rpm/issues)
- 原版 Debian/Ubuntu 版本:[原项目仓库](https://github.com/hestiacp/hestiacp)
## 版权声明
原始版权归属 [HestiaCP](https://github.com/hestiacp/hestiacp)
## 授权协议
Hestia 控制面板遵循 [GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE) 协议,基于 [VestaCP](https://vestacp.com/) 开发。

109
README.zh-Hant.md Normal file
View File

@@ -0,0 +1,109 @@
<div align="center">
# [Hestia 控制面板 (RPM 版)](https://hestiadocs.brepo.ru)
![HestiaCP 網頁介面截圖](./docs/public/images/demo.png)
## 面向現代網絡託管環境的輕量級強大伺服器控制面板
**穩定版本:** 1.9.5 (RPM) |
[RPM 版](https://hestiadocs.brepo.ru) |
[原版 Ubuntu/Debian 專案](https://hestiacp.com) |
[更新日誌](/CHANGELOG.md) |
[支援論壇](https://forum.hestiacp.com)
<br>
[![Drone 建構狀態](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp)
[![程式碼檢查狀態](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml/badge.svg)](https://github.com/hestiacp/hestiacp/actions/workflows/lint.yml)
[![技術問答](https://img.shields.io/badge/Gurubase-使用英文在Hestia論壇提問-006BFF)](https://gurubase.io/g/hestia)
</div>
Hestia 控制面板RPM 版)由專注於 RPM 系統的獨立團隊維護開發。由於從原專案分叉後,此版本已包含與上游 Ubuntu/Debian 版本無法直接同步的變更(部分功能不適用於 RPM 系統),因此相關問題請直接報告至本專案。
以下是面板的通用描述。
## **歡迎使用!**
Hestia 控制面板旨在透過集中式面板為管理員提供易用的網頁介面和命令列工具快速部署和管理網站域名、郵箱帳戶、DNS 區域和資料庫,無需手動配置獨立元件。
## 功能與服務
- Apache2 和 NGINX 搭配 PHP-FPM
- 多版本 PHP 支援7.4[EOL](https://www.php.net/supported-versions.php) - 8.3,預設 8.2 來自 Remi 倉庫 + 自訂 PHP 構建)
- DNS 伺服器Bind
- 帶病毒/垃圾郵件防護的郵件服務及網頁郵箱POP/IMAP/SMTPClamAVSpamAssassinSieveRoundcube
- MariaDB/MySQL 和 PostgreSQL 資料庫
- Let's Encrypt SSL 支援
- 防火牆含暴力破解防護和 IP 管理iptablesfail2banipset
## 支援系統
- **MSVSphere:** 9
- **AlmaLinux:** 9
- **RockyLinux:** 9
**注意事項:**
- HestiaCP 不支援 32 位元作業系統!
- 在 OpenVZ 7 或更早版本上使用 HestiaCP 可能出現 DNS/防火牆問題。建議選擇基於 KVM/LXC 的虛擬化方案。
## 安裝 Hestia 控制面板
- **注意:** 為保證功能完整性,請在新裝系統上進行安裝。
儘管我們力求安裝過程簡單直觀,但使用者需具備基礎的 Linux 伺服器配置知識。
### 步驟 1登入
使用 **root** 或超級使用者權限透過 SSH 登入:
```bash
ssh root@your.server
```
### 步驟 2下載
取得最新安裝腳本:
```bash
wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh
```
### 步驟 3執行
執行腳本並遵循螢幕指引:
```bash
bash hst-install.sh
```
安裝完成後,您將收到歡迎郵件(如配置)和登入資訊。
### 自訂安裝
使用參數選擇元件,檢視選項:
```bash
bash hst-install.sh -h
```
## 更新現有安裝
預設啟用自動更新(透過 **伺服器設定 > 更新** 管理)。手動更新:
```bash
dnf update
```
## 問題與支援
- RPM 版本問題回饋:[提交 GitHub Issue](https://github.com/bayrepo/hestiacp-rpm/issues)
- 原版 Debian/Ubuntu 版本:[原專案倉庫](https://github.com/hestiacp/hestiacp)
## 版權聲明
原始版權歸屬 [HestiaCP](https://github.com/hestiacp/hestiacp)
## 授權協議
Hestia 控制面板遵循 [GPL v3](https://github.com/hestiacp/hestiacp/blob/release/LICENSE) 協議,基於 [VestaCP](https://vestacp.com/) 開發。

View File

@@ -21,28 +21,10 @@ source_conf "$HESTIA/conf/hestia.conf"
# Verifications # # Verifications #
#----------------------------------------------------------# #----------------------------------------------------------#
# Ensure that quota kernel modules are installed
if [ ! -f /etc/redhat-release ]; then
kernel_module_check=$(find /lib/modules/$(uname -r) -type f -name '*quota_v*.ko*' | egrep '.*' && [ $? -eq 0 ])
if [ -z "$kernel_module_check" ]; then
# Install kernel modules for quota support.
# Requires reboot to activate updated kernel.
echo "Installing required kernel modules for quota support..."
reboot_req="Y"
apt-get -qq install linux-image-extra-virtual -y
check_result $? "kernel module installation failed" "$E_UPDATE"
fi
fi
# Checking quota package # Checking quota package
quota=$(which --skip-alias --skip-functions quota 2> /dev/null) quota=$(which --skip-alias --skip-functions quota 2> /dev/null)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
if [ -f "/etc/redhat-release" ]; then dnf -y install quota > /dev/null 2>&1
dnf -y install quota > /dev/null 2>&1
else
export DEBIAN_FRONTEND=noninteractive
apt-get -y install quota > /dev/null 2>&1
fi
check_result $? "quota package installation failed" "$E_UPDATE" check_result $? "quota package installation failed" "$E_UPDATE"
fi fi
@@ -54,34 +36,70 @@ check_hestia_demo_mode
#----------------------------------------------------------# #----------------------------------------------------------#
# Adding group and user quota on /home partition # Adding group and user quota on /home partition
file_system=$(df -T /home | tail -n1 | awk '{print $2}')
mnt=$(df -P /home | awk '{print $6}' | tail -n1) mnt=$(df -P /home | awk '{print $6}' | tail -n1)
lnr=$(cat -n /etc/fstab | grep -v "#" | awk '{print $1,$3}' | grep "$mnt$" | cut -f 1 -d ' ') lnr=$(cat -n /etc/fstab | grep -v "#" | awk '{print $1,$3}' | grep "$mnt$" | cut -f 1 -d ' ')
opt=$(sed -n ${lnr}p /etc/fstab | awk '{print $4}') opt=$(sed -n ${lnr}p /etc/fstab | awk '{print $4}')
fnd='usrquota\|grpquota\|usrjquota=aquota.user\|grpjquota=aquota.group\|jqfmt=vfsv0' if [ "$file_system" == "xfs" ]; then
if [ $(echo $opt | tr ',' '\n' | grep -x $fnd | wc -l) -ne 5 ]; then fnd='usrquota\|grpquota'
old=$(echo $(echo $opt | tr ',' '\n' | grep -v 'usrquota\|grpquota\|usrjquota=\|grpjquota=\|jqfmt=') | tr ' ' ',') if [ $(echo $opt | tr ',' '\n' | grep -x $fnd | wc -l) -ne 2 ]; then
new='usrquota,grpquota,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0' old=$(echo $(echo $opt | tr ',' '\n' | grep -v 'usrquota\|grpquota') | tr ' ' ',')
sed -i "$lnr s/$opt/$old,$new/" /etc/fstab new='usrquota,grpquota'
mount -o remount "$mnt" sed -i "$lnr s/$opt/$old,$new/" /etc/fstab
mount -o remount "$mnt"
systemctl daemon-reload
if [ "$mnt" == "/" ]; then
check_args=$(grubby --info=ALL | grep -oP "rootflags=\S*")
if [ -n "$check_args" ]; then
RED='\033[0;31m'
NC='\033[0m'
YELLOW='\033[1;33m'
printf "${RED}!!!!!!!Detected rootflags in grub!!!!!!!${NC}\n"
echo "${YELLOW}Add manualy 'uquota,pquota' and reboot the system${NC}\n"
else
grubby --args="rootflags=uquota,pquota" --update-kernel=ALL
fi
fi
fi
elif [ "$file_system" == "ext4" ]; then
fnd='usrquota\|grpquota\|usrjquota=aquota.user\|grpjquota=aquota.group\|jqfmt=vfsv0'
if [ $(echo $opt | tr ',' '\n' | grep -x $fnd | wc -l) -ne 5 ]; then
old=$(echo $(echo $opt | tr ',' '\n' | grep -v 'usrquota\|grpquota\|usrjquota=\|grpjquota=\|jqfmt=') | tr ' ' ',')
new='usrquota,grpquota,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0'
sed -i "$lnr s/$opt/$old,$new/" /etc/fstab
mount -o remount "$mnt"
systemctl daemon-reload
fi
else
if [ -n "$(grep DISK_QUOTA $HESTIA/conf/hestia.conf)" ]; then
sed -i "s/DISK_QUOTA=.*/DISK_QUOTA='no'/g" $HESTIA/conf/hestia.conf
fi
$BIN/v-log-action "system" "Info" "Plugins" "System Quota not supported."
log_history "system quota not supported"
log_event "$E_DISK" "$ARGUMENTS"
exit
fi fi
# Adding v2 group and user quota index if [ "$file_system" == "ext4" ]; then
if [ ! -e "$mnt/aquota.user" ] || [ ! -e "$mnt/aquota.group" ]; then # Adding v2 group and user quota index
quotacheck -avcugm > /dev/null 2>&1 if [ ! -e "$mnt/aquota.user" ] || [ ! -e "$mnt/aquota.group" ]; then
fi quotacheck -avcugm > /dev/null 2>&1
fi
# Adding quotacheck on reboot # Adding quotacheck on reboot
touch /forcequotacheck touch /forcequotacheck
# Adding cron job # Adding cron job
echo '#!/bin/bash' > /etc/cron.daily/quotacheck echo '#!/bin/bash' > /etc/cron.daily/quotacheck
echo 'touch /forcequotacheck' >> /etc/cron.daily/quotacheck echo 'touch /forcequotacheck' >> /etc/cron.daily/quotacheck
chmod a+x /etc/cron.daily/quotacheck chmod a+x /etc/cron.daily/quotacheck
# Enabling group and user quota
if [ -n "$(quotaon -pa | grep " $mnt " | grep 'user\|group' | grep 'is off')" ]; then
quotaon -v $mnt
check_result $? "quota can't be enabled in $mnt" "$E_DISK"
fi
# Enabling group and user quota
if [ -n "$(quotaon -pa | grep " $mnt " | grep 'user\|group' | grep 'is off')" ]; then
quotaon -v $mnt
check_result $? "quota can't be enabled in $mnt" "$E_DISK"
fi fi
# Updating hestia.conf value # Updating hestia.conf value

View File

@@ -22,11 +22,11 @@ source $HESTIA/func/main.sh
source_conf "$HESTIA/conf/hestia.conf" source_conf "$HESTIA/conf/hestia.conf"
source_conf "$HESTIA/install/upgrade/upgrade.conf" source_conf "$HESTIA/install/upgrade/upgrade.conf"
if [ -f /etc/redhat-release ]; then
for elem in "${!multiphp_v[@]}"; do for elem in "${!multiphp_v[@]}"; do
multiphp_v[$elem]=$(convert_dot_version_to_non_dot "${multiphp_v[$elem]}") multiphp_v[$elem]=$(convert_dot_version_to_non_dot "${multiphp_v[$elem]}")
done done
fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Verifications # # Verifications #
#----------------------------------------------------------# #----------------------------------------------------------#
@@ -38,27 +38,22 @@ if [ -z "$WEB_BACKEND" ]; then
fi fi
# Set file locations # Set file locations
if [ -f /etc/redhat-release ]; then php_fpm=""
php_fpm="/usr/lib/systemd/system/php$version-php-fpm.service" if [ "$LOCAL_PHP" == "yes" ]; then
php_fpm="/usr/lib/systemd/system/brepo-php-fpm$version.service"
else else
php_fpm="/etc/init.d/php$version-fpm" php_fpm="/usr/lib/systemd/system/php$version-php-fpm.service"
fi fi
# Verify php version format # Verify php version format
if [ -f /etc/redhat-release ]; then if [[ ! $version =~ ^[0-9][0-9]+ ]]; then
if [[ ! $version =~ ^[0-9][0-9]+ ]]; then echo "The specified PHP version format is invalid, it should look like [0-9][0-9]."
echo "The specified PHP version format is invalid, it should look like [0-9][0-9]." echo "Example: 70, 74, 80"
echo "Example: 70, 74, 80" exit "$E_INVALID"
exit "$E_INVALID"
fi
else
if [[ ! $version =~ ^[0-9].[0-9]+ ]]; then
echo "The specified PHP version format is invalid, it should look like [0-9].[0-9]."
echo "Example: 7.0, 7.4, 8.0"
exit "$E_INVALID"
fi
fi fi
# Check if php version already exists # Check if php version already exists
if [ -f "$php_fpm" ] && [ -f "$HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl" ]; then if [ -f "$php_fpm" ] && [ -f "$HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl" ]; then
echo "ERROR: Specified PHP version is already installed." echo "ERROR: Specified PHP version is already installed."
@@ -77,48 +72,48 @@ check_hestia_demo_mode
#----------------------------------------------------------# #----------------------------------------------------------#
# Action # # Action #
#----------------------------------------------------------# #----------------------------------------------------------#
mph=""
php_modules_install="mysqlnd mysqli pdo_mysql pgsql pdo sqlite pdo_sqlite pdo_pgsql imap ldap zip opcache xmlwriter xmlreader gd intl pspell"
php_modules_disable=""
if [ "$LOCAL_PHP" == "yes" ]; then
mph="brepo-php$version brepo-php$version-fpm"
if ! echo "$DB_SYSTEM" | grep -w 'pgsql' > /dev/null; then
php_modules_install=$(echo "$php_modules_install" | sed -e "s/pgsql//")
php_modules_install=$(echo "$php_modules_install" | sed -e "s/pdo_pgsql//")
php_modules_disable="$php_modules_disable pgsql pdo_pgsql"
fi
else
# Packages in Remi repo have names with php$version-php- prefixes
mph="php$version-php-fpm php$version-php-cgi php$version-php-mysqlnd php$version-php-pgsql
php$version-php-pdo php$version-php-common php$version-php-pecl-imagick php$version-php-imap
php$version-php-ldap php$version-php-pecl-apcu php$version-php-pecl-zip php$version-php-cli
php$version-php-opcache php$version-php-xml php$version-php-gd php$version-php-intl
php$version-php-mbstring php$version-php-pspell php$version-php-readline"
if [ "$version" = "56" ]; then
mph=$(sed -e "s/php$version-php-pecl-apcu//")
fi
mph="php$version-common php$version-mbstring php$version-bcmath php$version-cli php$version-curl # Check is version is 7.1 or below to add mcrypt
php$version-fpm php$version-gd php$version-intl php$version-mysql if [[ $(echo "$version 7.2" | awk '{print ($1 < $2)}') == 1 ]]; then
php$version-soap php$version-xml php$version-zip php$version-json php$version-bz2 mph="$mph php$version-mcrypt"
php$version-pspell php$version-imagick php$version-pgsql php$version-imap php$version-ldap" fi
if [ -f /etc/redhat-release ]; then
# Packages in Remi repo have names with php$version-php- prefixes
mph="php$version-php-fpm php$version-php-cgi php$version-php-mysqlnd php$version-php-pgsql
php$version-php-pdo php$version-php-common php$version-php-pecl-imagick php$version-php-imap
php$version-php-ldap php$version-php-pecl-apcu php$version-php-pecl-zip php$version-php-cli
php$version-php-opcache php$version-php-xml php$version-php-gd php$version-php-intl
php$version-php-mbstring php$version-php-pspell php$version-php-readline"
if [ "$version" = "56" ]; then
mph=$(sed -e "s/php$version-php-pecl-apcu//")
fi
fi
# Check is version is 7.1 or below to add mcrypt # Check if version is 8.0 or higher and drop php json.
if [[ $(echo "$version 7.2" | awk '{print ($1 < $2)}') == 1 ]]; then if [[ ${version:0:1} == "8" ]]; then
mph="$mph php$version-mcrypt" mph=$(echo "$mph" | sed -e "s/php$version\(-php\)\{0,1\}-json//")
fi fi
# Check if version is 8.0 or higher and drop php json. if ! echo "$DB_SYSTEM" | grep -w 'mysql' > /dev/null; then
if [[ ${version:0:1} == "8" ]]; then mph=$(echo "$mph" | sed -e "s/php$version\(-php\)\{0,1\}-mysql//")
mph=$(echo "$mph" | sed -e "s/php$version\(-php\)\{0,1\}-json//") fi
fi
if ! echo "$DB_SYSTEM" | grep -w 'mysql' > /dev/null; then if ! echo "$DB_SYSTEM" | grep -w 'pgsql' > /dev/null; then
mph=$(echo "$mph" | sed -e "s/php$version\(-php\)\{0,1\}-mysql//") mph=$(echo "$mph" | sed -e "s/php$version\(-php\)\{0,1\}-pgsql//")
fi fi
if ! echo "$DB_SYSTEM" | grep -w 'pgsql' > /dev/null; then
mph=$(echo "$mph" | sed -e "s/php$version\(-php\)\{0,1\}-pgsql//")
fi fi
# Install php packages # Install php packages
if [ -f '/etc/redhat-release' ]; then dnf install -q -y $mph > /dev/null 2>&1 &
dnf install -q -y $mph > /dev/null 2>&1 &
else
apt-get -qq update
apt-get -y -qq -o Dpkg::Options::="--force-confold" install $mph > /dev/null 2>&1 &
fi
BACK_PID=$! BACK_PID=$!
# Check if package installation is done, print a spinner # Check if package installation is done, print a spinner
@@ -133,17 +128,27 @@ done
# Do a blank echo to get the \n back # Do a blank echo to get the \n back
echo echo
if [ "$LOCAL_PHP" == "yes" ]; then
for mod in $php_modules_install; do
fn_enable_local_php_extension "$version" "$mod"
done
for mod in $php_modules_disable; do
fn_disable_local_php_extension "$version" "$mod"
done
fi
# Check if installation was successful # Check if installation was successful
if [ ! -f "$php_fpm" ]; then if [ ! -f "$php_fpm" ]; then
echo "ERROR: Installation failed, please run the following command manually for debugging:" echo "ERROR: Installation failed, please run the following command manually for debugging:"
if [ -f '/etc/redhat-release' ]; then echo "dnf install $mph"
echo "dnf install $mph"
else
echo "apt-get install $mph"
fi
fi fi
if [ -f '/etc/redhat-release' ]; then if [ "$LOCAL_PHP" == "yes" ]; then
result_alt_php=$(alternatives --display php | grep /opt/brepo/php${version}/bin/php)
if [ -z "$result_alt_php" ]; then
alternatives --install /usr/bin/php php /opt/brepo/php${version}/bin/php 1 > /dev/null 2>&1
fi
else
result_alt_php=$(alternatives --display php | grep /usr/bin/php$version) result_alt_php=$(alternatives --display php | grep /usr/bin/php$version)
if [ -z "$result_alt_php" ]; then if [ -z "$result_alt_php" ]; then
alternatives --install /usr/bin/php php /usr/bin/php$version 1 > /dev/null 2>&1 alternatives --install /usr/bin/php php /usr/bin/php$version 1 > /dev/null 2>&1
@@ -151,29 +156,31 @@ if [ -f '/etc/redhat-release' ]; then
fi fi
# Check if required modules for apache2 are enabled # Check if required modules for apache2 are enabled
if [ "$WEB_SYSTEM" = "apache2" ]; then if [ "$WEB_SYSTEM" = "httpd" ]; then
if [ -f /etc/redhat-release ]; then if ! httpd -M | grep 'proxy_fcgi_module' ; then
if ! httpd -M | grep 'proxy_fcgi_module' ; then sed 's/#LoadModule proxy_fcgi_module/LoadModule proxy_fcgi_module/' -i /etc/httpd/conf.modules.d/00-proxy.conf
sed 's/#LoadModule proxy_fcgi_module/LoadModule proxy_fcgi_module/' -i /etc/httpd/conf.modules.d/00-proxy.conf sed 's/#LoadModule proxy_module/LoadModule proxy_module/' -i /etc/httpd/conf.modules.d/00-proxy.conf
sed 's/#LoadModule proxy_module/LoadModule proxy_module/' -i /etc/httpd/conf.modules.d/00-proxy.conf
fi
if ! httpd -M | grep 'setenvif_module' ; then
sed 's/#LoadModule setenvif_module/LoadModule setenvif_module/' -i /etc/httpd/conf.modules.d/00-base.conf
fi
else
if ! a2query -q -m proxy_fcgi; then
a2enmod -q proxy_fcgi
fi
if ! a2query -q -m setenvif; then
a2enmod -q setenvif
fi
fi fi
if ! httpd -M | grep 'setenvif_module' ; then
sed 's/#LoadModule setenvif_module/LoadModule setenvif_module/' -i /etc/httpd/conf.modules.d/00-base.conf
fi
$BIN/v-restart-web "yes" $BIN/v-restart-web "yes"
fi fi
# Configure fpm # Configure fpm
v_tpl=${version//./} v_tpl=${version//./}
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
systemctl enable brepo-php-fpm${version}.service
rm -f /opt/brepo/php${version}/etc/php-fpm.d/*
cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /opt/brepo/php${version}/etc/php-fpm.d/
sed -i "s/9999/99$v_tpl/g" /opt/brepo/php${version}/etc/php-fpm.d/dummy.conf
# Increase max upload and max post size
sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 100M/g" /opt/brepo/php${version}/etc/php.ini
sed -i "s/post_max_size = 8M/post_max_size = 100M/g" /opt/brepo/php${version}/etc/php.ini
sed -i "s/max_execution_time = 30/max_execution_time = 60/g" /opt/brepo/php${version}/etc/php.ini
else
systemctl enable php${version}-php-fpm systemctl enable php${version}-php-fpm
rm -f /etc/opt/remi/php${version}/php-fpm.d/* rm -f /etc/opt/remi/php${version}/php-fpm.d/*
cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/opt/remi/php${version}/php-fpm.d/ cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/opt/remi/php${version}/php-fpm.d/
@@ -183,19 +190,8 @@ if [ -f /etc/redhat-release ]; then
sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 100M/g" /etc/opt/remi/php${version}/php.ini sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 100M/g" /etc/opt/remi/php${version}/php.ini
sed -i "s/post_max_size = 8M/post_max_size = 100M/g" /etc/opt/remi/php${version}/php.ini sed -i "s/post_max_size = 8M/post_max_size = 100M/g" /etc/opt/remi/php${version}/php.ini
sed -i "s/max_execution_time = 30/max_execution_time = 60/g" /etc/opt/remi/php${version}/php.ini sed -i "s/max_execution_time = 30/max_execution_time = 60/g" /etc/opt/remi/php${version}/php.ini
else
update-rc.d php$version-fpm defaults > /dev/null 2>&1
rm -f /etc/php/$version/fpm/pool.d/*
cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/php/$version/fpm/pool.d/
sed -i "s/9999/99$v_tpl/g" /etc/php/$version/fpm/pool.d/dummy.conf
cp -f $HESTIA_INSTALL_DIR/php-fpm/php-fpm.conf /etc/php/$version/fpm/
sed -i "s/fpm_v/$version/g" /etc/php/$version/fpm/php-fpm.conf
# Increase max upload and max post size
sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 100M/g" /etc/php/$version/fpm/php.ini
sed -i "s/post_max_size = 8M/post_max_size = 100M/g" /etc/php/$version/fpm/php.ini
sed -i "s/max_execution_time = 30/max_execution_time = 60/g" /etc/php/$version/fpm/php.ini
fi fi
# Install backend template # Install backend template
cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl \ cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl \
$HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl $HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/bash
# info: change hostname # info: change hostname
# options: HOSTNAME # options: HOSTNAME
# #
@@ -37,18 +37,20 @@ check_hestia_demo_mode
hostname "$domain" hostname "$domain"
if [ -d "/etc/sysconfig" ]; then if command -v hostnamectl >/dev/null 2>&1; then
# RHEL/CentOS/Amazon hostnamectl set-hostname "$domain"
touch /etc/sysconfig/network echo "$domain" > /etc/hostname
if [ -z "$(grep HOSTNAME /etc/sysconfig/network)" ]; then
echo "HOSTNAME='$domain'" >> /etc/sysconfig/network
else
sed -i "s/HOSTNAME=.*/HOSTNAME='$domain'/" /etc/sysconfig/network
fi
else else
# Debian/Ubuntu if [ -d "/etc/sysconfig" ]; then
hostnamectl set-hostname "$domain" touch /etc/sysconfig/network
echo "$domain" > /etc/hostname if [ -z "$(grep HOSTNAME /etc/sysconfig/network)" ]; then
echo "HOSTNAME='$domain'" >> /etc/sysconfig/network
else
sed -i "s/HOSTNAME=.*/HOSTNAME='$domain'/" /etc/sysconfig/network
fi
else
echo "$domain" > /etc/hostname
fi
fi fi
# Update Roundcube password plugin configuration # Update Roundcube password plugin configuration

View File

@@ -21,18 +21,10 @@ source_conf "$HESTIA/conf/hestia.conf"
check_args '1' "$#" 'VERSION' check_args '1' "$#" 'VERSION'
# Verify php version format # Verify php version format
if [ -f /etc/redhat-release ]; then if [[ ! $version =~ ^[0-9][0-9]+ ]]; then
if [[ ! $version =~ ^[0-9][0-9]+ ]]; then echo "The specified PHP version format is invalid, it should look like [0-9][0-9]."
echo "The specified PHP version format is invalid, it should look like [0-9][0-9]." echo "Example: 70, 74, 80"
echo "Example: 70, 74, 80" exit "$E_INVALID"
exit "$E_INVALID"
fi
else
if [[ ! $version =~ ^[0-9].[0-9]+ ]]; then
echo "The specified PHP version format is invalid, it should look like [0-9].[0-9]."
echo "Example: 7.0, 7.4, 8.0"
exit "$E_INVALID"
fi
fi fi
# Check if php version exists # Check if php version exists
@@ -50,18 +42,19 @@ check_hestia_demo_mode
#----------------------------------------------------------# #----------------------------------------------------------#
# Set file locations # Set file locations
if [ -f /etc/redhat-release ]; then php_fpm=""
php_fpm="/usr/lib/systemd/system/php$version-php-fpm.service" if [ "$LOCAL_PHP" == "yes" ]; then
php_fpm="/usr/lib/systemd/system/brepo-php-fpm$version.service"
else else
php_fpm="/etc/init.d/php$version-fpm" php_fpm="/usr/lib/systemd/system/php$version-php-fpm.service"
fi fi
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
rm -f /opt/brepo/php*/etc/php-fpm.d/www.conf
cp -f $HESTIA/install/rpm/php-fpm/www.conf /opt/brepo/php${version}/etc/php-fpm.d/www.conf
else
rm -f /etc/opt/remi/php*/php-fpm.d/www.conf rm -f /etc/opt/remi/php*/php-fpm.d/www.conf
cp -f $HESTIA/install/rpm/php-fpm/www.conf /etc/opt/remi/php$version/php-fpm.d/www.conf cp -f $HESTIA/install/rpm/php-fpm/www.conf /etc/opt/remi/php$version/php-fpm.d/www.conf
else
rm -f /etc/php/*/fpm/pool.d/www.conf
cp -f $HESTIA/install/deb/php-fpm/www.conf /etc/php/$version/fpm/pool.d/www.conf
fi fi
for user in $($BIN/v-list-sys-users plain); do for user in $($BIN/v-list-sys-users plain); do
@@ -75,17 +68,30 @@ $BIN/v-restart-web-backend
$BIN/v-restart-web $BIN/v-restart-web
$BIN/v-restart-proxy $BIN/v-restart-proxy
if [ -f '/etc/redhat-release' ]; then if [ "$LOCAL_PHP" == "yes" ]; then
result_alt_php=$(alternatives --display php | grep /opt/brepo/php${version}/bin/php)
if [ -z "$result_alt_php" ]; then
alternatives --install /usr/bin/php php /opt/brepo/php${version}/bin/php 1 > /dev/null 2>&1
fi
else
result_alt_php=$(alternatives --display php | grep /usr/bin/php$version) result_alt_php=$(alternatives --display php | grep /usr/bin/php$version)
if [ -z "$result_alt_php" ]; then if [ -z "$result_alt_php" ]; then
alternatives --install /usr/bin/php php /usr/bin/php$version 1 > /dev/null 2>&1 alternatives --install /usr/bin/php php /usr/bin/php$version 1 > /dev/null 2>&1
fi fi
fi fi
update-alternatives --set php /usr/bin/php$version if [ "$LOCAL_PHP" == "yes" ]; then
if [ $? -eq 0 ]; then update-alternatives --set php /opt/brepo/php${version}/bin/php
update-alternatives --install /usr/bin/php php /usr/bin/php$version 1 if [ $? -eq 0 ]; then
update-alternatives --install /usr/bin/php php /opt/brepo/php${version}/bin/php 1
update-alternatives --set php /opt/brepo/php${version}/bin/php
fi
else
update-alternatives --set php /usr/bin/php$version update-alternatives --set php /usr/bin/php$version
if [ $? -eq 0 ]; then
update-alternatives --install /usr/bin/php php /usr/bin/php$version 1
update-alternatives --set php /usr/bin/php$version
fi
fi fi
/usr/bin/hestiacp-php-admin system $version /usr/bin/hestiacp-php-admin system $version

View File

@@ -40,6 +40,28 @@ check_hestia_demo_mode
#----------------------------------------------------------# #----------------------------------------------------------#
# Action # # Action #
#----------------------------------------------------------# #----------------------------------------------------------#
php_v="82"
if [[ "$service" =~ ^php ]];then
ver_php=$(echo "$service" | grep -Po "\d+")
if [ -z "$ver_php" ]; then
php_v=$(get_system_default_php)
else
if [ "$LOCAL_PHP" == "yes" ]; then
if [ -e "/opt/brepo/php${ver_php}" ]; then
php_v="$ver_php"
else
php_v=$(get_system_default_php)
fi
else
if [ -e "/etc/opt/remi/php${ver_php}" ]; then
php_v="$ver_php"
else
php_v=$(get_system_default_php)
fi
fi
fi
service="php"
fi
# Defining dst config path # Defining dst config path
case $service in case $service in
@@ -50,7 +72,13 @@ case $service in
exim4) dst='/etc/exim4/exim4.conf.template' ;; exim4) dst='/etc/exim4/exim4.conf.template' ;;
vsftpd) dst=$(find /etc/vsftpd* -name 'vsftpd.conf') ;; vsftpd) dst=$(find /etc/vsftpd* -name 'vsftpd.conf') ;;
proftpd) dst=$(find /etc/proftpd* -name 'proftpd.conf') ;; proftpd) dst=$(find /etc/proftpd* -name 'proftpd.conf') ;;
php) dst=$(find /etc/php* -name php.ini) ;; php)
if [ "$LOCAL_PHP" == "yes" ]; then
dst=$(find /opt/brepo/php${php_v} -name php.ini)
else
dst=$(find /etc/opt/remi/php${php_v} -name php.ini)
fi
;;
mysql) dst=$(find /etc/my* -name my.cnf) ;; mysql) dst=$(find /etc/my* -name my.cnf) ;;
mysqld) dst=$(find /etc/my* -name my.cnf) ;; mysqld) dst=$(find /etc/my* -name my.cnf) ;;
mariadb) dst=$(find /etc/my* -name my.cnf) ;; mariadb) dst=$(find /etc/my* -name my.cnf) ;;
@@ -103,7 +131,7 @@ if [ "$update" = 'yes' ] && [ "$restart" != 'no' ]; then
if [ "$service" = 'php' ]; then if [ "$service" = 'php' ]; then
if [ "$(multiphp_count)" -gt 0 ]; then if [ "$(multiphp_count)" -gt 0 ]; then
service="php-fpm" service="php-fpm"
elif [ "$WEB_SYSTEM" = 'apache2' ]; then elif [ "$WEB_SYSTEM" = 'httpd' ]; then
service="$WEB_SYSTEM" service="$WEB_SYSTEM"
fi fi
fi fi

105
bin/v-default-domain Executable file
View File

@@ -0,0 +1,105 @@
#!/bin/bash
# info: add web/dns/mail domain
# options: USER DOMAIN COMMAND
#
# example: v-default-domain admin example.com set
# v-default-domain admin example.com delete
# v-default-domain admin example.com check
# v-default-domain admin example.com check-default
#
# This function set user's domain as default or reset it or get default domain or check is domain default.
#----------------------------------------------------------#
# Variables & Functions #
#----------------------------------------------------------#
# Argument definition
user=$1
domain=$2
command=$3
# Includes
# shellcheck source=/etc/hestiacp/hestia.conf
source /etc/hestiacp/hestia.conf
# shellcheck source=/usr/local/hestia/func/main.sh
source $HESTIA/func/main.sh
# load config file
source_conf "$HESTIA/conf/hestia.conf"
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'USER DOMAIN COMMAND'
is_format_valid 'user' 'domain'
if [ -n "$ip" ]; then
is_format_valid 'ip'
fi
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
# Perform verification if read-only mode is enabled
check_hestia_demo_mode
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
confd="conf.h.d"
if [[ $command == check* ]]; then
default_conf="/etc/httpd/$confd/domains/00000000000000000_default.conf"
if [ -e "$default_conf" ]; then
file_name=$(readlink -f "$default_conf")
s_username=$(echo "$file_name" | cut -d"/" -f3 )
s_domain=$(echo "$file_name" | rev | cut -d"/" -f2 | rev )
if [ "$command" == "check-default" ]; then
echo "$s_username:$s_domain"
else
if [ "$user" == "$s_username" ] && [ "$domain" == "$s_domain" ]; then
echo "true"
else
echo "false"
fi
fi
else
echo "no default domain"
fi
else
# Working on web domain
if [ -n "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" == "httpd" ]; then
domain_path="/etc/httpd/$confd/domains/$domain.conf"
domain_ssl_path="/etc/httpd/$confd/domains/$domain.ssl.conf"
if [ -e "$domain_ssl_path" ] || [ -e "$domain_path" ]; then
path_name="$domain_path"
if [ -e "$domain_ssl_path" ]; then
path_name="$domain_ssl_path"
fi
if [ "$command" == "delete" ]; then
if [ -e "/etc/httpd/$confd/domains/00000000000000000_default.conf" ]; then
mv -f "/etc/httpd/$confd/domains/00000000000000000_default.conf" "/etc/httpd/$confd/domains/00000000000000000_default.conf.trash"
fi
else
ln -sf "${path_name}" "/etc/httpd/$confd/domains/00000000000000000_default.conf"
fi
echo "true"
else
echo "false"
fi
fi
# Restarting services
$BIN/v-restart-web "yes"
check_result $? "can't restart web" > /dev/null
$BIN/v-restart-proxy "yes"
check_result $? "can't restart proxy" > /dev/null
$BIN/v-restart-dns "yes"
check_result $? "can't restart dns" > /dev/null
fi
#----------------------------------------------------------#
# Hestia #
#----------------------------------------------------------#
exit

View File

@@ -30,32 +30,54 @@ check_hestia_demo_mode
#----------------------------------------------------------# #----------------------------------------------------------#
# Deleting group and user quota on /home partition # Deleting group and user quota on /home partition
file_system=$(df -T /home | tail -n1 | awk '{print $2}')
mnt=$(df -P /home | awk '{print $6}' | tail -n1) mnt=$(df -P /home | awk '{print $6}' | tail -n1)
lnr=$(cat -n /etc/fstab | awk '{print $1,$3}' | grep "$mnt$" | cut -f 1 -d ' ') lnr=$(cat -n /etc/fstab | awk '{print $1,$3}' | grep "$mnt$" | cut -f 1 -d ' ')
opt=$(sed -n ${lnr}p /etc/fstab | awk '{print $4}') opt=$(sed -n ${lnr}p /etc/fstab | awk '{print $4}')
fnd='usrquota\|grpquota\|usrjquota=\|grpjquota=\|jqfmt=' if [ "$file_system" == "xfs" ]; then
if [ -n "$(echo $opt | grep $fnd)" ]; then fnd='usrquota\|grpquota'
rep=$(echo $(echo $opt | tr ',' '\n' | grep -v $fnd) | tr ' ' ',') if [ -n "$(echo $opt | grep $fnd)" ]; then
sed -i "$lnr s/$opt/$rep/" /etc/fstab rep=$(echo $(echo $opt | tr ',' '\n' | grep -v $fnd) | tr ' ' ',')
mount -o remount "$mnt" sed -i "$lnr s/$opt/$rep/" /etc/fstab
fi mount -o remount "$mnt"
# Disabling group and user quota
quotaoff=$(which --skip-alias --skip-functions quotaoff 2> /dev/null)
if [ $? -eq 0 ]; then
if [ -n "$(quotaon -pa | grep " $mnt " | grep 'user\|group' | grep 'is on')" ]; then
$quotaoff $mnt
fi fi
if [ "$mnt" == "/" ]; then
check_args=$(grubby --info=`grubby --default-kernel` | grep -oP "rootflags=[^\"]*" | head -n1)
if [ "$check_args" != "rootflags=uquota,pquota" ]; then
RED='\033[0;31m'
NC='\033[0m'
YELLOW='\033[1;33m'
printf "${RED}!!!!!!!Delete uquota,pquota from grub!!!!!!!${NC}\n"
echo "${YELLOW}Delete manualy 'uquota,pquota' and reboot the system${NC}\n"
else
grubby --remove-args="rootflags=uquota,pquota" --update-kernel=ALL
fi
fi
else
fnd='usrquota\|grpquota\|usrjquota=\|grpjquota=\|jqfmt='
if [ -n "$(echo $opt | grep $fnd)" ]; then
rep=$(echo $(echo $opt | tr ',' '\n' | grep -v $fnd) | tr ' ' ',')
sed -i "$lnr s/$opt/$rep/" /etc/fstab
mount -o remount "$mnt"
fi
# Disabling group and user quota
quotaoff=$(which --skip-alias --skip-functions quotaoff 2> /dev/null)
if [ $? -eq 0 ]; then
if [ -n "$(quotaon -pa | grep " $mnt " | grep 'user\|group' | grep 'is on')" ]; then
$quotaoff $mnt
fi
fi
# Deleting v1 + v2 group and user quota index
for idx in $(echo 'quota.user quota.group aquota.user aquota.group'); do
[ -e "$mnt/$idx" ] && rm -f "$mnt/$idx"
done
# Deleting cron job
rm -f /etc/cron.daily/quotacheck
fi fi
# Deleting v1 + v2 group and user quota index
for idx in $(echo 'quota.user quota.group aquota.user aquota.group'); do
[ -e "$mnt/$idx" ] && rm -f "$mnt/$idx"
done
# Deleting cron job
rm -f /etc/cron.daily/quotacheck
# Updating hestia.conf value # Updating hestia.conf value
if [ -z "$(grep DISK_QUOTA $HESTIA/conf/hestia.conf)" ]; then if [ -z "$(grep DISK_QUOTA $HESTIA/conf/hestia.conf)" ]; then
echo "DISK_QUOTA='no'" >> $HESTIA/conf/hestia.conf echo "DISK_QUOTA='no'" >> $HESTIA/conf/hestia.conf

View File

@@ -52,11 +52,13 @@ get_domain_values 'web'
BACKEND="$template" BACKEND="$template"
# Defining pool directory # Defining pool directory
if [ -f "/etc/redhat-release" ]; then pool=""
pool=$(find -L /etc/opt/remi/ -name "$domain.conf" -exec dirname {} \;) if [ "$LOCAL_PHP" == "yes" ]; then
pool=$(find -L /opt/brepo/ -name "$domain.conf" -exec dirname {} \;)
else else
pool=$(find -L /etc/php/ -name "$domain.conf" -exec dirname {} \;) pool=$(find -L /etc/opt/remi/ -name "$domain.conf" -exec dirname {} \;)
fi fi
if [ ! -e "$pool" ]; then if [ ! -e "$pool" ]; then
check_result "$E_NOTEXIST" "php-fpm pool doesn't exist" check_result "$E_NOTEXIST" "php-fpm pool doesn't exist"
fi fi

View File

@@ -32,27 +32,21 @@ if [ -z "$WEB_BACKEND" ]; then
fi fi
# Set file locations # Set file locations
if [ -f /etc/redhat-release ]; then php_fpm=""
php_fpm="/usr/lib/systemd/system/php$version-php-fpm.service" if [ "$LOCAL_PHP" == "yes" ]; then
php_fpm="/usr/lib/systemd/system/brepo-php-fpm$version.service"
else else
php_fpm="/etc/init.d/php$version-fpm" php_fpm="/usr/lib/systemd/system/php$version-php-fpm.service"
fi fi
# Verify php version format # Verify php version format
if [ -f /etc/redhat-release ]; then if [[ ! $version =~ ^[0-9][0-9]+ ]]; then
if [[ ! $version =~ ^[0-9][0-9]+ ]]; then echo "The PHP version format is invalid, it should look like [0-9][0-9]."
echo "The PHP version format is invalid, it should look like [0-9][0-9]." echo "Example: 70, 74, 80"
echo "Example: 70, 74, 80" exit "$E_INVALID"
exit "$E_INVALID"
fi
else
if [[ ! $version =~ ^[0-9].[0-9]+ ]]; then
echo "The PHP version format is invalid, it should look like [0-9].[0-9]."
echo "Example: 7.0, 7.4, 8.0"
exit "$E_INVALID"
fi
fi fi
# Remove backend template # Remove backend template
[ -f $HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl ] && rm -f $HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl [ -f $HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl ] && rm -f $HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl
@@ -70,38 +64,33 @@ check_hestia_demo_mode
# Action # # Action #
#----------------------------------------------------------# #----------------------------------------------------------#
mph="php$version-common php$version-mbstring php$version-bcmath php$version-cli php$version-curl mph=""
php$version-fpm php$version-gd php$version-intl php$version-mysql if [ "$LOCAL_PHP" == "yes" ]; then
php$version-soap php$version-xml php$version-zip php$version-mbstring mph="brepo-php$version brepo-php$version-fpm"
php$version-json php$version-bz2 php$version-pspell php$version-imagick php$version-pgsql
php$version-imap php$version-ldap"
if [ -f /etc/redhat-release ]; then
# Packages in Remi repo have names with php$version-php- prefixes
mph="php$version-php-fpm php$version-php-cgi php$version-php-mysqlnd php$version-php-pgsql
php$version-php-pdo php$version-php-common php$version-php-pecl-imagick php$version-php-imap
php$version-php-ldap php$version-php-pecl-apcu php$version-php-pecl-zip php$version-php-cli
php$version-php-opcache php$version-php-xml php$version-php-gd php$version-php-intl
php$version-php-mbstring php$version-php-pspell php$version-php-readline"
fi
# Check is version is 7.1 or below to add mcrypt
if [ -f /etc/redhat-release ]; then
if [[ $(echo "$version 72" | awk '{print ($1 < $2)}') == 1 ]]; then
mph="$mph php$version-php-mcrypt"
fi
else else
if [[ $(echo "$version 7.2" | awk '{print ($1 < $2)}') == 1 ]]; then mph="php$version-common php$version-mbstring php$version-bcmath php$version-cli php$version-curl
mph="$mph php$version-mcrypt" php$version-fpm php$version-gd php$version-intl php$version-mysql
fi php$version-soap php$version-xml php$version-zip php$version-mbstring
php$version-json php$version-bz2 php$version-pspell php$version-imagick php$version-pgsql
php$version-imap php$version-ldap"
# Packages in Remi repo have names with php$version-php- prefixes
mph="php$version-php-fpm php$version-php-cgi php$version-php-mysqlnd php$version-php-pgsql
php$version-php-pdo php$version-php-common php$version-php-pecl-imagick php$version-php-imap
php$version-php-ldap php$version-php-pecl-apcu php$version-php-pecl-zip php$version-php-cli
php$version-php-opcache php$version-php-xml php$version-php-gd php$version-php-intl
php$version-php-mbstring php$version-php-pspell php$version-php-readline"
# Check is version is 7.1 or below to add mcrypt
if [[ $(echo "$version 72" | awk '{print ($1 < $2)}') == 1 ]]; then
mph="$mph php$version-php-mcrypt"
fi
fi fi
# Purge php packages # Purge php packages
if [ -f '/etc/redhat-release' ]; then dnf remove -y $mph > /dev/null 2>&1 &
dnf remove -y $mph > /dev/null 2>&1 &
else
apt-get -y purge $mph > /dev/null 2>&1 &
fi
BACK_PID=$! BACK_PID=$!
# Check if package removal is done, print a spinner # Check if package removal is done, print a spinner
@@ -119,40 +108,36 @@ echo
# Check if installation was successfully # Check if installation was successfully
if [ -f "$php_fpm" ]; then if [ -f "$php_fpm" ]; then
echo "ERROR: Uninstallation failed, please run the following command manually for debugging:" echo "ERROR: Uninstallation failed, please run the following command manually for debugging:"
if [ -f '/etc/redhat-release' ]; then echo "dnf remove $mph"
echo "dnf remove $mph"
else
echo "apt-get purge $mph"
fi
exit 1 exit 1
fi fi
# Cleanup php folder # Cleanup php folder
if [ -f '/etc/redhat-release' ]; then if [ "$LOCAL_PHP" == "yes" ]; then
[[ -d /etc/opt/remi/php$version ]] && rm -rf "/etc/opt/remi/php$version" [[ -d /opt/brepo/php$version ]] && rm -rf "/opt/brepo/php$version"
else else
[[ -d /etc/php/$version ]] && rm -rf "/etc/php/$version" [[ -d /etc/opt/remi/php$version ]] && rm -rf "/etc/opt/remi/php$version"
fi fi
if [ -f '/etc/redhat-release' ]; then if [ "$LOCAL_PHP" == "yes" ]; then
if [ "$WEB_BACKEND" = "php-fpm" ]; then
conf=$(find /opt/brepo/php* -name www.conf)
# Check if www.conf exists
if [ -z "$conf" ]; then
# If not grab the "last php version
last=$($BIN/v-list-sys-php "shell" | tail -n1)
cp -f $HESTIA/install/rpm/php-fpm/www.conf /opt/brepo/php$last/etc/php-fpm.d/www.conf
$BIN/v-restart-web-backend
fi
fi
else
if [ "$WEB_BACKEND" = "php-fpm" ]; then if [ "$WEB_BACKEND" = "php-fpm" ]; then
conf=$(find /etc/opt/remi/php* -name www.conf) conf=$(find /etc/opt/remi/php* -name www.conf)
# Check if www.conf exists # Check if www.conf exists
if [ -z "$conf" ]; then if [ -z "$conf" ]; then
# If not grab the "last php version # If not grab the "last php version
last=$($BIN/v-list-sys-php "shell" | tail -n1) last=$($BIN/v-list-sys-php "shell" | tail -n1)
cp -f $HESTIA/install/rpm/php-fpm/www.conf /etc/opt/remi/php$version/php-fpm.d/www.conf cp -f $HESTIA/install/rpm/php-fpm/www.conf /etc/opt/remi/php$last/php-fpm.d/www.conf
$BIN/v-restart-web-backend
fi
fi
else
if [ "$WEB_BACKEND" = "php-fpm" ]; then
conf=$(find /etc/php* -name www.conf)
# Check if www.conf exists
if [ -z "$conf" ]; then
# If not grab the "last php version
last=$($BIN/v-list-sys-php "shell" | tail -n1)
cp -f $HESTIA/install/deb/php-fpm/www.conf /etc/php/$last/fpm/pool.d/www.conf
$BIN/v-restart-web-backend $BIN/v-restart-web-backend
fi fi
fi fi

View File

@@ -2,7 +2,7 @@
# info: action with extended modules # info: action with extended modules
# options: MODULE_ID [MODULE_RELATED_COMMNDS] # options: MODULE_ID [MODULE_RELATED_COMMNDS]
# #
# example: v-ext-modules list json # example: v-ext-modules passenger_manager list json
# #
# This function enables and disables additional modules # This function enables and disables additional modules

View File

@@ -36,7 +36,8 @@ json_list() {
"METHOD": "'$method'", "METHOD": "'$method'",
"SALT": "'$salt'", "SALT": "'$salt'",
"TIME": "'$time'", "TIME": "'$time'",
"DATE": "'$date'" "DATE": "'$date'",
"ROUND":"'$round'"
}' }'
echo '}' echo '}'
} }
@@ -45,17 +46,18 @@ json_list() {
shell_list() { shell_list() {
echo "METHOD: $method" echo "METHOD: $method"
echo "SALT: $salt" echo "SALT: $salt"
echo "ROUND: $round"
} }
# PLAIN list function # PLAIN list function
plain_list() { plain_list() {
echo -e "$method\t$salt" echo -e "$method\t$salt\t$round"
} }
# CSV list function # CSV list function
csv_list() { csv_list() {
echo "METHOD,SALT" echo "METHOD,SALT,ROUND"
echo "$method, $salt" echo "$method, $salt, $round"
} }
#----------------------------------------------------------# #----------------------------------------------------------#
@@ -81,6 +83,11 @@ shadow=$(grep "^$user:" /etc/shadow | cut -f 2 -d :)
if echo "$shadow" | grep -qE '^\$[0-9a-z]+\$[^\$]+\$'; then if echo "$shadow" | grep -qE '^\$[0-9a-z]+\$[^\$]+\$'; then
salt=$(echo "$shadow" | cut -f 3 -d \$) salt=$(echo "$shadow" | cut -f 3 -d \$)
round=""
if [[ "$salt" =~ ^rounds= ]]; then
round=$salt
salt=$(echo "$shadow" | cut -f 4 -d \$)
fi
method=$(echo "$shadow" | cut -f 2 -d \$) method=$(echo "$shadow" | cut -f 2 -d \$)
if [ "$method" = "y" ]; then if [ "$method" = "y" ]; then
method='yescrypt' method='yescrypt'

View File

@@ -67,14 +67,14 @@ csv_list() {
declare -a versions declare -a versions
# List through /etc/php # List through /etc/php
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
for version in /etc/opt/remi/php*/php-fpm.d/www.conf; do for version in /opt/brepo/php*/etc/php-fpm.d/www.conf; do
ver=$(echo "$version" | awk -F"/" '{ print $5 }' | sed "s/php\([[:digit:]]\+\)/\1/g") ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed "s/php\([[:digit:]]\+\)/\1/g")
versions+=("$ver") versions+=("$ver")
done done
else else
for version in /etc/php/*/fpm/pool.d/www.conf; do for version in /etc/opt/remi/php*/php-fpm.d/www.conf; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }') ver=$(echo "$version" | awk -F"/" '{ print $5 }' | sed "s/php\([[:digit:]]\+\)/\1/g")
versions+=("$ver") versions+=("$ver")
done done
fi fi

View File

@@ -67,21 +67,29 @@ csv_list() {
declare -a versions declare -a versions
# List through /etc/php # List through /etc/php
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
for version in /etc/opt/remi/php*/; do if [ -n "$WEB_BACKEND" ]; then
ver=$(echo "$version" | awk -F"/" '{ print $5 }' | sed 's|php||') for version in /opt/brepo/php*/; do
versions+=("$ver") ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed 's|php||')
done
else
if [ -n "$WEB_BACKEND" ]; then
for version in /etc/php/*/fpm; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }')
versions+=("$ver") versions+=("$ver")
done done
else else
# Fix for modphp # Fix for modphp
for version in /etc/php/*/cli; do for version in /opt/brepo/php*/bin/php; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }') ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed 's|php||')
versions+=("$ver")
done
fi
else
if [ -n "$WEB_BACKEND" ]; then
for version in /etc/opt/remi/php*/; do
ver=$(echo "$version" | awk -F"/" '{ print $5 }' | sed 's|php||')
versions+=("$ver")
done
else
# Fix for modphp
for version in /opt/remi/php*/root/bin/php; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed 's|php||')
versions+=("$ver") versions+=("$ver")
done done
fi fi

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# info: list php config parameters # info: list php config parameters
# options: [FORMAT] # options: [VERSION] [FORMAT]
# #
# example: v-list-sys-php-config # example: v-list-sys-php-config
# #
@@ -11,7 +11,8 @@
#----------------------------------------------------------# #----------------------------------------------------------#
# Argument definition # Argument definition
format=${1-shell} php_ver=${1-default}
format=${2-shell}
# Includes # Includes
# shellcheck source=/etc/hestiacp/hestia.conf # shellcheck source=/etc/hestiacp/hestia.conf
@@ -61,24 +62,53 @@ csv_list() {
#----------------------------------------------------------# #----------------------------------------------------------#
# Action # # Action #
#----------------------------------------------------------# #----------------------------------------------------------#
declare -a versions
if [ "$php_ver" == "default" ]; then
# List through /etc/php
if [ "$LOCAL_PHP" == "yes" ]; then
for version in /opt/brepo/php*/etc/php-fpm.d/www.conf; do
ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed "s/php\([[:digit:]]\+\)/\1/g")
if [ "$ver" != "php*" ]; then
versions+=("$ver")
fi
done
else
for version in /etc/opt/remi/php*/php-fpm.d/www.conf; do
ver=$(echo "$version" | awk -F"/" '{ print $5 }' | sed "s/php\([[:digit:]]\+\)/\1/g")
if [ "$ver" != "php*" ]; then
versions+=("$ver")
fi
done
fi
else
ver=$(echo "$php_ver" | sed "s/php\([[:digit:]]\+\)/\1/g")
versions+=("$ver")
fi
if [ ${#versions[@]} -eq 0 ]; then
php_ver="82"
else
php_ver="${versions[0]}"
fi
# Defining config path # Defining config path
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
config_path=$(find /etc/opt/remi/php* -name php.ini) config_path=$(find /opt/brepo/php${php_ver}/* -name php.ini)
else else
config_path=$(find /etc/php* -name php.ini) config_path=$(find /etc/opt/remi/php${php_ver}/* -name php.ini)
fi fi
config_count=$(echo "$config_path" | wc -l) config_count=$(echo "$config_path" | wc -l)
if [ "$config_count" -gt 1 ]; then if [ "$config_count" -gt 1 ]; then
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
multiphp_versions=$(ls -d /etc/opt/remi/php*/php-fpm.d 2> /dev/null | wc -l) multiphp_versions=$(ls -d /opt/brepo/php*/etc/php-fpm.d 2> /dev/null | wc -l)
else else
multiphp_versions=$(ls -d /etc/php/*/fpm/pool.d 2> /dev/null | wc -l) multiphp_versions=$(ls -d /etc/opt/remi/php*/php-fpm.d 2> /dev/null | wc -l)
fi fi
if [ "$WEB_BACKEND" = 'php-fpm' ] || [ "$multiphp_versions" -gt 0 ]; then if [ "$WEB_BACKEND" = 'php-fpm' ] || [ "$multiphp_versions" -gt 0 ]; then
config_path=$(echo "$config_path" | grep fpm) config_path=$(echo "$config_path" | grep "php")
else else
config_path=$(echo "$config_path" | grep apache) config_path=$(echo "$config_path" | grep httpd)
fi fi
fi fi
@@ -88,7 +118,7 @@ keys="$keys |upload_max_filesize |post_max_size"
keys="$keys |display_errors |error_reporting " keys="$keys |display_errors |error_reporting "
# Reading config # Reading config
config=$(cat $config_path | grep -v "^;") config=$(cat "$config_path" | grep -v "^;")
# Listing data # Listing data
case $format in case $format in

View File

@@ -34,7 +34,8 @@ json_list() {
"STATE": "'$STATE'", "STATE": "'$STATE'",
"CPU": "'$CPU'", "CPU": "'$CPU'",
"MEM": "'$MEM'", "MEM": "'$MEM'",
"RTIME": "'$RTIME'" "RTIME": "'$RTIME'",
"PMEM": "'$PHM'"
}' }'
if [ "$i" -lt "$objects" ]; then if [ "$i" -lt "$objects" ]; then
echo ',' echo ','
@@ -49,11 +50,11 @@ json_list() {
# SHELL list function # SHELL list function
shell_list() { shell_list() {
IFS=$'\n' IFS=$'\n'
echo "NAME STATE CPU MEM UPTIME" echo "NAME STATE CPU MEM UPTIME PMEM"
echo "---- ----- --- --- ------" echo "---- ----- --- --- ------ ----"
while read str; do while read str; do
parse_object_kv_list "$str" parse_object_kv_list "$str"
echo "$NAME $STATE $CPU $MEM $RTIME" echo "$NAME $STATE $CPU $MEM $RTIME $PHM"
done < <(echo -e "$data" | grep NAME) done < <(echo -e "$data" | grep NAME)
} }
@@ -62,17 +63,17 @@ plain_list() {
IFS=$'\n' IFS=$'\n'
while read str; do while read str; do
parse_object_kv_list "$str" parse_object_kv_list "$str"
echo -e "$NAME\t$SYSTEM\t$STATE\t$CPU\t$MEM\t$RTIME" echo -e "$NAME\t$SYSTEM\t$STATE\t$CPU\t$MEM\t$RTIME\t$PHM"
done < <(echo -e "$data" | grep NAME) done < <(echo -e "$data" | grep NAME)
} }
# CSV list function # CSV list function
csv_list() { csv_list() {
IFS=$'\n' IFS=$'\n'
echo "NAME,SYSTEM,STATE,CPU,MEM,RTIME" echo "NAME,SYSTEM,STATE,CPU,MEM,RTIME,PMEM"
while read str; do while read str; do
parse_object_kv_list "$str" parse_object_kv_list "$str"
echo "$NAME,\"$SYSTEM\",$STATE,$CPU,$MEM,$RTIME" echo "$NAME,\"$SYSTEM\",$STATE,$CPU,$MEM,$RTIME,$PHM"
done < <(echo -e "$data" | grep NAME) done < <(echo -e "$data" | grep NAME)
} }
@@ -84,14 +85,19 @@ get_srv_state() {
mem=0 mem=0
cpu=0 cpu=0
rtime="0" rtime="0"
pmem=0
# Searching related pids # Searching related pids
if [ -f /etc/redhat-release ] && [ "$name" = "php-fpm" ]; then if [ "$name" = "php-fpm" ]; then
pids='' pids=''
for php_pid in $(pidof php-fpm); do for php_pid in $(pidof php-fpm); do
process_info=$(ps -p "$php_pid" -o args | tail -n1 | grep "$srv") process_info=$(ps -p "$php_pid" -o args | tail -n1 | grep "$srv")
if [ -n "$process_info" ]; then if [ -n "$process_info" ]; then
pids="${pids}|${php_pid}" if [ -z "$pids" ];then
pids="${php_pid}"
else
pids="${pids}|${php_pid}"
fi
fi fi
done done
else else
@@ -123,6 +129,9 @@ get_srv_state() {
mem=$(echo "$pids" | awk '{sum += $3} END {print sum/1024 }') mem=$(echo "$pids" | awk '{sum += $3} END {print sum/1024 }')
mem=$(echo "${mem%%.*}") mem=$(echo "${mem%%.*}")
pmem=$(echo "$pids" | awk '{sum += $4} END {print sum/1024 }')
pmem=$(echo "${pmem%%.*}")
# Searching pid file # Searching pid file
pid_file='' pid_file=''
if [ -e "/run/$srv.pid" ]; then if [ -e "/run/$srv.pid" ]; then
@@ -151,6 +160,7 @@ get_srv_state() {
mem=0 mem=0
cpu=0 cpu=0
rtime="0" rtime="0"
pmem=0
fi fi
} }
@@ -160,7 +170,7 @@ get_srv_state() {
# Saving current proccess list # Saving current proccess list
tmp_file=$(mktemp) tmp_file=$(mktemp)
ps -eo pid,pcpu,size > $tmp_file ps -eo pid,pcpu,size,rss > $tmp_file
# Checking current time # Checking current time
ctime=$(date +%s) ctime=$(date +%s)
@@ -169,28 +179,28 @@ ctime=$(date +%s)
if [ -n "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'remote' ]; then if [ -n "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'remote' ]; then
get_srv_state $WEB_SYSTEM get_srv_state $WEB_SYSTEM
data="NAME='$WEB_SYSTEM' SYSTEM='web server' STATE='$state' CPU='$cpu'" data="NAME='$WEB_SYSTEM' SYSTEM='web server' STATE='$state' CPU='$cpu'"
data="$data MEM='$mem' RTIME='$rtime'" data="$data MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Checking PHP intepreter # Checking PHP intepreter
if [ -n "$WEB_BACKEND" ] && [ "$WEB_BACKEND" != 'remote' ]; then if [ -n "$WEB_BACKEND" ] && [ "$WEB_BACKEND" != 'remote' ]; then
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
php_versions=$(ls /opt/brepo/php*/sbin/php-fpm | cut -d'/' -f4 | sed 's|php||')
for version in $php_versions; do
proc_name="php-fpm"
service_name="fpm${version}"
get_srv_state "/opt/brepo/php${version}" "$proc_name"
data="$data\nNAME='brepo-php-$service_name' SYSTEM='php interpreter' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
done
else
php_versions=$(ls /opt/remi/php*/root/sbin/php-fpm | cut -d'/' -f4 | sed 's|php||') php_versions=$(ls /opt/remi/php*/root/sbin/php-fpm | cut -d'/' -f4 | sed 's|php||')
for version in $php_versions; do for version in $php_versions; do
proc_name="php-fpm" proc_name="php-fpm"
service_name="php${version}" service_name="php${version}"
get_srv_state "$proc_name" get_srv_state "/opt/remi/php${version}" "$proc_name"
data="$data\nNAME='$service_name-php-fpm' SYSTEM='php interpreter' STATE='$state'" data="$data\nNAME='$service_name-php-fpm' SYSTEM='php interpreter' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
done
else
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"
data="$data\nNAME='$service_name' SYSTEM='php interpreter' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
done done
fi fi
fi fi
@@ -199,7 +209,7 @@ fi
if [ -n "$PROXY_SYSTEM" ] && [ "$PROXY_SYSTEM" != 'remote' ]; then if [ -n "$PROXY_SYSTEM" ] && [ "$PROXY_SYSTEM" != 'remote' ]; then
get_srv_state "$PROXY_SYSTEM" get_srv_state "$PROXY_SYSTEM"
data="$data\nNAME='$PROXY_SYSTEM' SYSTEM='reverse proxy' STATE='$state'" data="$data\nNAME='$PROXY_SYSTEM' SYSTEM='reverse proxy' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# DNS # DNS
@@ -208,21 +218,21 @@ if [ -n "$service" ] && [ "$service" != 'remote' ]; then
proc_name='named' proc_name='named'
get_srv_state $service $proc_name get_srv_state $service $proc_name
data="$data\nNAME='$service' SYSTEM='dns server' STATE='$state'" data="$data\nNAME='$service' SYSTEM='dns server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Checking MAIL system # Checking MAIL system
if [ -n "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'remote' ]; then if [ -n "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'remote' ]; then
get_srv_state "$MAIL_SYSTEM" get_srv_state "$MAIL_SYSTEM"
data="$data\nNAME='$MAIL_SYSTEM' SYSTEM='mail server' STATE='$state'" data="$data\nNAME='$MAIL_SYSTEM' SYSTEM='mail server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Checking MAIL IMAP # Checking MAIL IMAP
if [ -n "$IMAP_SYSTEM" ] && [ "$IMAP_SYSTEM" != 'remote' ]; then if [ -n "$IMAP_SYSTEM" ] && [ "$IMAP_SYSTEM" != 'remote' ]; then
get_srv_state "$IMAP_SYSTEM" get_srv_state "$IMAP_SYSTEM"
data="$data\nNAME='$IMAP_SYSTEM' SYSTEM='imap/pop3 server' STATE='$state'" data="$data\nNAME='$IMAP_SYSTEM' SYSTEM='imap/pop3 server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Checking MAIL ANTIVIRUS # Checking MAIL ANTIVIRUS
@@ -244,7 +254,7 @@ if [ -n "$ANTIVIRUS_SYSTEM" ] && [ "$ANTIVIRUS_SYSTEM" != 'remote' ]; then
get_srv_state "$ANTIVIRUS_SYSTEM" "$proc_name" get_srv_state "$ANTIVIRUS_SYSTEM" "$proc_name"
fi fi
data="$data\nNAME='$ANTIVIRUS_SYSTEM' SYSTEM='email anti-virus'" data="$data\nNAME='$ANTIVIRUS_SYSTEM' SYSTEM='email anti-virus'"
data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
proc_name='' proc_name=''
fi fi
@@ -252,7 +262,7 @@ fi
if [ -n "$ANTISPAM_SYSTEM" ] && [ "$ANTISPAM_SYSTEM" != 'remote' ]; then if [ -n "$ANTISPAM_SYSTEM" ] && [ "$ANTISPAM_SYSTEM" != 'remote' ]; then
get_srv_state "$ANTISPAM_SYSTEM" "spamd" get_srv_state "$ANTISPAM_SYSTEM" "spamd"
data="$data\nNAME='$ANTISPAM_SYSTEM' SYSTEM='email spam filter'" data="$data\nNAME='$ANTISPAM_SYSTEM' SYSTEM='email spam filter'"
data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Checking DB system # Checking DB system
@@ -299,7 +309,7 @@ if [ -n "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'remote' ]; then
fi fi
get_srv_state "$service" "$proc_name" get_srv_state "$service" "$proc_name"
data="$data\nNAME='$service' SYSTEM='database server' STATE='$state'" data="$data\nNAME='$service' SYSTEM='database server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
proc_name='' proc_name=''
done done
fi fi
@@ -308,21 +318,21 @@ fi
if [ -n "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'remote' ]; then if [ -n "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'remote' ]; then
get_srv_state "$FTP_SYSTEM" get_srv_state "$FTP_SYSTEM"
data="$data\nNAME='$FTP_SYSTEM' SYSTEM='ftp server' STATE='$state'" data="$data\nNAME='$FTP_SYSTEM' SYSTEM='ftp server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Checking CRON system # Checking CRON system
if [ -n "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'remote' ]; then if [ -n "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'remote' ]; then
get_srv_state "$CRON_SYSTEM" get_srv_state "$CRON_SYSTEM"
data="$data\nNAME='$CRON_SYSTEM' SYSTEM='job scheduler' STATE='$state'" data="$data\nNAME='$CRON_SYSTEM' SYSTEM='job scheduler' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Checking SSH daemon # Checking SSH daemon
if [ -e "/etc/ssh/sshd_config" ]; then if [ -e "/etc/ssh/sshd_config" ]; then
get_srv_state ssh get_srv_state ssh
data="$data\nNAME='ssh' SYSTEM='ssh server' STATE='$state'" data="$data\nNAME='ssh' SYSTEM='ssh server' STATE='$state'"
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Checking FIREWALL system # Checking FIREWALL system
@@ -339,7 +349,7 @@ if [ -n "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != 'remote' ]; then
fi fi
fi fi
data="$data\nNAME='$FIREWALL_SYSTEM' SYSTEM='firewall'" data="$data\nNAME='$FIREWALL_SYSTEM' SYSTEM='firewall'"
data="$data STATE='$state' CPU='0' MEM='0' RTIME='0'" data="$data STATE='$state' CPU='0' MEM='0' RTIME='0' PHM='0'"
fi fi
# Checking FIREWALL Fail2ban extention # Checking FIREWALL Fail2ban extention
@@ -354,7 +364,7 @@ if [ -n "$FIREWALL_EXTENSION" ]; then
get_srv_state "$FIREWALL_EXTENSION" fail2ban-server script get_srv_state "$FIREWALL_EXTENSION" fail2ban-server script
fi fi
data="$data\nNAME='$FIREWALL_EXTENSION' SYSTEM='brute-force protection'" data="$data\nNAME='$FIREWALL_EXTENSION' SYSTEM='brute-force protection'"
data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'" data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime' PHM='$pmem'"
fi fi
# Listing data # Listing data

View File

@@ -32,6 +32,10 @@ is_format_valid 'service' 'restart'
# Action # # Action #
#----------------------------------------------------------# #----------------------------------------------------------#
if [ "$service" == "apache2" ]; then
service="httpd"
fi
log="/dev/null" log="/dev/null"
if [ "$DEBUG_MODE" = "true" ]; then if [ "$DEBUG_MODE" = "true" ]; then
@@ -49,13 +53,21 @@ if [ "$service" = "php-fpm" ]; then
php_versions=$($BIN/v-list-sys-php plain) php_versions=$($BIN/v-list-sys-php plain)
# Substitute php-fpm service name formats # Substitute php-fpm service name formats
for version in $php_versions; do for version in $php_versions; do
service_list="${service_list} php${version}-fpm" if [ "$LOCAL_PHP" == "yes" ]; then
service_list="${service_list} brepo-php-fpm${version}"
else
service_list="${service_list} php${version}-php-fpm"
fi
done done
else else
service_list="$service" service_list="$service"
fi fi
for service in $service_list; do for service in $service_list; do
is_fpm="no"
if [[ "$service" =~ ^php[0-9.]+-php-fpm ]] || [[ "$service" =~ brepo-php-fpm[0-9.]+ ]]; then
is_fpm="yes"
fi
if [ "$service" = "iptables" ]; then if [ "$service" = "iptables" ]; then
# Run the restart rules for iptables firewall # Run the restart rules for iptables firewall
$BIN/v-stop-firewall $BIN/v-stop-firewall
@@ -64,21 +76,13 @@ for service in $service_list; do
service $service upgrade >> $log 2>&1 service $service upgrade >> $log 2>&1
elif [ -z "$restart" -o "$restart" = "no" ] && [ \ elif [ -z "$restart" -o "$restart" = "no" ] && [ \
"$service" = "nginx" -o \ "$service" = "nginx" -o \
"$service" = "apache2" -o \ "$service" = "httpd" -o \
"$service" = "exim4" -o \ "$service" = "exim4" -o \
"$service" = "dovecot" -o \ "$service" = "dovecot" -o \
"$service" = "bind9" -o \ "$service" = "bind9" -o \
"$service" = "named" -o \ "$service" = "named" -o \
"$service" = "vsftpd" -o \ "$service" = "vsftpd" -o \
"$service" = "php5.6-fpm" -o \ "$is_fpm" = "yes" -o \
"$service" = "php7.0-fpm" -o \
"$service" = "php7.1-fpm" -o \
"$service" = "php7.2-fpm" -o \
"$service" = "php7.3-fpm" -o \
"$service" = "php7.4-fpm" -o \
"$service" = "php8.0-fpm" -o \
"$service" = "php8.1-fpm" -o \
"$service" = "php8.2-fpm" -o \
"$service" = "proftpd" -o \ "$service" = "proftpd" -o \
"$service" = "ssh" -o \ "$service" = "ssh" -o \
"$service" = "fail2ban" ]; then "$service" = "fail2ban" ]; then

View File

@@ -58,21 +58,21 @@ tmpfile=$(mktemp)
if [ -z "$version" ]; then if [ -z "$version" ]; then
# Substitute php-fpm service name formats # Substitute php-fpm service name formats
for version in $($BIN/v-list-sys-php plain); do for version in $($BIN/v-list-sys-php plain); do
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
v_php="php$version-php-fpm" v_php="brepo-php-fpm$version"
else else
v_php="php$version-fpm" v_php="php$version-php-fpm"
fi fi
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
if [ ! -f "/opt/brepo/php${version}/etc/php-fpm.d/dummy.conf" ]; then
cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /opt/brepo/php${version}/etc/php-fpm.d/
sed -i "s/9999/99$v_tpl/g" /opt/brepo/php${version}/etc/php-fpm.d/dummy.conf
fi
else
if [ ! -f "/etc/opt/remi/php${version}/php-fpm.d/dummy.conf" ]; then if [ ! -f "/etc/opt/remi/php${version}/php-fpm.d/dummy.conf" ]; then
cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/opt/remi/php${version}/php-fpm.d/ cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/opt/remi/php${version}/php-fpm.d/
sed -i "s/9999/99$v_tpl/g" /etc/opt/remi/php${version}/php-fpm.d/dummy.conf sed -i "s/9999/99$v_tpl/g" /etc/opt/remi/php${version}/php-fpm.d/dummy.conf
fi fi
else
if [ ! -f "/etc/php/${version}/fpm/pool.d/dummy.conf" ]; then
cp -f "$HESTIA_INSTALL_DIR/php-fpm/dummy.conf" "/etc/php/${version}/fpm/pool.d/"
sed -i "s/9999/99${version//./}/g" "/etc/php/${version}/fpm/pool.d/dummy.conf"
fi
fi fi
$BIN/v-restart-service "$v_php" "$restart" $BIN/v-restart-service "$v_php" "$restart"
@@ -82,10 +82,10 @@ if [ -z "$version" ]; then
fi fi
done done
else else
if [ -f /etc/redhat-release ]; then if [ "$LOCAL_PHP" == "yes" ]; then
v_php="php$version-php-fpm" v_php="brepo-php-fpm$version"
else else
v_php="php$version-fpm" v_php="php$version-php-fpm"
fi fi
$BIN/v-restart-service "$v_php" "$restart" $BIN/v-restart-service "$v_php" "$restart"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then

View File

@@ -43,6 +43,15 @@ if [ "$clicmd" = "wp" ]; then
clicmd="$homedir/.wp-cli/wp" clicmd="$homedir/.wp-cli/wp"
fi fi
if [[ "$clicmd" =~ php[0-9][0-9] ]]; then
php_ver=$(echo "$clicmd" | grep -oP "\d+")
if [ "$LOCAL_PHP" == "yes" ]; then
clicmd="/opt/brepo/php${php_ver}/bin/php"
else
clicmd="/usr/bin/php${php_ver}"
fi
fi
if [ -z "$(which "$clicmd")" ]; then if [ -z "$(which "$clicmd")" ]; then
check_result "$E_NOTEXIST" "Cli command does not exist $clicmd" check_result "$E_NOTEXIST" "Cli command does not exist $clicmd"
fi fi
@@ -61,15 +70,6 @@ if [ "$basecmd" != 'ps' -a \
"$basecmd" != 'egrep' -a \ "$basecmd" != 'egrep' -a \
"$basecmd" != 'sed' -a \ "$basecmd" != 'sed' -a \
"$basecmd" != 'cat' -a \ "$basecmd" != 'cat' -a \
"$basecmd" != 'php5.6' -a \
"$basecmd" != 'php7.0' -a \
"$basecmd" != 'php7.1' -a \
"$basecmd" != 'php7.2' -a \
"$basecmd" != 'php7.3' -a \
"$basecmd" != 'php7.4' -a \
"$basecmd" != 'php8.0' -a \
"$basecmd" != 'php8.1' -a \
"$basecmd" != 'php8.2' -a \
"$basecmd" != 'php' -a \ "$basecmd" != 'php' -a \
"$basecmd" != "wp" -a \ "$basecmd" != "wp" -a \
"$basecmd" != 'composer' ]; then "$basecmd" != 'composer' ]; then

View File

@@ -50,11 +50,22 @@ for webtpl_folder in $(ls $HESTIA_INSTALL_DIR/templates/web/* -d 2> /dev/null |
cp -rf "${webtpl_folder}" "${WEBTPL}/" cp -rf "${webtpl_folder}" "${WEBTPL}/"
done done
versions_list=$(ls -d /etc/opt/remi/php*) versions_list=""
for php_ver in $versions_list; do if [ "$LOCAL_PHP" == "yes" ]; then
[ ! -d "$php_ver/fpm/pool.d/" ] && continue versions_list=$(ls -d /opt/brepo/php*)
cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${php_ver/\./_}.tpl for php_ver in $versions_list; do
done [ ! -d "$php_ver/etc/php-fpm.d" ] && continue
vers=$(echo "$php_ver" | awk -F"/" '{ print $4 }' | sed "s/php\([[:digit:]]\+\)/\1/g")
cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${vers/\./_}.tpl
done
else
versions_list=$(ls -d /etc/opt/remi/php*)
for php_ver in $versions_list; do
[ ! -d "$php_ver/php-fpm.d" ] && continue
vers=$(echo "$php_ver" | awk -F"/" '{ print $5 }' | sed "s/php\([[:digit:]]\+\)/\1/g")
cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${vers/\./_}.tpl
done
fi
if [ -n "$awstats_patch" ]; then if [ -n "$awstats_patch" ]; then
# restore LoadPlugin variable # restore LoadPlugin variable

View File

@@ -1,157 +1,224 @@
import { defineConfig } from 'vitepress'; import { defineConfig } from "vitepress";
import { version } from '../../package.json'; import { version } from "../../package.json";
export default defineConfig({ export default defineConfig({
lang: 'en-US', lang: "en-US",
title: 'Hestia Control Panel', title: "Hestia Control Panel",
description: 'Open-source web server control panel.', description: "Open-source web server control panel.",
lastUpdated: true, lastUpdated: true,
cleanUrls: false, cleanUrls: false,
head: [ head: [
['link', { rel: 'icon', sizes: 'any', href: '/favicon.ico' }], ["link", { rel: "icon", sizes: "any", href: "/favicon.ico" }],
['link', { rel: 'icon', type: 'image/svg+xml', sizes: '16x16', href: '/logo.svg' }], [
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }], "link",
['link', { rel: 'manifest', href: '/site.webmanifest' }], { rel: "icon", type: "image/svg+xml", sizes: "16x16", href: "/logo.svg" },
['meta', { name: 'theme-color', content: '#b7236a' }], ],
], [
"link",
{
rel: "apple-touch-icon",
sizes: "180x180",
href: "/apple-touch-icon.png",
},
],
["link", { rel: "manifest", href: "/site.webmanifest" }],
["meta", { name: "theme-color", content: "#b7236a" }],
],
themeConfig: { themeConfig: {
logo: '/logo.svg', logo: "/logo.svg",
nav: nav(), nav: nav(),
socialLinks: [ socialLinks: [
{ icon: 'github', link: 'https://dev.brepo.ru/bayrepo/hestiacp' }, { icon: "github", link: "https://dev.brepo.ru/bayrepo/hestiacp" },
{ icon: 'github', link: 'https://github.com/bayrepo/hestiacp' }, { icon: "github", link: "https://github.com/bayrepo/hestiacp-rpm" },
{ icon: 'github', link: 'https://github.com/hestiacp/hestiacp' }, { icon: "github", link: "https://github.com/hestiacp/hestiacp" },
], ],
sidebar: { '/docs/': sidebarDocs() }, sidebar: { "/docs/": sidebarDocs() },
outline: [2, 3], outline: [2, 3],
footer: { footer: {
message: 'Выпущена под лицензией GPLv3.', message: "Выпущена под лицензией GPLv3.",
copyright: 'Copyright © 2019-present Hestia Control Panel и некоторые RPM based компоненты принадлежат bayrepo', copyright:
}, "Copyright © 2019-present Hestia Control Panel и некоторые RPM based компоненты принадлежат bayrepo",
},
}, },
}); });
/** @returns {import("vitepress").DefaultTheme.NavItem[]} */ /** @returns {import("vitepress").DefaultTheme.NavItem[]} */
function nav() { function nav() {
return [ return [
{ text: 'Характеристики', link: '/features.md' }, { text: "Характеристики", link: "/features.md" },
{ text: 'Установка', link: '/install.md' }, { text: "Установка", link: "/install.md" },
{ text: 'Документация', link: '/docs/introduction/getting-started.md', activeMatch: '/docs/' }, {
{ text: "Документация",
text: `v${version}`, link: "/docs/introduction/getting-started.md",
items: [ activeMatch: "/docs/",
{ },
text: 'Changelog', {
link: 'https://dev.brepo.ru/bayrepo/hestiacp/src/branch/master/CHANGELOG.md', text: `v${version}`,
}, items: [
{ {
text: 'Содействие в разработке', text: "Changelog",
link: 'https://dev.brepo.ru/bayrepo/hestiacp/src/branch/master/CONTRIBUTING.md', link: "https://dev.brepo.ru/bayrepo/hestiacp/src/branch/master/CHANGELOG.md",
}, },
{ {
text: 'Политика безопасности', text: "Содействие в разработке",
link: 'https://dev.brepo.ru/bayrepo/hestiacp/src/branch/master/SECURITY.md', link: "https://dev.brepo.ru/bayrepo/hestiacp/src/branch/master/CONTRIBUTING.md",
}, },
], {
}, text: "Политика безопасности",
]; link: "https://dev.brepo.ru/bayrepo/hestiacp/src/branch/master/SECURITY.md",
},
],
},
];
} }
/** @returns {import("vitepress").DefaultTheme.SidebarItem[]} */ /** @returns {import("vitepress").DefaultTheme.SidebarItem[]} */
function sidebarDocs() { function sidebarDocs() {
return [ return [
{ {
text: 'Знакомство', text: "Знакомство",
collapsed: false, collapsed: false,
items: [ items: [
{ text: 'С чего начать', link: '/docs/introduction/getting-started.md' }, {
{ text: 'Рекомендации', link: '/docs/introduction/best-practices.md' }, text: "С чего начать",
], link: "/docs/introduction/getting-started.md",
}, },
{ { text: "Рекомендации", link: "/docs/introduction/best-practices.md" },
text: 'Инструкция пользователя', ],
collapsed: false, },
items: [ {
{ text: 'Аккаунт', link: '/docs/user-guide/account.md' }, text: "Инструкция пользователя",
{ text: 'Резервные копии', link: '/docs/user-guide/backups.md' }, collapsed: false,
{ text: 'Cron задачи', link: '/docs/user-guide/cron-jobs.md' }, items: [
{ text: 'Базы данных', link: '/docs/user-guide/databases.md' }, { text: "Аккаунт", link: "/docs/user-guide/account.md" },
{ text: 'DNS', link: '/docs/user-guide/dns.md' }, { text: "Резервные копии", link: "/docs/user-guide/backups.md" },
{ text: 'Менеджер файлов', link: '/docs/user-guide/file-manager.md' }, { text: "Cron задачи", link: "/docs/user-guide/cron-jobs.md" },
{ text: 'Почтовые домены', link: '/docs/user-guide/mail-domains.md' }, { text: "Базы данных", link: "/docs/user-guide/databases.md" },
{ text: 'Оповещения', link: '/docs/user-guide/notifications.md' }, { text: "DNS", link: "/docs/user-guide/dns.md" },
{ text: 'Пакеты', link: '/docs/user-guide/packages.md' }, { text: "Менеджер файлов", link: "/docs/user-guide/file-manager.md" },
{ text: 'Статистика', link: '/docs/user-guide/statistics.md' }, { text: "Почтовые домены", link: "/docs/user-guide/mail-domains.md" },
{ text: 'Пользователи', link: '/docs/user-guide/users.md' }, { text: "Оповещения", link: "/docs/user-guide/notifications.md" },
{ text: 'Веб домены', link: '/docs/user-guide/web-domains.md' }, { text: "Пакеты", link: "/docs/user-guide/packages.md" },
], { text: "Статистика", link: "/docs/user-guide/statistics.md" },
}, { text: "Пользователи", link: "/docs/user-guide/users.md" },
{ { text: "Веб домены", link: "/docs/user-guide/web-domains.md" },
text: 'Администрирование сервера', ],
collapsed: false, },
items: [ {
{ text: 'Создание резервных копий и восстановление', link: '/docs/server-administration/backup-restore.md' }, text: "Администрирование сервера",
{ text: 'Конфигурация', link: '/docs/server-administration/configuration.md' }, collapsed: false,
{ text: 'Персональная настройка', link: '/docs/server-administration/customisation.md' }, items: [
{ text: 'Базы данных и phpMyAdmin', link: '/docs/server-administration/databases.md' }, {
{ text: 'DNS кластера & DNSSEC', link: '/docs/server-administration/dns.md' }, text: "Создание резервных копий и восстановление",
{ text: 'Email', link: '/docs/server-administration/email.md' }, link: "/docs/server-administration/backup-restore.md",
{ text: 'Менеджер файлов', link: '/docs/server-administration/file-manager.md' }, },
{ text: 'Firewall', link: '/docs/server-administration/firewall.md' }, {
{ text: 'Обновления ОС', link: '/docs/server-administration/os-upgrades.md' }, text: "Конфигурация",
{ text: 'Rest API', link: '/docs/server-administration/rest-api.md' }, link: "/docs/server-administration/configuration.md",
{ text: 'SSL сертификаты', link: '/docs/server-administration/ssl-certificates.md' }, },
{ text: 'Веб шаблоны и кэширование', link: '/docs/server-administration/web-templates.md' }, {
{ text: 'Troubleshooting', link: '/docs/server-administration/troubleshooting.md' }, text: "Персональная настройка",
], link: "/docs/server-administration/customisation.md",
}, },
{ {
text: 'Содейтсвие в разработке', text: "Базы данных и phpMyAdmin",
collapsed: false, link: "/docs/server-administration/databases.md",
items: [ },
{ text: 'Сборка пакетов', link: '/docs/contributing/building.md' }, {
{ text: 'Разработка', link: '/docs/contributing/development.md' }, text: "DNS кластера & DNSSEC",
{ text: 'Документация', link: '/docs/contributing/documentation.md' }, link: "/docs/server-administration/dns.md",
{ text: 'Установка приложений', link: '/docs/contributing/quick-install-app.md' }, },
{ text: 'Тестирование', link: '/docs/contributing/testing.md' }, { text: "Email", link: "/docs/server-administration/email.md" },
{ text: 'Переводы', link: '/docs/contributing/translations.md' }, {
], text: "Менеджер файлов",
}, link: "/docs/server-administration/file-manager.md",
{ },
text: 'Сообщество', { text: "Firewall", link: "/docs/server-administration/firewall.md" },
collapsed: false, {
items: [ text: "Обновления ОС",
{ text: 'Hestia Nginx Cache', link: '/docs/community/hestia-nginx-cache.md' }, link: "/docs/server-administration/os-upgrades.md",
{ },
text: 'Ioncube installer for Hestia', { text: "Rest API", link: "/docs/server-administration/rest-api.md" },
link: '/docs/community/ioncube-hestia-installer.md', {
}, text: "SSL сертификаты",
{ text: 'Генератор установочной команды', link: '/docs/community/install-script-generator.md' }, link: "/docs/server-administration/ssl-certificates.md",
], },
}, {
{ text: "Веб шаблоны и кэширование",
text: 'Ссылки', link: "/docs/server-administration/web-templates.md",
collapsed: false, },
items: [ {
{ text: 'API', link: '/docs/reference/api.md' }, text: "Troubleshooting",
{ text: 'CLI', link: '/docs/reference/cli.md' }, link: "/docs/server-administration/troubleshooting.md",
], },
}, ],
{ },
text: 'Дополнения', {
collapsed: false, text: "Содейтсвие в разработке",
items: [ collapsed: false,
{ text: 'PHP cli селектор', link: '/docs/extensions/php-cli-selector.md' }, items: [
{ text: 'Расширенные модули', link: '/docs/extensions/extended-modules.md' }, { text: "Сборка пакетов", link: "/docs/contributing/building.md" },
], { text: "Разработка", link: "/docs/contributing/development.md" },
}, { text: "Документация", link: "/docs/contributing/documentation.md" },
]; {
text: "Установка приложений",
link: "/docs/contributing/quick-install-app.md",
},
{ text: "Тестирование", link: "/docs/contributing/testing.md" },
{ text: "Переводы", link: "/docs/contributing/translations.md" },
],
},
{
text: "Сообщество",
collapsed: false,
items: [
{
text: "Hestia Nginx Cache",
link: "/docs/community/hestia-nginx-cache.md",
},
{
text: "Ioncube installer for Hestia",
link: "/docs/community/ioncube-hestia-installer.md",
},
{
text: "Генератор установочной команды",
link: "/docs/community/install-script-generator.md",
},
],
},
{
text: "Ссылки",
collapsed: false,
items: [
{ text: "API", link: "/docs/reference/api.md" },
{ text: "CLI", link: "/docs/reference/cli.md" },
],
},
{
text: "Дополнения",
collapsed: false,
items: [
{
text: "PHP cli селектор",
link: "/docs/extensions/php-cli-selector.md",
},
{
text: "Расширенные модули",
link: "/docs/extensions/extended-modules.md",
},
{ text: "Настройка Local PHP", link: "/docs/extensions/local-php.md" },
{
text: "nginx+mod_rewrite",
link: "/docs/extensions/nginx-mod-rewrite.md",
},
],
},
];
} }

View File

@@ -13,6 +13,8 @@ export default {
return { return {
pageloader: false, pageloader: false,
hestia_wget: hestia_wget:
"wget https://raw.githubusercontent.com/bayrepo/hestiacp-rpm/refs/heads/rhel-version/install/hst-install.sh",
hestia_wget_devel:
"wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh", "wget https://dev.brepo.ru/bayrepo/hestiacp/raw/branch/master/install/hst-install.sh",
hestia_install: "sudo bash hst-install.sh", hestia_install: "sudo bash hst-install.sh",
installStr: "", installStr: "",
@@ -27,10 +29,7 @@ export default {
if (item.selectField) { if (item.selectField) {
return item.selected ? `${item.param} '${item.text}'` : ""; return item.selected ? `${item.param} '${item.text}'` : "";
} }
return `${item.param}${item.selected ? " yes" : " no"}`;
return item.param.includes("force") && item.selected
? item.param
: `${item.param}${item.selected ? " yes" : " no"}`;
}, },
generateString() { generateString() {
const installStr = this.items.map(this.getOptionString).filter(Boolean); const installStr = this.items.map(this.getOptionString).filter(Boolean);
@@ -156,6 +155,23 @@ export default {
Copy Copy
</button> </button>
</div> </div>
<p class="u-mb10">For downloading devel version use:</p>
<div class="u-pos-relative">
<input
type="text"
class="form-control u-monospace u-mb10"
v-model="hestia_wget_devel"
readonly
/>
<button
class="button-positioned"
@click="copyToClipboard(hestia_wget_devel, $event.target)"
type="button"
title="Copy to Clipboard"
>
Copy
</button>
</div>
<p class="u-mb10">Then run the following command:</p> <p class="u-mb10">Then run the following command:</p>
<div class="u-pos-relative"> <div class="u-pos-relative">
<textarea class="form-control u-min-height100" v-model="installStr" readonly /> <textarea class="form-control u-min-height100" v-model="installStr" readonly />

View File

@@ -22,6 +22,7 @@ export const webDomains = [
{ text: 'PHP 8.2' }, { text: 'PHP 8.2' },
{ text: 'PHP 8.3' }, { text: 'PHP 8.3' },
{ text: 'PHP 8.4' }, { text: 'PHP 8.4' },
{ text: 'PHP 8.5' },
], ],
}, },
]; ];

View File

@@ -84,17 +84,17 @@ export const options = [
selected: true, selected: true,
}, },
{ {
name: ' --mariadb', name: ' --mysql',
id: 'mariadb', id: 'mariadb',
param: '--mariadb', param: '--mysql',
desc: 'Ответление MySQL с дополнительными усовершенствованиями.', desc: 'Ответление MySQL с дополнительными усовершенствованиями.',
selected: true, selected: true,
conflicts: 'mysql8', conflicts: 'mysql8',
}, },
{ {
name: ' --mysql8', name: ' --mysql-classic',
id: 'mysql8', id: 'mysql8',
param: '--mysql8', param: '--mysql-classic',
desc: 'База данных с открытым исходным кодом', desc: 'База данных с открытым исходным кодом',
selected: false, selected: false,
conflicts: 'mariadb', conflicts: 'mariadb',
@@ -137,6 +137,14 @@ export const options = [
selected: true, selected: true,
depends: 'exim', depends: 'exim',
}, },
{
name: ' --usemirrorclamav',
id: 'usemirrorclamav',
param: '--usemirrorclamav',
desc: 'Использовать русское зеркало баз данных ClamaV',
selected: false,
depends: 'clamav',
},
{ {
name: ' --spamassassin', name: ' --spamassassin',
id: 'spamassassin', id: 'spamassassin',
@@ -146,12 +154,33 @@ export const options = [
depends: 'exim', depends: 'exim',
}, },
{ {
name: ' --iptables', name: ' --firewall',
id: 'iptables', id: 'firewall',
param: '--iptables', param: '--firewall',
desc: 'Управлять фаерволом.', desc: 'Управлять фаерволом.',
selected: true, selected: true,
}, },
{
name: ' --nopublicip',
id: 'nopublicip',
param: '--nopublicip',
desc: 'Использовать локальный IP сервера',
selected: false,
},
{
name: ' --uselocalphp',
id: 'uselocalphp',
param: '--uselocalphp',
desc: 'Использовать PHP из текущего репозитория HestiaCP',
selected: false,
},
{
name: ' --usemirrorclamav',
id: 'usemirrorclamav',
param: '--usemirrorclamav',
desc: 'Использовать clamav с базами скачанными с зеркала в России',
selected: false,
},
{ {
name: ' --fail2ban', name: ' --fail2ban',
id: 'fail2ban', id: 'fail2ban',

View File

@@ -38,6 +38,7 @@
- **puppet_installer** - установить puppet, для большинства модулей требуется puppet для изменения конфигурации системы, поэтому требуется, чтоб этот модуль был включен, при включении он установит puppet в систему. - **puppet_installer** - установить puppet, для большинства модулей требуется puppet для изменения конфигурации системы, поэтому требуется, чтоб этот модуль был включен, при включении он установит puppet в систему.
- **empty_module** - пустой модуль, его включение или выключение не начто не влияет, является примером написания модулей - **empty_module** - пустой модуль, его включение или выключение не начто не влияет, является примером написания модулей
- **passenger_manager** - модуль по установке и настройке passenger в систему. - **passenger_manager** - модуль по установке и настройке passenger в систему.
- **php_brepo_modules** - модуль по управлению расширениями Local PHP. [Описание интерфейса](/docs/extensions/local-php.md)
## Управление модулями из командной строки ## Управление модулями из командной строки

View File

@@ -0,0 +1,35 @@
# Local PHP
PHP интерпретатор из репозитория, из которого ставится HestiaCP RPM Edition.
HestiaCP RPM Edition имеет возможность работать или с PHP из Remi репозитория или с PHP из т.н. локального репозитория - Local PHP.
Если требуется более расширенный функционал пакетов из Remi репозитория, то следует отказаться при установке панели от опции `uselocalphp yes` и установить панель с опцией `uselocalphp no`.
Local PHP более ограниченный в наборе расширений, но занимает меньше места на диске и приносит меньше RPM пакетов. Подходит для большинства сборок CMS таких как Wordpress, Drupal и т.д.
Есть еще одна особенность, для данного типа PHP разработан графический интерфейс по управлению подключенными расширениями.
## Графический интерфейс управления расширениями PHP
Для включения графического интерфейса необходимо перейти в настройки панели под администратором и выбрать закладку "Дополнительные модули".
![ext_modules_step2](/images/ext_modules_step2.png)
На окрывшейся веб странице необходимо активировать модуль **php_brepo_modules**.
![local_php_step1](/images/local_php_1.png)
Справа от названия модуля появится пункт меню - `Изменить`.
При нажатии мышкой на ссылку `Изменить`, откроется окно выбора версии PHP, для которой требуется перенастройка расширений.
![local_php_step2](/images/local_php_2.png)
Здесь будут отображаться все установленные на сервере версии Local PHP. Для настройки модулей необходимо нажать мышкой на шестеренке справа от версии PHP (<i class="fa-solid fa-gear icon-purple"></i>), в пункте меню `Изменить список модулей` <i class="fa-solid fa-gear icon-purple"></i>.
Откроется страница выбора расширений.
![local_php_step3](/images/local_php_3.png)
Здесь приведен список установленных расширений. Галочками подсвечены активные расширения.
Здесь можно убрать галочки напротив названия модуля или наоборот установить галочку. И нажать `Сохранить` для изменения конфигурации расширений для выбранной версии PHP или `Назад`, для отмены изменений.

View File

@@ -0,0 +1,15 @@
# nginx с поддержкой mdo_rewrite
HestiaCP RPM edition поддерживает установку приложений для доменов, таких как Wordpress, Joomla, Drupal и т.д.
Данные приложения написаны на PHP и требуют особого режима доступа к файлам, который реализуется с помощью .htaccess файла, в котором опианы эти правила преобразования URL.
Но .htaccess файл доступен только для Apache, для реализации работоспособнсти приложений в контрольной панели организованы шаблоны конфигурации nginx, которые по сути являются аналогами конфигурации из .htaccess.
Эти шаблоны размещены в каталоге `/usr/local/hestia/data/templates/web/nginx/php-fpm`.
# nginx + mod_rewrite
Но с версии 1.28.2 nginx добавлен экспериментальный модуль mod_rewrite для nginx, который позволяет понимать конфигурации из .htaccess и для nginx.
Для активации данной конфигурации, необходимо в настройках домена в `Расширенных настройках` выбрать в поле `Шаблон прокси` шаблон `nginx-php-rewrite`. Данный шаблон автоматически определит версию PHP-FPM для домена и активирует работу модуля mod_rewrite для nginx. Для данного домена Apache больше не будет принимать участие в обработке запроса, все будет обрабатываться в связке nginx-PHP-FPM.

View File

@@ -60,3 +60,5 @@
- [PHP cli селектор](/docs/extensions/php-cli-selector.md) - [PHP cli селектор](/docs/extensions/php-cli-selector.md)
- [Расширенные модули](/docs/extensions/extended-modules.md) - [Расширенные модули](/docs/extensions/extended-modules.md)
- [Настройка Local PHP](/docs/extensions/local-php.md)
- [nginx + mod_rewrite](/docs/extensions/nginx-mod-rewrite.md)

View File

@@ -93,14 +93,16 @@ bash hst-install.sh -h
-Z, --sieve Install Sieve [yes|no] default: no -Z, --sieve Install Sieve [yes|no] default: no
-c, --clamav Install ClamAV [yes|no] default: no -c, --clamav Install ClamAV [yes|no] default: no
-t, --spamassassin Install SpamAssassin [yes|no] default: yes -t, --spamassassin Install SpamAssassin [yes|no] default: yes
-i, --iptables Install Iptables [yes|no] default: yes -i, --firewall Install firewalld [yes|no] default: yes
-b, --fail2ban Install Fail2ban [yes|no] default: yes -b, --fail2ban Install Fail2ban [yes|no] default: yes
-q, --quota Filesystem Quota [yes|no] default: no -q, --quota Filesystem Quota [yes|no] default: no
-d, --api Activate API [yes|no] default: yes -d, --api Activate API [yes|no] default: yes
-r, --port Change Backend Port default: 8083 -r, --port Change Backend Port default: 8083
-l, --lang Default language default: en -l, --lang Default language default: en
-y, --interactive Interactive install [yes|no] default: yes -y, --interactive Interactive install [yes|no] default: yes
-I, --nopublicip Use local ip [yes|no] default: yes -I, --nopublicip Use local ip [yes|no] default: no
-u, --uselocalphp Use PHP from local repo [yes|no] default: no
-C, --usemirrorclamav Use mirrored clamav [yes|no] default: no
-s, --hostname Set hostname -s, --hostname Set hostname
-e, --email Set admin email -e, --email Set admin email
-p, --password Set admin password -p, --password Set admin password
@@ -118,14 +120,14 @@ bash hst-install.sh \
--hostname host.domain.tld \ --hostname host.domain.tld \
--email email@domain.tld \ --email email@domain.tld \
--password p4ssw0rd \ --password p4ssw0rd \
--lang fr \ --lang ru \
--apache no \ --apache no \
--named no \ --named no \
--clamav no \ --clamav no \
--spamassassin no --spamassassin no
``` ```
Эта команда установит Hestia на французском с такой конфигурацией: Эта команда установит Hestia на русском с такой конфигурацией:
- Nginx веб сервер - Nginx веб сервер
- PHP-FPM сервер приложений - PHP-FPM сервер приложений
@@ -140,3 +142,11 @@ bash hst-install.sh \
К настоящему моменту у вас должна быть установлена Hestia на вашем сервере. Вы готовы добавлять новых пользователей, чтобы вы (или они) могли добавлять новые веб-сайты на вашем сервере. К настоящему моменту у вас должна быть установлена Hestia на вашем сервере. Вы готовы добавлять новых пользователей, чтобы вы (или они) могли добавлять новые веб-сайты на вашем сервере.
Чтобы получить доступ к панели управления, перейдите по адресу `https://host.domain.tld:8083` или `http://your.public.ip.address:8083` Чтобы получить доступ к панели управления, перейдите по адресу `https://host.domain.tld:8083` или `http://your.public.ip.address:8083`
## Расширенные опции RPM версии
Данная реадкция HestiaCP RPM Edition включает дополнительные оции такие как:
- `-I, --nopublicip` - если установлена данная опция, то установщик панели не получает внешний IP адрес сервера, где контрольная панель устанавливается (на случай если ваш сервер за NAT). Данную опцию можно включать, если у вас на сервере публичный IP или необходима внутрисетевая установка без внешнего доступа.
- `-u, --uselocalphp` - включить установку пакетов PHP из того-же репозитория, откуда ставится HestiaCP RPM Edition. Если не включать данную опцию, то PHP пакеты будут установлены из репозитория Remi. Если включить, то будет произведена так называемая установка локальных пакетов. Есть отличия в способе упаковке Local PHP и Remi PHP. Если сервера требуется расширенный набор PHP из Remi репозитория, то данную опцию лучше отключить, т.е задать `--uselocalphp no`. Local PHP более простая сборка с меньшим числом поддерживаемых модулей PHP, но подходит для большинства конфигураций CMS и имеет [страницу настройки подключаемых модулей](/docs/extensions/local-php.md)

View File

@@ -142,3 +142,13 @@
Когда включено кэширование Nginx (с использованием кэша FastCGI или с шаблоном с поддержкой кэширования), вы можете очистить кэш с помощью кнопки **<i class="fas fa-fw fa-trash"></i> Очистить кэш Nginx**. Когда включено кэширование Nginx (с использованием кэша FastCGI или с шаблоном с поддержкой кэширования), вы можете очистить кэш с помощью кнопки **<i class="fas fa-fw fa-trash"></i> Очистить кэш Nginx**.
При использовании только Nginx вы можете включить кэширование FastCGI с помощью поля **Включить кэш FastCGI**. Если этот флажок установлен, отображается опция, позволяющая определить, в течение какого времени кэш считается действительным. При использовании только Nginx вы можете включить кэширование FastCGI с помощью поля **Включить кэш FastCGI**. Если этот флажок установлен, отображается опция, позволяющая определить, в течение какого времени кэш считается действительным.
### Домен по умолчанию
Для вебсервера Apache при обращении по IP адресу без указания домена доменом по умолчанию является первый загруженный виртуальный хост.
Для изменения домена по умолчанию необходимо выбрать среди доменов интересующий и в настройках домена необходимо установить флажок:
**Установить текущий домен как домент по умолчанию при обращении к серверу по IP**
затем нажмите кнопку **<i class="fas fa-fw fa-save"></i> Сохранить** в правом верхнем углу.

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -101,34 +101,33 @@ is_web_alias_new() {
prepare_web_backend() { prepare_web_backend() {
# Accept first function argument as backend template otherwise fallback to $template global variable # Accept first function argument as backend template otherwise fallback to $template global variable
local backend_template=${1:-$template} local backend_template=${1:-$template}
php_type=$(cat "$HESTIA/conf/hestia.conf" | grep "LOCAL_PHP" | grep "yes")
if [ -f "/etc/redhat-release" ]; then if [ -n "$php_type" ]; then
pool=$(find -L /etc/opt/remi/php80/ -name "$domain.conf" -exec dirname {} \; 2>/dev/null) pool=$(find -L /opt/brepo/ -name "$domain.conf" -exec dirname {} \; 2>/dev/null)
else else
pool=$(find -L /etc/php/ -name "$domain.conf" -exec dirname {} \;) pool=$(find -L /etc/opt/remi/php80/ -name "$domain.conf" -exec dirname {} \; 2>/dev/null)
fi fi
# Check if multiple-PHP installed # Check if multiple-PHP installed
if [ -f "/etc/redhat-release" ]; then regex="^.*PHP-([0-9])([0-9])$"
regex="^.*PHP-([0-9])([0-9])$"
else
regex="^.*PHP-([0-9])\_([0-9])$"
fi
if [[ $backend_template =~ $regex ]]; then if [[ $backend_template =~ $regex ]]; then
if [ -f "/etc/redhat-release" ]; then if [ -n "$php_type" ]; then
backend_version="${BASH_REMATCH[1]}${BASH_REMATCH[2]}"
pool=$(find -L /opt/brepo/php$backend_version -type d \( -name "pool.d" -o -name "*fpm.d" \))
else
backend_version="${BASH_REMATCH[1]}${BASH_REMATCH[2]}" backend_version="${BASH_REMATCH[1]}${BASH_REMATCH[2]}"
pool=$(find -L /etc/opt/remi/php$backend_version -type d \( -name "pool.d" -o -name "*fpm.d" \)) pool=$(find -L /etc/opt/remi/php$backend_version -type d \( -name "pool.d" -o -name "*fpm.d" \))
else
backend_version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
pool=$(find -L /etc/php/$backend_version -type d \( -name "pool.d" -o -name "*fpm.d" \))
fi fi
else else
backend_version=$(multiphp_default_version) backend_version=$(multiphp_default_version)
if [ -z "$pool" ] || [ -z "$BACKEND" ]; then if [ -z "$pool" ] || [ -z "$BACKEND" ]; then
if [ -f "/etc/redhat-release" ]; then if [ -n "$php_type" ]; then
m_backend_version="${backend_version//./}"
pool=$(find -L /opt/brepo/php$m_backend_version -type d \( -name "pool.d" -o -name "*fpm.d" \))
else
m_backend_version="${backend_version//./}" m_backend_version="${backend_version//./}"
pool=$(find -L /etc/opt/remi/php$m_backend_version -type d \( -name "pool.d" -o -name "*fpm.d" \)) pool=$(find -L /etc/opt/remi/php$m_backend_version -type d \( -name "pool.d" -o -name "*fpm.d" \))
else
pool=$(find -L /etc/php/$backend_version -type d \( -name "pool.d" -o -name "*fpm.d" \))
fi fi
fi fi
fi fi
@@ -151,11 +150,12 @@ prepare_web_backend() {
# Delete web backend # Delete web backend
delete_web_backend() { delete_web_backend() {
if [ -f "/etc/redhat-release" ]; then php_type=$(cat "$HESTIA/conf/hestia.conf" | grep "LOCAL_PHP" | grep "yes")
find -L /etc/opt/remi/ -name "$backend_type.conf" -exec rm -f {} \; if [ -n "$php_type" ]; then
else find -L /opt/brepo/php* -name "$backend_type.conf" -exec rm -f {} \;
find -L /etc/php/ -type f -name "$backend_type.conf" -exec rm -f {} \; else
fi find -L /etc/opt/remi/ -name "$backend_type.conf" -exec rm -f {} \;
fi
} }
# Prepare web aliases # Prepare web aliases
@@ -419,11 +419,41 @@ add_web_config() {
done done
fi fi
#----
php_type=$(cat "$HESTIA/conf/hestia.conf" | grep "LOCAL_PHP" | grep "yes")
MOD_CONF="/etc/httpd/conf.modules.d/09-mod-php.conf"
PHP_DEFAULT="/usr/bin/php-cgi"
if [ -e $MOD_CONF ]; then
php_ver=$(grep -m1 '^LoadModule php_module ' "$MOD_CONF" | grep -oP 'php\d{2}')
else
php_ver=$(find /etc/httpd/conf.modules.d -maxdepth 1 -type f -name '*-php*-php.conf' -print -quit | sed -n 's/.*-\(php[0-9]\+\)-php\.conf$/\1/p')
fi
php_cgi_path=$PHP_DEFAULT
if [ -n "$php_ver" ]; then
if [ -n "$php_type" ]; then
php_cgi_path="/opt/brepo/${php_ver}/bin/php-cgi"
else
php_cgi_path="/opt/remi/${php_ver}/root/bin/php-cgi"
fi
fi
if [[ -x "$php_cgi_path" ]]; then
:
else
php_cgi_path=$PHP_DEFAULT
fi
#----
trigger="${TPLNM/.*pl/.sh}" trigger="${TPLNM/.*pl/.sh}"
if [ -x "${WEBTPL_LOCATION}/$trigger" ]; then if [ -x "${WEBTPL_LOCATION}/$trigger" ]; then
$WEBTPL_LOCATION/$trigger \ $WEBTPL_LOCATION/$trigger \
$user $domain $local_ip $HOMEDIR \ $user $domain $local_ip $HOMEDIR \
$HOMEDIR/$user/web/$domain/public_html $HOMEDIR/$user/web/$domain/public_html \
$php_cgi_path
fi fi
} }

View File

@@ -1449,6 +1449,56 @@ check_backup_conditions() {
done done
} }
fn_get_link_name(){
str_result=""
ext_name=$1
pattern=("01-ioncube.ini" "10-opcache.ini" "20-bcmath.ini" "20-bz2.ini" "20-calendar.ini" "20-ctype.ini" "20-curl.ini" "20-dba.ini" "20-dom.ini" "20-enchant.ini" "20-exif.ini" "20-ffi.ini" "20-fileinfo.ini" "20-ftp.ini" "20-gd.ini" "20-gettext.ini" "20-gmp.ini" "20-iconv.ini" "20-imap.ini" "20-intl.ini" "20-ldap.ini" "20-mbstring.ini" "20-mysqlnd.ini" "20-odbc.ini" "20-pdo.ini" "20-phar.ini" "20-posix.ini" "20-pspell.ini" "20-shmop.ini" "20-simplexml.ini" "20-sockets.ini" "20-sqlite3.ini" "20-sysvmsg.ini" "20-sysvsem.ini" "20-sysvshm.ini" "20-tokenizer.ini" "20-xml.ini" "20-xmlwriter.ini" "20-xsl.ini" "30-mysqli.ini" "30-pdo_dblib.ini" "30-pdo_firebird.ini" "30-pdo_mysql.ini" "30-pdo_odbc.ini" "30-pdo_sqlite.ini" "30-xmlreader.ini" "30-zip.ini" "40-apcu.ini" "40-ast.ini" "40-bolt.ini" "40-brotli.ini" "40-geos.ini" "40-imagick.ini" "40-libvirt-php.ini" "40-lz4.ini" "40-pdlib.ini")
check="^[0-9]+-${ext_name}.ini"
for str in ${pattern[@]}; do
if [[ $str =~ $check ]]; then
str_result="$str"
break
fi
done
if [ -z "$str_result" ]; then
echo "50-${ext_name}.ini"
else
echo "$str_result"
fi
}
fn_enable_local_php_extension(){
vers=$1
ext_name=$2
ext_nm=$(fn_get_link_name "$ext_name")
if [ -e "/opt/brepo/php${vers}/etc/php.d/" ]; then
if [ ! -e "/opt/brepo/php${vers}/etc/php.d/${ext_nm}" -a -e "/opt/brepo/php${vers}/etc/mod-installed/${ext_name}.ini" ]; then
pushd "/opt/brepo/php${vers}/etc/php.d/"
ln -s ../mod-installed/${ext_name}.ini /opt/brepo/php${vers}/etc/php.d/${ext_nm}
popd
fi
fi
}
fn_disable_local_php_extension(){
vers=$1
ext_name=$2
ext_nm=$(fn_get_link_name "$ext_name")
if [ -e "/opt/brepo/php${vers}/etc/php.d/" ]; then
if [ -e "/opt/brepo/php${vers}/etc/php.d/${ext_nm}" ]; then
rm -f "/opt/brepo/php${vers}/etc/php.d/${ext_nm}"
fi
fi
}
fn_enable_mod_php(){
vers=$1
if [ -e "/etc/httpd/conf.d.prep/php${vers}.conf" ]; then
ln -s /etc/httpd/conf.d.prep/php${vers}.conf /etc/httpd/conf.h.d/mod_php${vers}.conf
fi
}
# Define download function # Define download function
download_file() { download_file() {
local url=$1 local url=$1
@@ -1511,9 +1561,16 @@ multiphp_count() {
multiphp_versions() { multiphp_versions() {
local -a php_versions_list local -a php_versions_list
local php_ver local php_ver
local php_type_internal=$(cat "$HESTIA/conf/hestia.conf" | grep "LOCAL_PHP" | grep "yes")
local pool_internal=""
if [ "$(multiphp_count)" -gt 0 ]; then if [ "$(multiphp_count)" -gt 0 ]; then
for php_ver in $($BIN/v-list-sys-php plain); do for php_ver in $($BIN/v-list-sys-php plain); do
[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue if [ -n "$php_type_internal" ]; then
pool_internal="/opt/brepo/php$php_ver/etc/php-fpm.d"
else
pool_internal="/etc/opt/remi/php$php_ver/php-fpm.d"
fi
[ ! -d "$pool_internal" ] && continue
php_versions_list+=($php_ver) php_versions_list+=($php_ver)
done done
echo "${php_versions_list[@]}" echo "${php_versions_list[@]}"
@@ -1522,11 +1579,19 @@ multiphp_versions() {
multiphp_default_version() { multiphp_default_version() {
# Get system wide default php version (set by update-alternatives) # Get system wide default php version (set by update-alternatives)
local sys_phpversion=$(php -r "echo substr(phpversion(),0,3);") local sys_phpversion_l=$(php -r "echo substr(phpversion(),0,3);")
local sys_phpversion="${sys_phpversion_l//./}"
local php_type_internal=$(cat "$HESTIA/conf/hestia.conf" | grep "LOCAL_PHP" | grep "yes")
local pool_internal=""
if [ -n "$php_type_internal" ]; then
pool_internal="/opt/brepo/php$sys_phpversion/etc/php-fpm.d"
else
pool_internal="/etc/opt/remi/php$sys_phpversion/php-fpm.d"
fi
# Check if the system php also has php-fpm enabled, otherwise return # Check if the system php also has php-fpm enabled, otherwise return
# the most recent php version which does have it installed. # the most recent php version which does have it installed.
if [ ! -d "/etc/php/$sys_phpversion/fpm/pool.d/" ]; then if [ ! -d "$pool_internal" ]; then
local all_versions="$(multiphp_versions)" local all_versions="$(multiphp_versions)"
if [ -n "$all_versions" ]; then if [ -n "$all_versions" ]; then
sys_phpversion="${all_versions##*\ }" sys_phpversion="${all_versions##*\ }"
@@ -1731,3 +1796,30 @@ get_conf_d_name(){
echo "conf.d" echo "conf.d"
fi fi
} }
# Get default php version
# hestia.conf should be enabled before function
get_system_default_php(){
declare -a local_versions
if [ "$LOCAL_PHP" == "yes" ]; then
for version in /opt/brepo/php*/etc/php-fpm.d/www.conf; do
local_ver=$(echo "$version" | awk -F"/" '{ print $4 }' | sed "s/php\([[:digit:]]\+\)/\1/g")
if [ "$local_ver" != "php*" ]; then
local_versions+=("$local_ver")
fi
done
else
for version in /etc/opt/remi/php*/php-fpm.d/www.conf; do
local_ver=$(echo "$version" | awk -F"/" '{ print $5 }' | sed "s/php\([[:digit:]]\+\)/\1/g")
if [ "$local_ver" != "php*" ]; then
local_versions+=("$local_ver")
fi
done
fi
if [ ${#local_versions[@]} -eq 0 ]; then
local_php_ver="82"
else
local_php_ver="${local_versions[0]}"
fi
echo "$local_php_ver"
}

View File

@@ -20,15 +20,15 @@ class PassengerWorker < Kernel::ModuleCoreWorker
ID: 2, ID: 2,
NAME: MODULE_ID, NAME: MODULE_ID,
DESCR: "Added passenger support for nginx", DESCR: "Added passenger support for nginx",
REQ: "puppet_installer", REQ: "",
CONF: "yes", CONF: "yes",
} }
end end
def enable def enable
log_file = get_log log_file = get_log
f_inst_pp = get_module_paydata("passenger_installer.pp") f_inst_pp = get_module_paydata("passenger_installer.yml")
f_uninst_pp = get_module_paydata("passenger_uninstaller.pp") f_uninst_pp = get_module_paydata("passenger_uninstaller.yml")
if !check if !check
inf = info inf = info
log("Req error, needed #{inf[:REQ]}") log("Req error, needed #{inf[:REQ]}")
@@ -36,16 +36,16 @@ class PassengerWorker < Kernel::ModuleCoreWorker
else else
begin begin
prepare_default_ruby_conf prepare_default_ruby_conf
log("install packages for passenger + nginx support: /usr/bin/puppet apply --detailed-exitcodes #{f_inst_pp}") log("install packages for passenger + nginx support: /usr/bin/ansible-playbook -vv #{f_inst_pp}")
result_action = `/usr/bin/puppet apply --detailed-exitcodes "#{f_inst_pp}" 2>&1` result_action = `LC_ALL=C.UTF-8 /usr/bin/ansible-playbook -vv "#{f_inst_pp}" 2>&1`
ex_status = $?.exitstatus ex_status = $?.exitstatus
if ex_status.to_i == 0 || ex_status.to_i == 2 if ex_status.to_i == 0 || ex_status.to_i == 2
log(result_action) log(result_action)
super super
else else
log(result_action) log(result_action)
log("Try to disable action: /usr/bin/puppet apply --detailed-exitcodes #{f_uninst_pp}") log("Try to disable action: /usr/bin/ansible-playbook -vv #{f_uninst_pp}")
result_action = `/usr/bin/puppet apply --detailed-exitcodes "#{f_uninst_pp}" 2>&1` result_action = `LC_ALL=C.UTF-8 /usr/bin/ansible-playbook -vv "#{f_uninst_pp}" 2>&1`
"module installation error. See log #{log_file}" "module installation error. See log #{log_file}"
end end
rescue => e rescue => e
@@ -57,14 +57,14 @@ class PassengerWorker < Kernel::ModuleCoreWorker
def disable def disable
log_file = get_log log_file = get_log
f_uninst_pp = get_module_paydata("passenger_uninstaller.pp") f_uninst_pp = get_module_paydata("passenger_uninstaller.yml")
if !check_domains_with_passenger if !check_domains_with_passenger
return log_return("Presents domains with passenger support disable it first") return log_return("Presents domains with passenger support disable it first")
end end
begin begin
log("uninstall packages for passenger + nginx support") log("uninstall packages for passenger + nginx support")
log("Try to disable action: /usr/bin/puppet apply --detailed-exitcodes #{f_uninst_pp}") log("Try to disable action: /usr/bin/ansible-playbook -vv #{f_uninst_pp}")
result_action = `/usr/bin/puppet apply --detailed-exitcodes "#{f_uninst_pp}" 2>&1` result_action = `LC_ALL=C.UTF-8 /usr/bin/ansible-playbook -vv "#{f_uninst_pp}" 2>&1`
ex_status = $?.exitstatus ex_status = $?.exitstatus
if ex_status.to_i == 0 || ex_status.to_i == 2 if ex_status.to_i == 0 || ex_status.to_i == 2
log(result_action) log(result_action)

View File

@@ -0,0 +1,69 @@
---
- name: Install Passenger and configure Nginx on localhost
hosts: localhost
connection: local
become: true
gather_facts: false
environment:
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
tasks:
# Устанавливаем Ruby и зависимости
- name: Install rubygems-devel
ansible.builtin.dnf:
name: rubygems-devel
state: present
- name: Install rubygem-rake
ansible.builtin.dnf:
name: rubygem-rake
state: present
- name: Install ruby-devel
ansible.builtin.dnf:
name: ruby-devel
state: present
- name: Install rubygem-rack
ansible.builtin.dnf:
name: rubygem-rack
state: present
- name: Install alt-brepo-ruby33-devel
ansible.builtin.dnf:
name: alt-brepo-ruby33-devel
state: present
- name: Install alt-brepo-ruby33-rubygem-rake
ansible.builtin.dnf:
name: alt-brepo-ruby33-rubygem-rake
state: present
# Устанавливаем Passenger и модуль Nginx
- name: Install passenger-devel
ansible.builtin.dnf:
name: passenger-devel
state: present
- name: Install passenger
ansible.builtin.dnf:
name: passenger
state: present
- name: Install nginx-mod-http-passenger
ansible.builtin.dnf:
name: nginx-mod-http-passenger
state: present
# Конфигурируем Nginx для Passenger
- name: Create passenger.conf
ansible.builtin.copy:
dest: /etc/nginx/conf.d/passenger.conf
content: |
passenger_root /usr/share/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
passenger_instance_registry_dir /var/run/passenger-instreg;
passenger_user_switching on;
passenger_env_var PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY 0;
passenger_env_var PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY 0;
- name: Create passenger_includer.conf
ansible.builtin.copy:
dest: /etc/nginx/conf.d/main/passenger.conf
content: |
load_module modules/ngx_http_passenger_module.so;
# Перезапускаем Nginx
- name: Restart nginx service
ansible.builtin.service:
name: nginx
state: restarted

View File

@@ -0,0 +1,38 @@
---
- name: Uninstall Passenger and configure Nginx on localhost
hosts: localhost
connection: local
become: true
gather_facts: false
environment:
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
tasks:
# Удалаем модуль nginx-passenger
- name: Remove nginx-mod-http-passenger package
ansible.builtin.dnf:
name: nginx-mod-http-passenger
state: absent
# Удалаем passenger и зависимости
- name: Remove passenger-devel package
ansible.builtin.dnf:
name: passenger-devel
state: absent
- name: Remove passenger package
ansible.builtin.dnf:
name: passenger
state: absent
# Удаляем конфигурационные файлы Nginx
- name: Remove passenger.conf
ansible.builtin.file:
path: /etc/nginx/conf.d/passenger.conf
state: absent
- name: Remove passenger_includer.conf
ansible.builtin.file:
path: /etc/nginx/conf.d/main/passenger.conf
state: absent
# Перезапускаем Nginx (необязательно, но полезно)
- name: Restart nginx service
ansible.builtin.service:
name: nginx
state: restarted

View File

@@ -0,0 +1,256 @@
#!/opt/brepo/ruby33/bin/ruby
class EmptyWorker < Kernel::ModuleCoreWorker
MODULE_ID = "php_brepo_modules"
def info
{
ID: 4,
NAME: MODULE_ID,
DESCR: "Module for managing of php modules for php's from brepo repository",
REQ: "",
CONF: "yes",
}
end
def enable
if $LOCAL_PHP == "yes"
super
else
log_return("PHP from brepo repository not enabled")
end
end
def get_list_of_installed_php
php_list = []
lst = Dir["/opt/brepo/php*/etc/php.ini"]
if lst.length.positive?
php_list = lst.select do |item|
%r{/opt/brepo/php\d+/etc/php\.ini} =~ item
end.map do |item|
res = item.match %r{/opt/brepo/php(?<ver>\d+)/etc/php\.ini}
res[:ver]
end
end
php_list
end
def get_list_of_installed_php_modules(php_ver)
php_modules = {}
php_list = get_list_of_installed_php
if php_list.include? php_ver
lst = Dir["/opt/brepo/php#{php_ver}/etc/mod-installed/*.ini"]
php_list_m = lst.map { |item| File.basename(item, ".ini") }.select { |item| item.strip != "" && !(item =~ %r{ioncube_loader_lin_}) }
lst_enabled = Dir["/opt/brepo/php#{php_ver}/etc/php.d/*.ini"]
php_list_i = {}
lst_enabled.each do |item|
fname = File.basename(item, ".ini")
if fname.strip != ""
if File.symlink? item
fname_n = File.readlink(item)
fname_n = File.basename(fname_n, ".ini")
php_list_i[fname_n] = fname unless fname_n.strip == ""
end
end
end
php_list_m.each do |item|
php_modules[item] = "disabled"
php_modules[item] = php_list_i[item] unless php_list_i[item].nil?
end
end
php_modules
end
def get_php_module_description(module_name)
case module_name
when "bcmath"
"Модуль математических операций с числами произвольной точности"
when "curl"
"Поддержка curl функций из библиотеки libcurl"
when "dba"
"Эти функции — основа для доступа к базам данных наподобие Berkeley DB"
when "dom"
"Модуль DOM разрешает работать в PHP с XML- и HTML-документами через DOM API"
when "gd"
"Функции работы с изображениями"
when "imap"
"Эти функции позволяют работать с протоколом IMAP, а также NNTP, POP3 и локальными методами доступа к почтовому ящику."
when "intl"
"Модуль интернационализации"
when "ioncube"
"Модуль котрый производит деобфускацию кода, написанного на языке php и закодированного утилитами из набора ioncube"
when "ioncube_loader_lin_7.4"
"Модуль котрый производит деобфускацию кода, написанного на языке php и закодированного утилитами из набора ioncube"
when "json"
"Поддержка json в PHP"
when "ldap"
"Поддержка работы с LDAP в PHP"
when "mbstring"
"Поддержка работы с многобайтовыми строками"
when "memcache"
"Модуль Memcache предоставляет удобный процедурный и объектно-ориентированный интерфейс к memcached, высокоэффективному кеширующему демону, который был специально разработан для снижения нагрузки на базу данных в динамических веб приложениях"
when "mysqli"
"Модуль mysqli позволяет вам получить доступ к функциональности, которую предоставляет MySQL версии 4.1 и выше"
when "mysqlnd"
"Встроенный драйвер MySQL"
when "odbc"
"В дополнение к обычной поддержке ODBC, функции Unified ODBC в PHP позволяют получить доступ к нескольким базам данных, которые позаимствовали семантику ODBC API для реализации своего собственного API."
when "opcache"
"Модуль OPcache сохраняет предкомпилированный байт-код скриптов в разделяемой памяти. Кеширование операционного PHP-кода повышает производительность и помогает избегать загрузки и анализа скриптов при каждом запросе."
when "pdo"
"Модуль PDO определяет легковесный и непротиворечивый интерфейс доступа к базам данных в PHP."
when "pdo_dblib"
"PDO_DBLIB: драйвер модуля PDO для СУБД Microsoft SQL Server и Sybase"
when "pdo_mysql"
"PDO_MYSQL: драйвер модуля PDO для СУБД MySQL"
when "pdo_odbc"
"PDO_ODBC: драйвер модуля PDO для СУБД ODBC и DB2"
when "pdo_pgsql"
"PDO_PGSQL: драйвер модуля PDO для СУБД PostgreSQL"
when "pdo_sqlite"
"PDO_SQLITE: драйвер модуля PDO для СУБД SQLite"
when "pgsql"
"Модуль поддержки взаимодействия PHP с PostgreSQL"
when "phar"
"Модуль phar предоставляет возможность поместить целое PHP-приложение в один-единственный файл c именем phar (PHP Archive) для простого распространения и установки"
when "posix"
"Этот модуль содержит интерфейс к функциям, определённым в стандарте IEEE 1003.1 (POSIX.1), которые не доступны с помощью других средств."
when "pspell"
"Функции позволяют проверять правописание слова и предлагают варианты исправления."
when "snmp"
"Модуль SNMP предоставляет простой и удобный набор инструментов для управления удалёнными устройствами через Simple Network Management Protocol (простой протокол управления сетями)"
when "soap"
"Модуль SOAP может использоваться для написания как серверной, так и клиентской части. Он реализует спецификации » SOAP 1.1, » SOAP 1.2 и » WSDL 1.1."
when "sodium"
"Sodium — современная, простая в работе программная библиотека для шифрования и дешифрования данных, выполнения операций с подписями, хеширования паролей и других криптографических целей"
when "sysvmsg"
"Модуль поддержки сообщений System V"
when "sysvsem"
"Поддержка семафоров"
when "sysvshm"
"Поддержка разделяемой памяти"
when "tidy"
"Модуль коррекции разметки tidy"
when "xmlreader"
"Модуль XMLReader — синтаксический анализатор XML-документов"
when "xmlrpc"
"Функции модуля помогают писать клиентский или серверный код по правилам стандарта XML-RPC"
when "xmlwriter"
"Модуль XMLWriter оборачивает API-интерфейс парсера xmlWriter, который входит в состав модуля libxml."
when "xsl"
"Модуль XSL реализует XSL-стандарт путём XSLT-преобразований, которые выполняет через библиотеку libxslt"
when "zip"
"Модуль позволяет легко читать и записывать как в сами сжатые ZIP-архивы, так и в файлы внутри них"
else
"нет описания"
end
end
def disable_module(php_ver, module_name)
php_mods = get_list_of_installed_php_modules(php_ver)
return if php_mods[module_name].nil?
if File.exist? ("/opt/brepo/php#{php_ver}/etc/php.d/#{php_mods[module_name]}.ini")
File.unlink("/opt/brepo/php#{php_ver}/etc/php.d/#{php_mods[module_name]}.ini")
end
end
def enable_module(php_ver, module_name)
php_mods = get_list_of_installed_php_modules(php_ver)
return if php_mods[module_name].nil?
if php_mods[module_name] == "disabled"
case module_name
when "opcache"
File.symlink("/opt/brepo/php#{php_ver}/etc/mod-installed/#{module_name}.ini", "/opt/brepo/php#{php_ver}/etc/php.d/10-#{module_name}.ini")
when "mysqli", "pdo_mysql", "xmlreader", "zip"
File.symlink("/opt/brepo/php#{php_ver}/etc/mod-installed/#{module_name}.ini", "/opt/brepo/php#{php_ver}/etc/php.d/30-#{module_name}.ini")
else
File.symlink("/opt/brepo/php#{php_ver}/etc/mod-installed/#{module_name}.ini", "/opt/brepo/php#{php_ver}/etc/php.d/20-#{module_name}.ini")
end
end
end
def command(args)
return log_return("Not enough arguments. Needed command") if args.length < 1
m_command = args[0].strip
case m_command
when "php_list"
result = get_list_of_installed_php.map { |item| { "PHPVER" => item } }
format = (args[1].nil? ? "shell" : args[1].strip)
hestia_print_array_of_hashes(result, format, "PHPVER")
ACTION_OK
when "php_modules"
vers = args[1]
if vers.nil?
log_return("Verssion should be specified. #{args}")
else
vers = vers.strip
modules_list = get_list_of_installed_php_modules(vers)
m_keys = modules_list.keys.sort
result = []
m_keys.each do |kk|
tmp_hash = {}
tmp_hash["PHPVER"] = vers
tmp_hash["MODNAME"] = kk
tmp_hash["STATE"] = modules_list[kk]
tmp_hash["DESCR"] = get_php_module_description(kk)
result << tmp_hash
end
format = (args[2].nil? ? "shell" : args[2].strip)
hestia_print_array_of_hashes(result, format, "PHPVER,MODNAME,STATE,DESCR")
ACTION_OK
end
when "php_enable"
vers = args[1]
mod_n = args[2]
if vers.nil? || mod_n.nil?
log_return("Verssion and module name should be specified. #{args}")
else
vers = vers.strip
mod_n = mod_n.strip
enable_module(vers, mod_n)
ACTION_OK
end
when "php_disable"
vers = args[1]
mod_n = args[2]
if vers.nil? || mod_n.nil?
log_return("Verssion and module name should be specified. #{args}")
else
vers = vers.strip
mod_n = mod_n.strip
disable_module(vers, mod_n)
ACTION_OK
end
when "help"
puts "#{$0} php_brepo_modules COMMAND [OPTIONS] [json|csv|plain]"
puts "COMMANDS:"
puts " php_list - list all local php installed"
puts " php_modules [php_ver] - list available php module"
puts " php_enable [php_ver] [module_name] - enable php module"
puts " php_disable [php_ver] [module_name] - disable php module"
puts " help - help"
ACTION_OK
else
log_return("Unknown command. #{args}")
end
end
implements IPluginInterface
end
module EmptyModule
def get_object
Proc.new { EmptyWorker.new }
end
module_function :get_object
end
class Kernel::PluginConfiguration
include EmptyModule
@@loaded_plugins[EmptyWorker::MODULE_ID] = EmptyModule.get_object
end

View File

@@ -1,47 +1,53 @@
{ {
"name": "filegator/filegator", "name": "filegator/filegator",
"description": "Filegator", "description": "Filegator",
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"config": { "repositories": [
"platform": { {
"php": "7.2.5" "type": "git",
} "url": "https://dev.brepo.ru/brepo/phpquoteshellarg.git"
}, }
"require": { ],
"php": "^7.2", "config": {
"monolog/monolog": "^1.24", "platform": {
"nikic/fast-route": "^1.3", "php": "8.1"
"symfony/security-csrf": "^4.4", }
"symfony/http-foundation": "^4.4", },
"dibi/dibi": "^4.1", "require": {
"php-di/php-di": "^6.0", "php": "^8.1",
"rakit/validation": "^1.1", "monolog/monolog": "^1.24",
"league/flysystem": "^1.1", "nikic/fast-route": "^1.3",
"league/flysystem-ziparchive": "^1.0", "symfony/security-csrf": "^4.4",
"league/flysystem-sftp": "^1.0", "symfony/http-foundation": "^4.4",
"hestiacp/phpquoteshellarg": "^1.0" "dibi/dibi": "^4.1",
}, "php-di/php-di": "^6.0",
"authors": [ "rakit/validation": "^1.1",
{ "league/flysystem": "^1.1",
"name": "Milos Stojanovic", "league/flysystem-ziparchive": "^1.0",
"email": "alcalbg@gmail.com" "league/flysystem-sftp": "^1.0",
} "brepo/phpquoteshellarg": "dev-master"
], },
"autoload": { "authors": [
"psr-4": { {
"Filegator\\": "backend" "name": "Milos Stojanovic",
} "email": "alcalbg@gmail.com"
}, }
"autoload-dev": { ],
"psr-4": { "autoload": {
"Tests\\": "tests/backend/" "psr-4": {
} "Filegator\\": "backend"
}, }
"require-dev": { },
"phpunit/phpunit": "^8.0", "autoload-dev": {
"symfony/var-dumper": "^4.4", "psr-4": {
"league/flysystem-memory": "^1.0", "Tests\\": "tests/backend/"
"phpstan/phpstan": "^0.11.8" }
} },
"require-dev": {
"phpunit/phpunit": "^8.0",
"symfony/var-dumper": "^4.4",
"league/flysystem-memory": "^1.0",
"phpstan/phpstan": "^2.0.3"
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1
install/hst-install-rhel.sh Symbolic link
View File

@@ -0,0 +1 @@
hst-install.sh

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
UpdateLogFile /var/log/freshclam.log
DatabaseMirror database.clamav.net
ScriptedUpdates no
LogFileMaxSize 80M
LogTime yes
#LogVerbose yes
LogRotate yes
#PidFile /var/run/freshclam.pid
# By default when started freshclam drops privileges and switches to the
# "clamav" user. This directive allows you to change the database owner.
# Default: clamav (may depend on installation options)
DatabaseOwner clamav
DatabaseDirectory /var/lib/clamavnew

View File

@@ -1,47 +1,53 @@
{ {
"name": "filegator/filegator", "name": "filegator/filegator",
"description": "Filegator", "description": "Filegator",
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"config": { "repositories": [
"platform": { {
"php": "7.2.5" "type": "git",
} "url": "https://dev.brepo.ru/brepo/phpquoteshellarg.git"
}, }
"require": { ],
"php": "^7.2", "config": {
"monolog/monolog": "^1.24", "platform": {
"nikic/fast-route": "^1.3", "php": "8.1"
"symfony/security-csrf": "^4.4", }
"symfony/http-foundation": "^4.4", },
"dibi/dibi": "^4.1", "require": {
"php-di/php-di": "^6.0", "php": "^8.1",
"rakit/validation": "^1.1", "monolog/monolog": "^1.24",
"league/flysystem": "^1.1", "nikic/fast-route": "^1.3",
"league/flysystem-ziparchive": "^1.0", "symfony/security-csrf": "^4.4",
"league/flysystem-sftp": "^1.0", "symfony/http-foundation": "^4.4",
"hestiacp/phpquoteshellarg": "^1.0" "dibi/dibi": "^4.1",
}, "php-di/php-di": "^6.0",
"authors": [ "rakit/validation": "^1.1",
{ "league/flysystem": "^1.1",
"name": "Milos Stojanovic", "league/flysystem-ziparchive": "^1.0",
"email": "alcalbg@gmail.com" "league/flysystem-sftp": "^1.0",
} "brepo/phpquoteshellarg": "dev-master"
], },
"autoload": { "authors": [
"psr-4": { {
"Filegator\\": "backend" "name": "Milos Stojanovic",
} "email": "alcalbg@gmail.com"
}, }
"autoload-dev": { ],
"psr-4": { "autoload": {
"Tests\\": "tests/backend/" "psr-4": {
} "Filegator\\": "backend"
}, }
"require-dev": { },
"phpunit/phpunit": "^8.0", "autoload-dev": {
"symfony/var-dumper": "^4.4", "psr-4": {
"league/flysystem-memory": "^1.0", "Tests\\": "tests/backend/"
"phpstan/phpstan": "^0.11.8" }
} },
"require-dev": {
"phpunit/phpunit": "^8.0",
"symfony/var-dumper": "^4.4",
"league/flysystem-memory": "^1.0",
"phpstan/phpstan": "^2.0.3"
}
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,6 @@
[hestiacp] [hectiacp]
name=msvsphere9 repo on repo.brepo.ru name=RPM Alma Rocky 9 hestia repo on repo.brepo.ru
comment=msvsphere9 repo on repo.brepo.ru baseurl=https://repo.brepo.ru/hestia/
baseurl=https://repo.brepo.ru/repo/msvsphere9_preprod
enabled=1 enabled=1
gpgkey=https://repo.brepo.ru/repo/gpgkeys/repo.brepo.ru.pub gpgkey=https://repo.brepo.ru/hestia/brepo_projects-gpg-key
gpgcheck=1 gpgcheck=1

View File

@@ -0,0 +1,3 @@
<IfModule mpm_prefork_module>
LoadModule mpm_itk_module modules/mod_mpm_itk.so
</IfModule>

View File

@@ -30,6 +30,8 @@ server {
try_files $uri $uri/ =404; try_files $uri $uri/ =404;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ { location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
@@ -39,6 +41,8 @@ server {
} }
location @fallback { location @fallback {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
} }

View File

@@ -20,6 +20,8 @@ server {
} }
location / { location / {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass http://%ip%:%web_port%; proxy_pass http://%ip%:%web_port%;
} }

View File

@@ -30,6 +30,9 @@ server {
try_files $uri $uri/ =404; try_files $uri $uri/ =404;
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ { location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
@@ -39,6 +42,8 @@ server {
} }
location @fallback { location @fallback {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
} }

View File

@@ -18,6 +18,13 @@
CustomLog /var/log/%web_system%/domains/%domain%.log combined CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log ErrorLog /var/log/%web_system%/domains/%domain%.error.log
<Directory %sdocroot%> <Directory %sdocroot%>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
Require all denied
</FilesMatch>
AllowOverride All AllowOverride All
SSLRequireSSL SSLRequireSSL
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes +ExecCGI

View File

@@ -21,6 +21,13 @@
IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf* IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf*
<Directory %docroot%> <Directory %docroot%>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
Require all denied
</FilesMatch>
AllowOverride All AllowOverride All
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp php_admin_value open_basedir %docroot%:%home%/%user%/tmp

View File

@@ -0,0 +1,41 @@
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
<VirtualHost %ip%:%web_ssl_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %sdocroot%
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
#SuexecUserGroup %user% %group%
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
<Location />
Require all denied
</Location>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile %ssl_crt%
SSLCertificateKeyFile %ssl_key%
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
<IfModule mod_ruid2.c>
RMode config
RUidGid %user% %group%
RGroups apache
</IfModule>
<IfModule mpm_itk.c>
AssignUserID %user% %group%
</IfModule>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

View File

@@ -0,0 +1,38 @@
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
<VirtualHost %ip%:%web_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %docroot%
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
#SuexecUserGroup %user% %group%
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf*
<Location />
Require all denied
</Location>
<IfModule mod_ruid2.c>
RMode config
RUidGid %user% %group%
RGroups apache
</IfModule>
<IfModule mpm_itk.c>
AssignUserID %user% %group%
</IfModule>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

View File

@@ -18,6 +18,13 @@
CustomLog /var/log/%web_system%/domains/%domain%.log combined CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log ErrorLog /var/log/%web_system%/domains/%domain%.error.log
<Directory %sdocroot%> <Directory %sdocroot%>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
Require all denied
</FilesMatch>
AllowOverride All AllowOverride All
SSLRequireSSL SSLRequireSSL
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes +ExecCGI

View File

@@ -21,6 +21,13 @@
IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf* IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf*
<Directory %docroot%> <Directory %docroot%>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
Require all denied
</FilesMatch>
AllowOverride All AllowOverride All
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes +ExecCGI
php_admin_value upload_max_filesize 10M php_admin_value upload_max_filesize 10M

View File

@@ -0,0 +1,32 @@
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
<VirtualHost %ip%:%web_ssl_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %sdocroot%
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
#SuexecUserGroup %user% %group%
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
<Location />
Require all denied
</Location>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile %ssl_crt%
SSLCertificateKeyFile %ssl_key%
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

View File

@@ -0,0 +1,30 @@
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
<VirtualHost %ip%:%web_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %docroot%
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
#SuexecUserGroup %user% %group%
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
IncludeOptional %home%/%user%/conf/web/%domain%/apache2.forcessl.conf*
<Location />
Require all denied
</Location>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost>

View File

@@ -1,16 +1,26 @@
#!/bin/bash #!/usr/bin/bash
# Adding php wrapper # Adding php wrapper
user="$1" user="$1"
domain="$2" domain="$2"
ip="$3" ip="$3"
home_dir="$4" home_dir="$4"
docroot="$5" docroot="$5"
php_path="$6"
wrapper_script='#!/usr/bin/php-cgi -cphp5-cgi.ini' wrapper_script="#!$php_path -cphp5-cgi.ini"
wrapper_file="$home_dir/$user/web/$domain/cgi-bin/php" wrapper_file="$home_dir/$user/web/$domain/cgi-bin/php"
wrapper_dir="/var/www/$user/$domain/cgi-bin"
wrapper_file2="$wrapper_dir/php"
echo "$wrapper_script" > $wrapper_file echo "$wrapper_script" > $wrapper_file
chown $user:$user $wrapper_file chown $user:$user $wrapper_file
chmod -f 751 $wrapper_file chmod -f 751 $wrapper_file
mkdir -p $wrapper_dir
echo "$wrapper_script" > $wrapper_file2
chown $user:$user $wrapper_file2
chown $user:$user $wrapper_dir
chmod -f 751 $wrapper_file2
exit 0 exit 0

View File

@@ -10,7 +10,8 @@
%alias_string% %alias_string%
ServerAdmin %email% ServerAdmin %email%
DocumentRoot %sdocroot% DocumentRoot %sdocroot%
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ #ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
ScriptAlias /cgi-bin/ /var/www/%user%/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/ Alias /error/ %home%/%user%/web/%domain%/document_errors/
SuexecUserGroup %user% %group% SuexecUserGroup %user% %group%

View File

@@ -10,7 +10,8 @@
%alias_string% %alias_string%
ServerAdmin %email% ServerAdmin %email%
DocumentRoot %docroot% DocumentRoot %docroot%
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ #ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
ScriptAlias /cgi-bin/ /var/www/%user%/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/ Alias /error/ %home%/%user%/web/%domain%/document_errors/
SuexecUserGroup %user% %group% SuexecUserGroup %user% %group%

View File

@@ -1,22 +1,32 @@
#!/bin/bash #!/usr/bin/bash
# Adding php wrapper # Adding php wrapper
user="$1" user="$1"
domain="$2" domain="$2"
ip="$3" ip="$3"
home_dir="$4" home_dir="$4"
docroot="$5" docroot="$5"
php_path="$6"
wrapper_script="#!/bin/sh wrapper_script="#!/bin/sh
PHPRC=/usr/local/lib PHPRC=/usr/local/lib
export PHPRC export PHPRC
export PHP_FCGI_MAX_REQUESTS=1000 export PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN=20 export PHP_FCGI_CHILDREN=20
exec /usr/bin/php-cgi exec $php_path
" "
wrapper_file="$home_dir/$user/web/$domain/cgi-bin/fcgi-starter" wrapper_file="$home_dir/$user/web/$domain/cgi-bin/fcgi-starter"
wrapper_dir="/var/www/$user/$domain/cgi-bin"
wrapper_file2="$wrapper_dir/fcgi-starter"
echo "$wrapper_script" > $wrapper_file echo "$wrapper_script" > $wrapper_file
chown $user:$user $wrapper_file chown $user:$user $wrapper_file
chmod -f 751 $wrapper_file chmod -f 751 $wrapper_file
mkdir -p $wrapper_dir
echo "$wrapper_script" > $wrapper_file2
chown $user:$user $wrapper_file2
chown $user:$user $wrapper_dir
chmod -f 751 $wrapper_file2
exit 0 exit 0

View File

@@ -28,7 +28,8 @@
<Files *.php> <Files *.php>
SetHandler fcgid-script SetHandler fcgid-script
</Files> </Files>
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php #FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
FCGIWrapper /var/www/%user%/%domain%/cgi-bin/fcgi-starter .php
</Directory> </Directory>
<Directory %home%/%user%/web/%domain%/stats> <Directory %home%/%user%/web/%domain%/stats>
AllowOverride All AllowOverride All
@@ -42,4 +43,5 @@
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_* IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
IncludeOptional /etc/httpd/conf.h.d/*.inc IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost> </VirtualHost>

View File

@@ -30,11 +30,13 @@
<Files *.php> <Files *.php>
SetHandler fcgid-script SetHandler fcgid-script
</Files> </Files>
FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php #FCGIWrapper %home%/%user%/web/%domain%/cgi-bin/fcgi-starter .php
FCGIWrapper /var/www/%user%/%domain%/cgi-bin/fcgi-starter .php
</Directory> </Directory>
<Directory %home%/%user%/web/%domain%/stats> <Directory %home%/%user%/web/%domain%/stats>
AllowOverride All AllowOverride All
</Directory> </Directory>
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_* IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
IncludeOptional /etc/httpd/conf.h.d/*.inc IncludeOptional /etc/httpd/conf.h.d/*.inc
</VirtualHost> </VirtualHost>

View File

@@ -19,6 +19,13 @@
CustomLog /var/log/%web_system%/domains/%domain%.log combined CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log ErrorLog /var/log/%web_system%/domains/%domain%.error.log
<Directory %sdocroot%> <Directory %sdocroot%>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
Require all denied
</FilesMatch>
AllowOverride All AllowOverride All
SSLRequireSSL SSLRequireSSL
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes +ExecCGI

View File

@@ -22,6 +22,13 @@
IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf* IncludeOptional %home%/%user%/conf/web/%domain%/forcessl.apache2.conf*
<Directory %docroot%> <Directory %docroot%>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
Require all denied
</FilesMatch>
AllowOverride All AllowOverride All
Options +Includes -Indexes +ExecCGI Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp php_admin_value open_basedir %docroot%:%home%/%user%/tmp

View File

@@ -27,6 +27,8 @@ server {
} }
location / { location / {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
proxy_cache %domain%; proxy_cache %domain%;
@@ -64,6 +66,8 @@ server {
} }
location @fallback { location @fallback {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
} }

View File

@@ -26,6 +26,8 @@ server {
} }
location / { location / {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
location ~* ^.+\.(%proxy_extensions%)$ { location ~* ^.+\.(%proxy_extensions%)$ {
@@ -40,6 +42,8 @@ server {
} }
location @fallback { location @fallback {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
} }

View File

@@ -26,6 +26,8 @@ server {
} }
location / { location / {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
location ~* ^.+\.(%proxy_extensions%)$ { location ~* ^.+\.(%proxy_extensions%)$ {
@@ -40,6 +42,8 @@ server {
} }
location @fallback { location @fallback {
proxy_ssl_server_name on;
proxy_ssl_name $host;
proxy_pass https://%ip%:%web_ssl_port%; proxy_pass https://%ip%:%web_ssl_port%;
} }

View File

@@ -0,0 +1,66 @@
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
server {
listen %ip%:%proxy_ssl_port% ssl;
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_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
ssl_stapling on;
ssl_stapling_verify on;
# TLS 1.3 0-RTT anti-replay
if ($anti_replay = 307) { return 307 https://$host$request_uri; }
if ($anti_replay = 425) { return 425; }
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
HtaccessEnable on;
location ~ /\.(?!well-known\/) {
deny all;
return 404;
}
location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js|txt)$ {
expires max;
fastcgi_hide_header "Set-Cookie";
}
location / {
RewriteEngine On;
location ~ [^/]\.php(/|$) {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
}
}
location /vstats/ {
alias %home%/%user%/web/%domain%/stats/;
include %home%/%user%/web/%domain%/stats/auth.conf*;
}
proxy_hide_header Upgrade;
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
}

View File

@@ -0,0 +1,53 @@
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
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;
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
HtaccessEnable on;
location ~ /\.(?!well-known\/) {
deny all;
return 404;
}
location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js|txt)$ {
expires max;
fastcgi_hide_header "Set-Cookie";
}
location / {
RewriteEngine On;
location ~ [^/]\.php(/|$) {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
}
}
location /vstats/ {
alias %home%/%user%/web/%domain%/stats/;
include %home%/%user%/web/%domain%/stats/auth.conf*;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
}

View File

@@ -0,0 +1,64 @@
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
server {
listen %ip%:%proxy_ssl_port% ssl;
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_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
ssl_stapling on;
ssl_stapling_verify on;
# TLS 1.3 0-RTT anti-replay
if ($anti_replay = 307) { return 307 https://$host$request_uri; }
if ($anti_replay = 425) { return 425; }
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
location ~ /\.(?!well-known\/) {
deny all;
return 404;
}
location / {
try_files $uri $uri/ /index.php?$args;
location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ {
expires max;
fastcgi_hide_header "Set-Cookie";
}
location ~ [^/]\.php(/|$) {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
}
}
location /vstats/ {
alias %home%/%user%/web/%domain%/stats/;
include %home%/%user%/web/%domain%/stats/auth.conf*;
}
proxy_hide_header Upgrade;
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
}

View File

@@ -0,0 +1,51 @@
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
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;
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
location ~ /\.(?!well-known\/) {
deny all;
return 404;
}
location / {
try_files $uri $uri/ /index.php?$args;
location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ {
expires max;
fastcgi_hide_header "Set-Cookie";
}
location ~ [^/]\.php(/|$) {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
}
}
location /vstats/ {
alias %home%/%user%/web/%domain%/stats/;
include %home%/%user%/web/%domain%/stats/auth.conf*;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
}

View File

@@ -35,7 +35,7 @@ UPGRADE_RESTART_SERVICES='true'
####################################################################################### #######################################################################################
# Supported PHP versions # Supported PHP versions
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2") multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2" "8.3" "8.4" "8.5")
####################################################################################### #######################################################################################
####### 3rd Party Software Updates ####### ####### 3rd Party Software Updates #######
@@ -43,7 +43,7 @@ multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
# Check if update is required by matching versions if version != current version run update # Check if update is required by matching versions if version != current version run update
# Set version of phpMyAdmin to install during upgrade if not already installed # Set version of phpMyAdmin to install during upgrade if not already installed
pma_v='5.2.1' pma_v='5.2.3'
# Set version of phppgadmin to install during upgrade if not already installed # Set version of phppgadmin to install during upgrade if not already installed
pga_v='7.14.4' pga_v='7.14.4'

View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Hestia Control Panel upgrade script for target version 1.9.3
#######################################################################################
####### Place additional commands below. #######
#######################################################################################
####### upgrade_config_set_value only accepts true or false. #######
####### #######
####### Pass through information to the end user in case of a issue or problem #######
####### #######
####### Use add_upgrade_message "My message here" to include a message #######
####### in the upgrade notification email. Example: #######
####### #######
####### add_upgrade_message "My message here" #######
####### #######
####### You can use \n within the string to create new lines. #######
#######################################################################################
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'true'
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'true'
upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'no'

View File

@@ -0,0 +1,169 @@
#!/opt/brepo/ruby33/bin/ruby
require 'json'
# Файл конфигурации Hestia
config_file = '/usr/local/hestia/conf/hestia.conf'
# Проверяем наличие строки LOCAL_PHP и её значение. Если она отсутствует или не равна 'yes', добавляем или заменяем её.
def ensure_local_php_enabled(config_file)
if File.exist?(config_file)
lines = File.readlines(config_file)
found = false
# Обрабатываем каждую строку
new_lines = lines.map do |line|
if line.strip.start_with?("LOCAL_PHP=")
found = true
"LOCAL_PHP='yes'"
else
line
end
end
# Если строки LOCAL_PHP не было найдено, добавляем её в конец файла
unless found
new_lines << "LOCAL_PHP='yes'\n"
end
# Записываем изменения обратно в файл
File.open(config_file, 'w') do |file|
file.puts new_lines
end
else
# Если файла не существует, создаём его и добавляем строку LOCAL_PHP='yes'
File.write(config_file, "LOCAL_PHP='yes'\n")
end
end
# Вызываем утилиту и разбираем JSON-ответ для получения списка установленных версий PHP
def get_installed_php_versions
output = `v-list-web-templates-backend json`
json_data = JSON.parse(output)
json_data.select { |version| version.start_with?("PHP-") }
end
# Вызываем утилиту и разбираем JSON-ответ для получения списка пользователей
def get_hestia_users
output = `v-list-users json`
json_data = JSON.parse(output)
json_data.keys # Возвращаем только ключи (имена пользователей)
end
# Вызываем утилиту и разбираем JSON-ответ для получения списка доменов пользователя
def get_user_domains(user)
output = `v-list-web-domains #{user} json`
json_data = JSON.parse(output)
json_data # Возвращаем весь хэш с доменами
end
# Функция для получения корректной версии PHP
def get_correct_php_version(system_php_version)
if system_php_version.length < 2
"8.2"
else
"#{system_php_version[0]}.#{system_php_version[1]}"
end
end
# Основная часть программы
begin
system_php_version = `php -r "echo str_replace('.', '', substr(phpversion(), 0, 3));"`
ensure_local_php_enabled(config_file)
INSTALLED_PHP_LIST = get_installed_php_versions
puts "Установленные версии PHP: #{INSTALLED_PHP_LIST.join(', ')}"
# Обрабатываем каждый элемент массива INSTALLED_PHP_LIST
INSTALLED_PHP_LIST.each do |php_version|
# Удаляем префикс 'PHP-' и остаёмся только с цифрами
version_number = php_version.gsub(/^PHP-/, '')
# Вызываем команду v-add-web-php с номером версии PHP
puts "Выполняем команду: v-add-web-php #{version_number}"
system("v-add-web-php", version_number)
end
# Получаем список пользователей Hestia
HESTIA_USERS_LIST = get_hestia_users
puts "Список пользователей Hestia: #{HESTIA_USERS_LIST.join(', ')}"
# Для каждого пользователя из списка выполняем действия с доменами
HESTIA_USERS_LIST.each do |user|
puts "Обрабатываем пользователя: #{user}"
# Получаем список доменов для текущего пользователя
user_domains = get_user_domains(user)
# Обрабатываем каждый домен и изменяем шаблон бэкенда
user_domains.each do |domain, details|
current_domain = domain
current_backend = details['BACKEND']
puts "Обрабатываем домен: #{current_domain}, текущий бэкенд: #{current_backend}"
# Вызываем команду для изменения шаблона бэкенда
command = ["v-change-web-domain-backend-tpl", user, current_domain, current_backend]
puts "Выполняем команду: #{command.join(' ')}"
system(*command)
end
end
# Перенастраиваем alternatives для новго PHP
correct_php_version = get_correct_php_version(system_php_version)
puts "Перенастраиваем PHP на новый путь командой: v-change-sys-php #{correct_php_version}"
system("v-change-sys-php", system_php_version)
# Список регулярных выражений для поиска пакетов, которые нужно удалить
patterns_to_remove = [
/^php\d{2}-runtime-.*$/,
/^php\d{2}-php/
]
# Получаем список установленных пакетов на системе
installed_packages = `yum list installed | grep remi`.split("\n").map { |line| line.split.first }
# Фильтруем подходящие пакеты для удаления
packages_to_remove = []
patterns_to_remove.each do |pattern|
installed_packages.each do |package|
if package.match?(pattern)
packages_to_remove << package
end
end
end
if packages_to_remove.empty?
puts "Нет подходящих пакетов для удаления."
else
puts "Следующие пакеты будут удалены:"
packages_to_remove.each_with_index { |package, index| puts "#{index + 1}. #{package}" }
print "\nВы уверены, что хотите удалить эти пакеты? (y/n): "
response = gets.chomp.downcase
if response == 'y'
# Формируем команду для удаления всех пакетов одной командой
remove_command = "yum remove -y #{packages_to_remove.join(' ')}"
system(remove_command)
puts "\nОперация завершена. Пакеты были успешно удалены."
else
puts "\nУдаление отменено пользователем."
end
end
# Перезапустим все PHP-FPM
INSTALLED_PHP_LIST.each do |php_version|
# Удаляем префикс 'PHP-' и остаёмся только с цифрами
version_number = php_version.gsub(/^PHP-/, '')
puts "Выполняем команду: systemctl restart brepo-php-fpm#{version_number}"
system("systemctl", "restart", "brepo-php-fpm#{version_number}")
end
rescue => e
puts "Произошла ошибка: #{e.message}"
end

View File

@@ -1,7 +1,7 @@
{ {
"name": "hestia", "name": "hestia",
"private": true, "private": true,
"version": "1.9.2.rpm", "version": "1.9.6.rpm",
"description": "An open-source Linux web server control panel.", "description": "An open-source Linux web server control panel.",
"repository": "https://github.com/hestiacp/hestiacp", "repository": "https://github.com/hestiacp/hestiacp",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",

View File

@@ -335,7 +335,7 @@ if [ "$dontinstalldeps" != 'true' ]; then
echo "Installing dependencies for compilation..." echo "Installing dependencies for compilation..."
dnf install -y -q $SOFTWARE dnf install -y -q $SOFTWARE
mock -r msvsphere+epel-${release}-$BUILD_ARCH --clean mock -r alma+epel-${release}-$BUILD_ARCH --clean
else else
# Set package dependencies for compiling # Set package dependencies for compiling
SOFTWARE='wget tar git curl build-essential libxml2-dev libz-dev libzip-dev libgmp-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config libsqlite3-dev libonig-dev rpm lsb-release' SOFTWARE='wget tar git curl build-essential libxml2-dev libz-dev libzip-dev libgmp-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config libsqlite3-dev libonig-dev rpm lsb-release'
@@ -536,7 +536,7 @@ if [ "$NGINX_B" = true ]; then
# Build the package # Build the package
echo Building Nginx RPM echo Building Nginx RPM
mock -r msvsphere+epel-${release}-$BUILD_ARCH --sources $BUILD_DIR --spec $BUILD_DIR/hestia-nginx.spec --resultdir $RPM_DIR mock -r alma+epel-${release}-$BUILD_ARCH --sources $BUILD_DIR --spec $BUILD_DIR/hestia-nginx.spec --resultdir $RPM_DIR
rm -f $BUILD_DIR/* rm -f $BUILD_DIR/*
fi fi
fi fi
@@ -674,7 +674,7 @@ if [ "$PHP_B" = true ]; then
# Build RPM package # Build RPM package
echo Building PHP RPM echo Building PHP RPM
mock -r msvsphere+epel-${release}-$BUILD_ARCH --sources $BUILD_DIR --spec $BUILD_DIR/hestia-php.spec --resultdir $RPM_DIR mock -r alma+epel-${release}-$BUILD_ARCH --sources $BUILD_DIR --spec $BUILD_DIR/hestia-php.spec --resultdir $RPM_DIR
rm -f $BUILD_DIR/* rm -f $BUILD_DIR/*
fi fi
fi fi
@@ -792,7 +792,7 @@ if [ "$HESTIA_B" = true ]; then
# Build RPM package # Build RPM package
echo Building Hestia RPM echo Building Hestia RPM
mock -r msvsphere+epel-${release}-$BUILD_ARCH --sources $BUILD_DIR --spec $BUILD_DIR/hestia.spec --resultdir $RPM_DIR mock -r alma+epel-${release}-$BUILD_ARCH --sources $BUILD_DIR --spec $BUILD_DIR/hestia.spec --resultdir $RPM_DIR
rm -f $BUILD_DIR/* rm -f $BUILD_DIR/*
fi fi

View File

@@ -2,8 +2,8 @@
%global _hardened_build 1 %global _hardened_build 1
Name: hestia Name: hestia
Version: 1.9.2 Version: 1.9.6
Release: 1%{dist} Release: 9%{dist}
Summary: Hestia Control Panel Summary: Hestia Control Panel
Group: System Environment/Base Group: System Environment/Base
License: GPLv3 License: GPLv3
@@ -36,8 +36,7 @@ Requires(post): systemd
Requires(preun): systemd Requires(preun): systemd
Requires(postun): systemd Requires(postun): systemd
Requires: ruby Requires: ruby
Requires: puppet Requires: ansible-core
Requires: puppet-stdlib
Provides: hestia = %{version}-%{release} Provides: hestia = %{version}-%{release}
Conflicts: redhat-release < 8 Conflicts: redhat-release < 8
@@ -184,8 +183,50 @@ fi
%{_tmpfilesdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf
%changelog %changelog
* Sun Jan 05 2025 Alexey Berezhok <a@bayrepo.ru> - 1.9.2-1 * Sun Mar 29 2026 Alexey Berezhok <a@bayrepo.ru> - 1.9.6-9
- Added support ansible instead of puppet
* Fri Mar 27 2026 Alexey Berezhok <a@bayrepo.ru> - 1.9.6-8
- Fixed installation of panel without PHP-FPM
- Fixed mod_php, fcgid, fcgi mode
* Thu Mar 26 2026 Alexey Berezhok <a@bayrepo.ru> - 1.9.6-6
- Fixed database size usage and disk usage output on the info pages
* Thu Mar 19 2026 Alexey Berezhok <a@bayrepo.ru> - 1.9.6-5
- Added nginx with mod_rewrite
- Added templates for nginx mod_rewrite activation
* Thu Jan 15 2026 Alexey Berezhok <a@bayrepo.ru> - 1.9.6-3
- Fix error on local php installation and extension activation
* Thu Oct 09 2025 Alexey Berezhok <a@bayrepo.ru> - 1.9.6-2
- Fix error on all web and mail domains after Apache 2.4.64 update
* Thu Jun 05 2025 Alexey Berezhok <a@bayrepo.ru> - 1.9.5-4
- Fixed memory calculation in service list
* Sun Jun 01 2025 Alexey Berezhok <a@bayrepo.ru> - 1.9.5-3
- Added documentation fixes
- Change download path to github
- Added devel option to install script
- Added fixes of installation process
- Added fixes created by user hestiacn
* Sun Apr 27 2025 Alexey Berezhok <a@bayrepo.ru> - 1.9.5-2
- Added clamav default config
* Sun Jan 19 2025 Alexey Berezhok <a@bayrepo.ru> - 1.9.5-1
- Added support alternative php
- Fixed php.ini editing
- Restore supporting some webapplications setup
* Sat Jan 11 2025 Alexey Berezhok <a@bayrepo.ru> - 1.9.4-1
- Added quota support in rpm for xfs and ext4
* Sun Jan 05 2025 Alexey Berezhok <a@bayrepo.ru> - 1.9.3-1
- Added minor fixes - Added minor fixes
- Added authorization fix for rhel 9.5
* Mon Dec 30 2024 Alexey Berezhok <a@bayrepo.ru> - 1.9.1-1 * Mon Dec 30 2024 Alexey Berezhok <a@bayrepo.ru> - 1.9.1-1
- Added port specification ofor local services on domain editing - Added port specification ofor local services on domain editing

View File

@@ -2,8 +2,8 @@
%global _prefix /usr/local/hestia/php %global _prefix /usr/local/hestia/php
Name: hestia-php Name: hestia-php
Version: 8.2.23 Version: 8.2.28
Release: 2%{dist} Release: 1%{dist}
Summary: Hestia internal PHP Summary: Hestia internal PHP
Group: System Environment/Base Group: System Environment/Base
URL: https://www.hestiacp.com URL: https://www.hestiacp.com
@@ -103,6 +103,9 @@ cp %{SOURCE3} %{buildroot}/usr/local/hestia/php/lib/
%{_unitdir}/hestia-php.service %{_unitdir}/hestia-php.service
%changelog %changelog
* Tue Jun 3 2025 Alexey Berezhok <a@bayrepo.ru> - 8.2.28-1
- Update PHP version up to 8.2.28
* Sat Jul 22 2023 Raven <raven@sysadmins.ws> - 8.2.8-1 * Sat Jul 22 2023 Raven <raven@sysadmins.ws> - 8.2.8-1
- update PHP version to 8.2.8 - update PHP version to 8.2.8

View File

@@ -123,6 +123,9 @@ if (!empty($installer)) {
$appInstallerInfo = $app_installer->info(); $appInstallerInfo = $app_installer->info();
$supported = false; $supported = false;
$supported_versions = []; $supported_versions = [];
if ($appInstallerInfo["enabled"] != true) {
continue;
}
foreach ($php_versions as $version) { foreach ($php_versions as $version) {
if (in_array($version, $appInstallerInfo["php_support"])) { if (in_array($version, $appInstallerInfo["php_support"])) {
$supported = true; $supported = true;

View File

@@ -29,32 +29,20 @@ exec(HESTIA_CMD . "v-list-web-templates-backend json", $output, $return_var);
$backend_templates = json_decode(implode("", $output), true); $backend_templates = json_decode(implode("", $output), true);
unset($output); unset($output);
exec(HESTIA_CMD . "v-check-rhel-utility", $output, $return_var); //exec(HESTIA_CMD . "v-check-rhel-utility", $output, $return_var);
$is_rhel = str_contains(implode("", $output), "+"); //$is_rhel = str_contains(implode("", $output), "+");
unset($output); //unset($output);
$v_php_versions = [ $v_php_versions = [
"php-5.6", "php-74",
"php-7.0", "php-80",
"php-7.1", "php-81",
"php-7.2", "php-82",
"php-7.3", "php-83",
"php-7.4", "php-84",
"php-8.0", "php-85",
"php-8.1",
"php-8.2",
]; ];
if ($is_rhel){
$v_php_versions = [
"php-74",
"php-80",
"php-81",
"php-82",
"php-83",
"php-84",
];
}
sort($v_php_versions); sort($v_php_versions);

View File

@@ -46,7 +46,7 @@ if (!empty($_POST["save"])) {
} }
// List config // List config
exec(HESTIA_CMD . "v-list-sys-php-config json", $output, $return_var); exec(HESTIA_CMD . "v-list-sys-php-config default json", $output, $return_var);
$data = json_decode(implode("", $output), true); $data = json_decode(implode("", $output), true);
unset($output); unset($output);
$v_memory_limit = $data["CONFIG"]["memory_limit"]; $v_memory_limit = $data["CONFIG"]["memory_limit"];

View File

@@ -11,11 +11,32 @@ if ($_SESSION["userContext"] != "admin") {
exit(); exit();
} }
$php_version = "default";
if (!empty($_GET["vers"])){
$php_version_tmp = trim(urldecode($_GET["vers"]));
if (preg_match('/^\d+$/', $php_version_tmp) === 1){
exec(HESTIA_CMD . "v-list-sys-php json", $output, $return_var);
$php = json_decode(implode("", $output), true);
unset($output);
foreach ($php as $version) {
if ($version == $php_version_tmp){
$php_version = $php_version_tmp;
break;
}
}
}
}
// Check POST request // Check POST request
if (!empty($_POST["save"])) { if (!empty($_POST["save"])) {
// Check token // Check token
verify_csrf($_POST); verify_csrf($_POST);
$php_save = "php";
if ($php_version != "default"){
$php_save .= $php_version;
}
// Set restart flag // Set restart flag
$v_restart = "yes"; $v_restart = "yes";
if (empty($_POST["v_restart"])) { if (empty($_POST["v_restart"])) {
@@ -30,7 +51,7 @@ if (!empty($_POST["save"])) {
fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"])); fwrite($fp, str_replace("\r\n", "\n", $_POST["v_config"]));
fclose($fp); fclose($fp);
exec( exec(
HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " php " . $v_restart, HESTIA_CMD . "v-change-sys-service-config " . $new_conf . " " . $php_save . " " . $v_restart,
$output, $output,
$return_var, $return_var,
); );
@@ -46,7 +67,7 @@ if (!empty($_POST["save"])) {
} }
// List config // List config
exec(HESTIA_CMD . "v-list-sys-php-config json", $output, $return_var); exec(HESTIA_CMD . "v-list-sys-php-config " . $php_version . " json", $output, $return_var);
$data = json_decode(implode("", $output), true); $data = json_decode(implode("", $output), true);
unset($output); unset($output);
$v_memory_limit = $data["CONFIG"]["memory_limit"]; $v_memory_limit = $data["CONFIG"]["memory_limit"];

View File

@@ -36,7 +36,7 @@ if (!empty($_POST["save"])) {
); );
check_return_code($return_var, $output); check_return_code($return_var, $output);
unset($output); unset($output);
unlink($new_conf); //unlink($new_conf);
} }
// Set success message // Set success message
@@ -46,7 +46,7 @@ if (!empty($_POST["save"])) {
} }
// List config // List config
exec(HESTIA_CMD . "v-list-sys-php-config json", $output, $return_var); exec(HESTIA_CMD . "v-list-sys-php-config default json", $output, $return_var);
$data = json_decode(implode("", $output), true); $data = json_decode(implode("", $output), true);
unset($output); unset($output);
$v_memory_limit = $data["CONFIG"]["memory_limit"]; $v_memory_limit = $data["CONFIG"]["memory_limit"];

View File

@@ -130,6 +130,16 @@ if (!in_array($v_redirect, ["www." . $v_domain, $v_domain])) {
$v_redirect_custom = $v_redirect; $v_redirect_custom = $v_redirect;
} }
//Is default domain
$v_is_default = false;
exec(HESTIA_CMD . "v-default-domain " . $user . " " . quoteshellarg($v_domain). " check", $output, $return_var);
if ($return_var == 0) {
if (strpos(implode("", $output), 'true') !== false) {
$v_is_default = true;
}
}
unset($output);
$v_ftp_user = $data[$v_domain]["FTP_USER"]; $v_ftp_user = $data[$v_domain]["FTP_USER"];
$v_ftp_path = $data[$v_domain]["FTP_PATH"]; $v_ftp_path = $data[$v_domain]["FTP_PATH"];
if (!empty($v_ftp_user)) { if (!empty($v_ftp_user)) {
@@ -1593,6 +1603,40 @@ if (!empty($_POST["save"])) {
unset($v_custom_doc_root); unset($v_custom_doc_root);
} }
if (!empty($_POST["v-default-domain"])) {
if ($v_is_default == false) {
exec(
HESTIA_CMD .
"v-default-domain " .
$user .
" " .
quoteshellarg($v_domain) .
" set",
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
$v_is_default = true;
}
} else {
if ($v_is_default == true) {
exec(
HESTIA_CMD .
"v-default-domain " .
$user .
" " .
quoteshellarg($v_domain) .
" delete",
$output,
$return_var,
);
check_return_code($return_var, $output);
unset($output);
$v_is_default = false;
}
}
if (!empty($v_redirect) && empty($_POST["v-redirect-checkbox"])) { if (!empty($v_redirect) && empty($_POST["v-redirect-checkbox"])) {
exec( exec(
HESTIA_CMD . "v-delete-web-domain-redirect " . $user . " " . quoteshellarg($v_domain), HESTIA_CMD . "v-delete-web-domain-redirect " . $user . " " . quoteshellarg($v_domain),

View File

@@ -0,0 +1,96 @@
<?php
use function Hestiacp\quoteshellarg\quoteshellarg;
$TAB = "EXTMODULES";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Check user
if ($_SESSION["userContext"] != "admin") {
header("Location: /list/user");
exit();
}
exec(HESTIA_CMD . "v-ext-modules state php_brepo_modules json", $output, $return_var);
$check_passenger_enabled = json_decode(implode("", $output), true);
if (($return_var != 0) || (empty($check_passenger_enabled)) || ($check_passenger_enabled[0]["STATE"] != "enabled")){
header("Location: /list/extmodules/");
exit();
}
unset($output);
$error_message = "";
if ((!empty($_GET["ver"])) && ($_GET["ver"] != "")) {
$php_vers = $_GET["ver"];
$ver_quoted = quoteshellarg($_GET["ver"]);
exec(HESTIA_CMD . "v-ext-modules-run php_brepo_modules php_modules " . $ver_quoted . " json", $output, $return_var);
$phps_modules = [];
if ($return_var == 0) {
$phps_modules = json_decode(implode("", $output), true);
} else {
$error_message = $output;
}
unset($output);
if (!empty($_POST["save"]) && $error_message == ""){
$new_modules = $_POST["v_php_module_name"];
$chg = false;
foreach ($new_modules as $key => $value){
if (!preg_match("/(\d\d)-.+/i", $value)){
$mod_name = quoteshellarg($value);
$chg = true;
exec(HESTIA_CMD . "v-ext-modules-run php_brepo_modules php_enable " . $ver_quoted . " " . $mod_name, $output, $return_var);
unset($output);
}
}
foreach ($phps_modules as $key => $value){
if ($value["STATE"]!="disabled"){
$fnd = false;
foreach ($new_modules as $ikey => $ivalue){
if ($ivalue==$value["STATE"]){
$fnd = true;
break;
}
}
if (!$fnd){
$chg = true;
$mod_name = quoteshellarg($phps_modules[$key]["MODNAME"]);
exec(HESTIA_CMD . "v-ext-modules-run php_brepo_modules php_disable " . $ver_quoted . " " . $mod_name, $output, $return_var);
unset($output);
}
}
}
exec(HESTIA_CMD . "v-ext-modules-run php_brepo_modules php_modules " . $ver_quoted . " json", $output, $return_var);
$phps_modules = [];
if ($return_var == 0) {
$phps_modules = json_decode(implode("", $output), true);
} else {
$error_message = $output;
}
unset($output);
if ($chg){
exec(HESTIA_CMD . "v-restart-web-backend", $output, $return_var);
}
}
// Render page
render_page($user, $TAB, "extmodules/extmodules_php_brepo_modules_list");
} else {
// Data
exec(HESTIA_CMD . "v-ext-modules-run php_brepo_modules php_list json", $output, $return_var);
$phps = [];
if ($return_var == 0) {
$phps = json_decode(implode("", $output), true);
ksort($phps);
} else {
$error_message = $output;
}
unset($output);
// Render page
render_page($user, $TAB, "extmodules/extmodules_php_brepo_modules");
}
// Back uri
$_SESSION["back"] = $_SERVER["REQUEST_URI"];

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