Initial
This commit is contained in:
15
src/rpm/hestia/hestia.service
Normal file
15
src/rpm/hestia/hestia.service
Normal file
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Hestia web console
|
||||
Documentation=https://www.hestiacp.com
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
Requires=hestia-php.service
|
||||
Requires=hestia-nginx.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/true
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
177
src/rpm/hestia/hestia.spec
Normal file
177
src/rpm/hestia/hestia.spec
Normal file
@@ -0,0 +1,177 @@
|
||||
%define debug_package %{nil}
|
||||
%global _hardened_build 1
|
||||
|
||||
Name: hestia
|
||||
Version: 1.8.0~alpha
|
||||
Release: 1%{dist}
|
||||
Summary: Hestia Control Panel
|
||||
Group: System Environment/Base
|
||||
License: GPLv3
|
||||
URL: https://www.hestiacp.com
|
||||
Source0: https://github.com/hestiacp/hestiacp/archive/refs/tags/%{version}.tar.gz#/hestia-%{version}.tar.gz
|
||||
Source1: hestia.service
|
||||
Source2: hestia.tmpfiles
|
||||
Vendor: hestiacp.com
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: redhat-rpm-config
|
||||
BuildRequires: systemd
|
||||
|
||||
Requires: bash
|
||||
Requires: gawk
|
||||
Requires: sed
|
||||
Requires: acl
|
||||
Requires: sysstat
|
||||
Requires: util-linux
|
||||
Requires: zstd
|
||||
Requires: jq
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
|
||||
Provides: hestia = %{version}-%{release}
|
||||
Conflicts: redhat-release < 8
|
||||
Conflicts: vesta
|
||||
|
||||
|
||||
%description
|
||||
This package contains the Hestia Control Panel.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n hestiacp
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_tmpfilesdir} %{buildroot}/usr/local/hestia
|
||||
cp -R %{_builddir}/hestiacp/* %{buildroot}/usr/local/hestia/
|
||||
install -m644 %{SOURCE1} %{buildroot}%{_unitdir}/hestia.service
|
||||
install -D %SOURCE2 %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
||||
|
||||
# Cleanup not required files so package will be smaller
|
||||
rm -rf %{buildroot}/usr/local/hestia/src/deb %{buildroot}/usr/local/hestia/src/archive %{buildroot}/usr/local/hestia/test %{buildroot}/usr/local/hestia/docs
|
||||
|
||||
%clean
|
||||
|
||||
|
||||
%pre
|
||||
# Run triggers only on updates
|
||||
if [ -e "/usr/local/hestia/data/users/admin" ]; then
|
||||
# Validate version number and replace if different
|
||||
HESTIA_V=$(rpm --queryformat="%{VERSION}" -q hestia)
|
||||
if [ ! "$HESTIA_V" = "%{version}" ]; then
|
||||
sed -i "s/VERSION=.*/VERSION='$HESTIA_V'/g" /usr/local/hestia/conf/hestia.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
%post
|
||||
%tmpfiles_create_package %{name} %SOURCE2
|
||||
%systemd_post hestia.service
|
||||
|
||||
if [ ! -e /etc/profile.d/hestia.sh ]; then
|
||||
HESTIA='/usr/local/hestia'
|
||||
echo "export HESTIA='$HESTIA'" > /etc/profile.d/hestia.sh
|
||||
echo 'PATH=$PATH:'$HESTIA'/bin' >> /etc/profile.d/hestia.sh
|
||||
echo 'export PATH' >> /etc/profile.d/hestia.sh
|
||||
chmod 755 /etc/profile.d/hestia.sh
|
||||
source /etc/profile.d/hestia.sh
|
||||
fi
|
||||
|
||||
if [ -e "/usr/local/hestia/data/users/admin" ]; then
|
||||
###############################################################
|
||||
# Initialize functions/variables #
|
||||
###############################################################
|
||||
|
||||
# Load upgrade functions and refresh variables/configuration
|
||||
source /usr/local/hestia/func/upgrade.sh
|
||||
upgrade_refresh_config
|
||||
|
||||
###############################################################
|
||||
# Set new version numbers for packages #
|
||||
###############################################################
|
||||
# Hestia Control Panel
|
||||
new_version=$(rpm --queryformat="%{VERSION}" -q hestia)
|
||||
|
||||
# phpMyAdmin
|
||||
pma_v='5.0.2'
|
||||
|
||||
###############################################################
|
||||
# Begin standard upgrade routines #
|
||||
###############################################################
|
||||
|
||||
# Initialize backup directories
|
||||
upgrade_init_backup
|
||||
|
||||
# Set up console display and welcome message
|
||||
upgrade_welcome_message
|
||||
|
||||
# Execute version-specific upgrade scripts
|
||||
upgrade_start_routine
|
||||
|
||||
# Update Web domain templates
|
||||
upgrade_rebuild_web_templates | tee -a $LOG
|
||||
|
||||
# Update Mail domain templates
|
||||
upgrade_rebuild_mail_templates | tee -a $LOG
|
||||
|
||||
# Update DNS zone templates
|
||||
upgrade_rebuild_dns_templates | tee -a $LOG
|
||||
|
||||
# Upgrade File Manager and update configuration
|
||||
upgrade_filemanager | tee -a $LOG
|
||||
|
||||
# Upgrade SnappyMail if applicable
|
||||
upgrade_snappymail | tee -a $LOG
|
||||
|
||||
# Upgrade Roundcube if applicable
|
||||
upgrade_roundcube | tee -a $LOG
|
||||
|
||||
# Upgrade PHPMailer if applicable
|
||||
upgrade_phpmailer | tee -a $LOG
|
||||
|
||||
# Update Cloudflare IPs if applicable
|
||||
upgrade_cloudflare_ip | tee -a $LOG
|
||||
|
||||
# Upgrade phpMyAdmin if applicable
|
||||
upgrade_phpmyadmin | tee -a $LOG
|
||||
|
||||
# Upgrade phpPgAdmin if applicable
|
||||
upgrade_phppgadmin | tee -a $LOG
|
||||
|
||||
# Upgrade blackblaze-cli-took if applicable
|
||||
upgrade_b2_tool | tee -a $LOG
|
||||
|
||||
# update whitelabel logo's
|
||||
update_whitelabel_logo | tee -a $LOG
|
||||
|
||||
# Set new version number in hestia.conf
|
||||
upgrade_set_version
|
||||
|
||||
# Perform account and domain rebuild to ensure configuration files are correct
|
||||
upgrade_rebuild_users
|
||||
|
||||
# Restart necessary services for changes to take full effect
|
||||
upgrade_restart_services
|
||||
|
||||
# Add upgrade notification to admin user's panel and display completion message
|
||||
upgrade_complete_message
|
||||
fi
|
||||
|
||||
%preun
|
||||
%systemd_preun hestia.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart hestia.service
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%attr(755,root,root) /usr/local/hestia
|
||||
%{_unitdir}/hestia.service
|
||||
%{_tmpfilesdir}/%{name}.conf
|
||||
|
||||
%changelog
|
||||
* Sun May 14 2023 Istiak Ferdous <hello@istiak.com> - 1.8.0-1
|
||||
- HestiaCP RHEL 9 support
|
||||
|
||||
* Thu Jun 25 2020 Ernesto Nicolás Carrea <equistango@gmail.com> - 1.2.0
|
||||
- HestiaCP CentOS 8 support
|
||||
1
src/rpm/hestia/hestia.tmpfiles
Normal file
1
src/rpm/hestia/hestia.tmpfiles
Normal file
@@ -0,0 +1 @@
|
||||
d /run/hestia 710 root wheel
|
||||
19
src/rpm/nginx/hestia-nginx.service
Normal file
19
src/rpm/nginx/hestia-nginx.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Hestia nginx - administration web server
|
||||
Documentation=https://www.hestiacp.com
|
||||
PartOf=hestia.service
|
||||
After=hestia-php.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/hestia/nginx.pid
|
||||
ExecStartPre=/usr/bin/rm -f /run/nginx.pid
|
||||
ExecStartPre=/usr/local/hestia/nginx/sbin/hestia-nginx -t -c /usr/local/hestia/nginx/conf/nginx.conf
|
||||
ExecStart=/usr/local/hestia/nginx/sbin/hestia-nginx -c /usr/local/hestia/nginx/conf/nginx.conf
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
KillSignal=SIGQUIT
|
||||
TimeoutStopSec=5
|
||||
KillMode=process
|
||||
|
||||
[Install]
|
||||
WantedBy=hestia.service
|
||||
136
src/rpm/nginx/hestia-nginx.spec
Normal file
136
src/rpm/nginx/hestia-nginx.spec
Normal file
@@ -0,0 +1,136 @@
|
||||
%global _hardened_build 1
|
||||
|
||||
%define WITH_CC_OPT $(echo %{optflags} $(pcre2-config --cflags)) -fPIC
|
||||
%define WITH_LD_OPT -Wl,-z,relro -Wl,-z,now -pie
|
||||
|
||||
%global _prefix /usr/local/hestia/nginx
|
||||
|
||||
Name: hestia-nginx
|
||||
Version: 1.25.1
|
||||
Release: 1%{dist}
|
||||
Summary: Hestia internal nginx web server
|
||||
Group: System Environment/Base
|
||||
URL: https://www.hestiacp.com
|
||||
Source0: https://nginx.org/download/nginx-%{version}.tar.gz
|
||||
Source1: hestia-nginx.service
|
||||
Source2: nginx.conf
|
||||
License: BSD
|
||||
Vendor: hestiacp.com
|
||||
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
BuildRequires: pcre2-devel
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: gd-devel
|
||||
BuildRequires: libxslt-devel
|
||||
BuildRequires: redhat-rpm-config
|
||||
BuildRequires: systemd
|
||||
BuildRequires: openssl-devel
|
||||
|
||||
Requires: bash
|
||||
Requires: gawk
|
||||
Requires: sed
|
||||
Requires: acl
|
||||
Requires: sysstat
|
||||
Requires: util-linux
|
||||
Requires: zstd
|
||||
Requires: jq
|
||||
Requires: hestia-php
|
||||
Requires: hestia
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
|
||||
|
||||
%description
|
||||
This package contains internal nginx webserver for Hestia Control Panel web interface.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n nginx-%{version}
|
||||
|
||||
%build
|
||||
./configure \
|
||||
--prefix=%_prefix \
|
||||
--conf-path=%{_prefix}/conf/nginx.conf \
|
||||
--error-log-path=%{_localstatedir}/log/hestia/nginx-error.log \
|
||||
--http-log-path=%{_localstatedir}/log/hestia/access.log \
|
||||
--pid-path=%{_rundir}/hestia/nginx.pid \
|
||||
--lock-path=%{_rundir}/hestia/nginx.lock \
|
||||
--http-client-body-temp-path=%{_localstatedir}/cache/hestia-nginx/client_temp \
|
||||
--http-proxy-temp-path=%{_localstatedir}/cache/hestia-nginx/proxy_temp \
|
||||
--http-fastcgi-temp-path=%{_localstatedir}/cache/hestia-nginx/fastcgi_temp \
|
||||
--http-scgi-temp-path=%{_localstatedir}/cache/hestia-nginx/scgi_temp \
|
||||
--user=admin \
|
||||
--group=admin \
|
||||
--with-compat \
|
||||
--with-file-aio \
|
||||
--with-threads \
|
||||
--with-http_addition_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_ssl_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_sub_module \
|
||||
--with-http_v2_module \
|
||||
--with-stream \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_ssl_preread_module \
|
||||
--with-cc-opt="%{WITH_CC_OPT}" \
|
||||
--with-ld-opt="%{WITH_LD_OPT}"
|
||||
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%__make DESTDIR=%{buildroot} INSTALLDIRS=vendor install
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
install -m644 %{SOURCE1} %{buildroot}%{_unitdir}/hestia-nginx.service
|
||||
rm -f %{buildroot}/usr/local/hestia/nginx/conf/nginx.conf
|
||||
cp %{SOURCE2} %{buildroot}/usr/local/hestia/nginx/conf/nginx.conf
|
||||
mv %{buildroot}/usr/local/hestia/nginx/sbin/nginx %{buildroot}/usr/local/hestia/nginx/sbin/hestia-nginx
|
||||
|
||||
%clean
|
||||
|
||||
%pre
|
||||
|
||||
%post
|
||||
%systemd_post hestia-nginx.service
|
||||
|
||||
%preun
|
||||
%systemd_preun hestia-nginx.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart hestia-nginx.service
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%attr(755,root,root) /usr/local/hestia/nginx
|
||||
%config(noreplace) /usr/local/hestia/nginx/conf/nginx.conf
|
||||
%{_unitdir}/hestia-nginx.service
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Jun 16 2023 myrevery <github@myrevery.com> - 1.25.1-1
|
||||
- Upgrade to NGINX 1.25.1 mainline version
|
||||
- Implement TLS 1.3 0-RTT anti-replay
|
||||
|
||||
* Sun May 14 2023 Istiak Ferdous <hello@istiak.com> - 1.24.0-1
|
||||
- 1.24.0-1
|
||||
|
||||
* Wed Jun 24 2020 Ernesto Nicolás Carrea <equistango@gmail.com> - 1.17.8
|
||||
- HestiaCP CentOS 8 support
|
||||
|
||||
* Tue Jul 30 2013 Serghey Rodin <builder@vestacp.com> - 0.9.8-1
|
||||
- upgraded to nginx-1.4.2
|
||||
|
||||
* Sat Apr 06 2013 Serghey Rodin <builder@vestacp.com> - 0.9.7-2
|
||||
- new init script
|
||||
|
||||
* Wed Jun 27 2012 Serghey Rodin <builder@vestacp.com> - 0.9.7-1
|
||||
- initial build
|
||||
180
src/rpm/nginx/nginx.conf
Normal file
180
src/rpm/nginx/nginx.conf
Normal file
@@ -0,0 +1,180 @@
|
||||
# Server globals
|
||||
user admin;
|
||||
worker_processes 1;
|
||||
worker_rlimit_nofile 65535;
|
||||
error_log /var/log/hestia/nginx-error.log;
|
||||
|
||||
pid /run/hestia/nginx.pid;
|
||||
#pcre_jit on;
|
||||
|
||||
|
||||
# Worker config
|
||||
events {
|
||||
worker_connections 128;
|
||||
use epoll;
|
||||
multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
# Main settings
|
||||
http2 on;
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
client_header_timeout 180s;
|
||||
client_body_timeout 180s;
|
||||
client_header_buffer_size 2k;
|
||||
client_body_buffer_size 256k;
|
||||
client_max_body_size 1024m;
|
||||
large_client_header_buffers 4 8k;
|
||||
send_timeout 60s;
|
||||
keepalive_timeout 30s;
|
||||
keepalive_requests 10000;
|
||||
reset_timedout_connection on;
|
||||
server_tokens off;
|
||||
server_name_in_redirect off;
|
||||
server_names_hash_max_size 512;
|
||||
server_names_hash_bucket_size 512;
|
||||
charset utf-8;
|
||||
# FastCGI settings
|
||||
fastcgi_buffers 512 4k;
|
||||
fastcgi_buffer_size 256k;
|
||||
fastcgi_busy_buffers_size 256k;
|
||||
fastcgi_temp_file_write_size 256k;
|
||||
fastcgi_connect_timeout 30s;
|
||||
fastcgi_read_timeout 600s;
|
||||
fastcgi_send_timeout 600s;
|
||||
# Proxy settings
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Early-Data $rfc_early_data;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass_header Set-Cookie;
|
||||
proxy_buffers 256 4k;
|
||||
proxy_buffer_size 32k;
|
||||
proxy_busy_buffers_size 32k;
|
||||
proxy_temp_file_write_size 256k;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 180s;
|
||||
# Log format
|
||||
log_format main '$remote_addr - $remote_user [$time_local] $request "$status" $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
|
||||
access_log /var/log/hestia/nginx-access.log main;
|
||||
# Mime settings
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
# Compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_comp_level 6;
|
||||
gzip_min_length 1024;
|
||||
gzip_buffers 128 4k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_types text/css text/javascript text/js text/plain text/richtext text/shtml text/x-component text/x-java-source text/x-markdown text/x-script text/xml image/bmp image/svg+xml image/vnd.microsoft.icon image/x-icon font/otf font/ttf font/x-woff multipart/bag multipart/mixed application/eot application/font application/font-sfnt application/font-woff application/javascript application/javascript-binast application/json application/ld+json application/manifest+json application/opentype application/otf application/rss+xml application/ttf application/truetype application/vnd.api+json application/vnd.ms-fontobject application/wasm application/xhtml+xml application/xml application/xml+rss application/x-httpd-cgi application/x-javascript application/x-opentype application/x-otf application/x-perl application/x-protobuf application/x-ttf;
|
||||
gzip_proxied any;
|
||||
# SSL PCI compliance
|
||||
ssl_buffer_size 1369;
|
||||
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA256";
|
||||
ssl_conf_command Ciphersuites TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384;
|
||||
ssl_conf_command Options PrioritizeChaCha;
|
||||
ssl_dhparam /etc/pki/tls/dhparam.pem;
|
||||
ssl_early_data on;
|
||||
ssl_ecdh_curve auto;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets on;
|
||||
ssl_session_timeout 7d;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
resolver 1.0.0.1 8.8.4.4 1.1.1.1 8.8.8.8 valid=300s ipv6=off;
|
||||
resolver_timeout 5s;
|
||||
# Security headers
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Frame-Options SAMEORIGIN;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
||||
# TLS 1.3 0-RTT anti-replay
|
||||
map "$request_method:$is_args" $ar_idempotent {
|
||||
default 0;
|
||||
"~^GET:$|^(HEAD|OPTIONS|TRACE):\?*$" 1;
|
||||
}
|
||||
|
||||
map $http_user_agent $ar_support_425 {
|
||||
default 0;
|
||||
"~Firefox/((58|59)|([6-9]\d)|([1-9]\d{2,}))\.\d+" 1;
|
||||
}
|
||||
|
||||
map "$ssl_early_data:$ar_idempotent:$ar_support_425" $anti_replay {
|
||||
1:0:0 307;
|
||||
1:0:1 425;
|
||||
}
|
||||
|
||||
map "$ssl_early_data:$ar_support_425" $rfc_early_data {
|
||||
1:1 1;
|
||||
}
|
||||
|
||||
# Vhost
|
||||
server {
|
||||
listen 8083 ssl;
|
||||
server_name _;
|
||||
root /usr/local/hestia/web;
|
||||
# Fix error "The plain HTTP request was sent to HTTPS port"
|
||||
error_page 497 https://$host:$server_port$request_uri;
|
||||
error_page 403 /error/404.html;
|
||||
error_page 404 /error/404.html;
|
||||
error_page 410 /error/410.html;
|
||||
error_page 500 501 502 503 504 505 /error/50x.html;
|
||||
|
||||
ssl_certificate /usr/local/hestia/ssl/certificate.crt;
|
||||
ssl_certificate_key /usr/local/hestia/ssl/certificate.key;
|
||||
|
||||
# TLS 1.3 0-RTT anti-replay
|
||||
if ($anti_replay = 307) { return 307 https://$host:$server_port$request_uri; }
|
||||
if ($anti_replay = 425) { return 425; }
|
||||
|
||||
location / {
|
||||
expires off;
|
||||
index index.php;
|
||||
}
|
||||
|
||||
location /error/ {
|
||||
expires off;
|
||||
internal;
|
||||
}
|
||||
|
||||
location /rrd/ {
|
||||
expires off;
|
||||
internal;
|
||||
}
|
||||
|
||||
location /backup/ {
|
||||
root /;
|
||||
internal;
|
||||
}
|
||||
|
||||
location /fm/ {
|
||||
alias /usr/local/hestia/web/fm/dist/;
|
||||
index index.php;
|
||||
|
||||
location ~ /([^/]+\.php)$ {
|
||||
try_files /$1 =404;
|
||||
include fastcgi_params;
|
||||
fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
|
||||
fastcgi_param SCRIPT_FILENAME /usr/local/hestia/web/fm/dist/index.php;
|
||||
fastcgi_pass unix:/run/hestia-php.sock;
|
||||
fastcgi_index index.php;
|
||||
}
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
|
||||
fastcgi_param SCRIPT_FILENAME /usr/local/hestia/web/$fastcgi_script_name;
|
||||
fastcgi_pass unix:/run/hestia/php.sock;
|
||||
fastcgi_intercept_errors on;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/rpm/php/hestia-php.service
Normal file
16
src/rpm/php/hestia-php.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Hestia PHP daemon
|
||||
Documentation=https://www.hestiacp.com
|
||||
PartOf=hestia.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/hestia/php.pid
|
||||
ExecStart=/usr/local/hestia/php/sbin/hestia-php --fpm-config /usr/local/hestia/php/etc/php-fpm.conf
|
||||
ExecReload=/bin/kill -USR2 $MAINPID
|
||||
ExecStop=/bin/kill -TERM $MAINPID
|
||||
ExecStartPre=/bin/bash -c "/bin/systemctl set-environment HOSTNAME=$(/usr/bin/hostname)"
|
||||
Environment="HESTIA=/usr/local/hestia"
|
||||
|
||||
[Install]
|
||||
WantedBy=hestia.service
|
||||
117
src/rpm/php/hestia-php.spec
Normal file
117
src/rpm/php/hestia-php.spec
Normal file
@@ -0,0 +1,117 @@
|
||||
%global _hardened_build 1
|
||||
%global _prefix /usr/local/hestia/php
|
||||
|
||||
Name: hestia-php
|
||||
Version: 8.2.8
|
||||
Release: 1%{dist}
|
||||
Summary: Hestia internal PHP
|
||||
Group: System Environment/Base
|
||||
URL: https://www.hestiacp.com
|
||||
Source0: https://www.php.net/distributions/php-%{version}.tar.xz
|
||||
Source1: hestia-php.service
|
||||
Source2: php-fpm.conf
|
||||
Source3: php.ini
|
||||
License: PHP and Zend and BSD and MIT and ASL 1.0 and NCSA
|
||||
Vendor: hestiacp.com
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: make
|
||||
BuildRequires: libtool
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: bison
|
||||
BuildRequires: gnupg2
|
||||
BuildRequires: bzip2-devel
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: re2c
|
||||
BuildRequires: gmp-devel
|
||||
BuildRequires: oniguruma-devel
|
||||
BuildRequires: libzip-devel
|
||||
BuildRequires: pkgconfig(libcurl) >= 7.61.0
|
||||
BuildRequires: pkgconfig(libxml-2.0) >= 2.9.7
|
||||
BuildRequires: pkgconfig(sqlite3) >= 3.26.0
|
||||
BuildRequires: systemd
|
||||
|
||||
%description
|
||||
This package contains internal PHP for Hestia Control Panel web interface.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n php-%{version}
|
||||
|
||||
# https://bugs.php.net/63362 - Not needed but installed headers.
|
||||
# Drop some Windows specific headers to avoid installation,
|
||||
# before build to ensure they are really not needed.
|
||||
rm -f TSRM/tsrm_win32.h \
|
||||
TSRM/tsrm_config.w32.h \
|
||||
Zend/zend_config.w32.h \
|
||||
ext/mysqlnd/config-win.h \
|
||||
ext/standard/winver.h \
|
||||
main/win32_internal_function_disabled.h \
|
||||
main/win95nt.h
|
||||
|
||||
%build
|
||||
%if 0%{?rhel} > 8
|
||||
# This package fails to build with LTO due to undefined symbols. LTO
|
||||
# was disabled in OpenSuSE as well, but with no real explanation why
|
||||
# beyond the undefined symbols. It really should be investigated further.
|
||||
# Disable LTO
|
||||
%define _lto_cflags %{nil}
|
||||
%endif
|
||||
%configure --sysconfdir=%{_prefix}%{_sysconfdir} \
|
||||
--with-libdir=%{_libdir} \
|
||||
--enable-fpm --with-fpm-user=admin --with-fpm-group=admin \
|
||||
--with-openssl \
|
||||
--with-mysqli \
|
||||
--with-gettext \
|
||||
--with-curl \
|
||||
--with-zip \
|
||||
--with-gmp \
|
||||
--enable-mbstring
|
||||
%make_build
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_unitdir} %{buildroot}/usr/local/hestia/php/{etc,lib}
|
||||
mkdir -p %{buildroot}%{_unitdir} %{buildroot}/usr/local/hestia/php/var/{log,run}
|
||||
|
||||
%make_install INSTALL_ROOT=$RPM_BUILD_ROOT
|
||||
|
||||
install -m644 %{SOURCE1} %{buildroot}%{_unitdir}/hestia-php.service
|
||||
cp %{SOURCE2} %{buildroot}/usr/local/hestia/php/etc/
|
||||
cp %{SOURCE3} %{buildroot}/usr/local/hestia/php/lib/
|
||||
|
||||
%clean
|
||||
|
||||
%pre
|
||||
|
||||
%post
|
||||
%systemd_post hestia-php.service
|
||||
|
||||
%preun
|
||||
%systemd_preun hestia-php.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart hestia-php.service
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%attr(755,root,root) /usr/local/hestia/php
|
||||
%attr(775,admin,admin) /usr/local/hestia/php/var/log
|
||||
%attr(775,admin,admin) /usr/local/hestia/php/var/run
|
||||
%config(noreplace) /usr/local/hestia/php/etc/php-fpm.conf
|
||||
%config(noreplace) /usr/local/hestia/php/lib/php.ini
|
||||
%{_unitdir}/hestia-php.service
|
||||
|
||||
%changelog
|
||||
* Sat Jul 22 2023 Raven <raven@sysadmins.ws> - 8.2.8-1
|
||||
- update PHP version to 8.2.8
|
||||
|
||||
* Sat Jun 3 2023 Raven <raven@sysadmins.ws> - 8.2.7-1
|
||||
- update PHP version to 8.2.7
|
||||
- spec file cleanup
|
||||
|
||||
* Sun May 14 2023 Istiak Ferdous <hello@istiak.com> - 8.2.6-1
|
||||
- HestiaCP RHEL 9 support
|
||||
|
||||
* Thu Jun 25 2020 Ernesto Nicolás Carrea <equistango@gmail.com> - 7.4.6
|
||||
- HestiaCP CentOS 8 support
|
||||
43
src/rpm/php/php-fpm.conf
Normal file
43
src/rpm/php/php-fpm.conf
Normal file
@@ -0,0 +1,43 @@
|
||||
[global]
|
||||
pid = /run/hestia/php.pid
|
||||
daemonize = yes
|
||||
log_level = error
|
||||
emergency_restart_threshold = 10
|
||||
emergency_restart_interval = 60s
|
||||
process_control_timeout = 10s
|
||||
events.mechanism = epoll
|
||||
|
||||
[www]
|
||||
listen = /run/hestia/php.sock
|
||||
|
||||
user = admin
|
||||
group = admin
|
||||
|
||||
listen.owner = admin
|
||||
listen.group = admin
|
||||
listen.mode = 0660
|
||||
|
||||
pm = ondemand
|
||||
pm.max_children = 4
|
||||
pm.max_requests = 1000
|
||||
pm.process_idle_timeout = 10s;
|
||||
|
||||
env[HOSTNAME] = $HOSTNAME
|
||||
env[PATH] = /usr/local/bin:/usr/bin:/bin
|
||||
env[TMP] = /tmp
|
||||
env[TMPDIR] = /tmp
|
||||
env[TEMP] = /tmp
|
||||
env[HESTIA] = $HESTIA
|
||||
env[VESTA] = $HESTIA
|
||||
env[LANG] = en_US.UTF-8
|
||||
|
||||
php_flag[display_errors] = off
|
||||
php_admin_flag[log_errors] = on
|
||||
php_admin_flag[session.cookie_httponly] = on
|
||||
php_admin_flag[session.cookie_secure] = on
|
||||
php_admin_value[memory_limit] = 256M
|
||||
php_admin_value[post_max_size] = 256M
|
||||
php_admin_value[upload_max_filesize] = 256M
|
||||
php_admin_value[max_execution_time] = 300
|
||||
php_admin_value[max_input_time] = 300
|
||||
php_admin_value[session.save_path] = /usr/local/hestia/data/sessions
|
||||
1977
src/rpm/php/php.ini
Normal file
1977
src/rpm/php/php.ini
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user