Compare commits

...

2 Commits

Author SHA1 Message Date
Matthew Saunders Brown
11de7a88ae ensure sudo is installed 2024-06-13 13:54:04 -07:00
Matthew Saunders Brown
0c5ee948b5 detect correct php version 2024-06-13 13:53:46 -07:00
3 changed files with 12 additions and 4 deletions

View File

@ -4,7 +4,7 @@ Alias /panel /srv/www/html/panel
# panel php-fpm worker
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler "proxy:unix:/run/php/php8.1-fpm-vpanel.sock|fcgi://localhost"
SetHandler "proxy:unix:/run/php/php-fpm-vpanel.sock|fcgi://localhost"
</FilesMatch>
# Enable rewrite engine

View File

@ -1,7 +1,7 @@
[vpanel]
user = vpanel
group = vpanel
listen = /run/php/php8.1-fpm-vpanel.sock
listen = /run/php/php-fpm-vpanel.sock
listen.owner = www-data
listen.group = www-data
pm = ondemand

View File

@ -1,12 +1,20 @@
#!/bin/bash
apt-get install -y sudo
useradd --no-create-home --home-dir /srv/www/html/panel --shell /usr/sbin/nologin --system --user-group vpanel
cp bin/vpanel-verify-access.sh /usr/local/bin/
chmod 755 /usr/local/bin/vpanel-verify-access.sh
# set PHP version
PHP_MAJOR_VERSION=`php -r "echo PHP_MAJOR_VERSION;"`
PHP_MINOR_VERSION=`php -r "echo PHP_MINOR_VERSION;"`
phpVersion=$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION
# create versioned php fpm dir
mkdir etc/php/$phpVersion
mv etc/php/fpm etc/php/$phpVersion/
cp -a etc/* /etc/
chmod 440 /etc/sudoers.d/vpanel
a2enconf vpanel
sed -i "s|;process_control_timeout = 0|process_control_timeout = 1s|g" /etc/php/8.1/fpm/php-fpm.conf
service php8.1-fpm restart
sed -i "s|;process_control_timeout = 0|process_control_timeout = 1s|g" /etc/php/$phpVersion/fpm/php-fpm.conf
service php$phpVersion-fpm restart
service apache2 restart
cp -a panel /srv/www/html/
mkdir /srv/www/html/panel/tmp