2022-08-24 13:45:39 -07:00
|
|
|
#!/bin/bash
|
2024-06-13 13:54:04 -07:00
|
|
|
apt-get install -y sudo
|
2022-08-24 13:45:39 -07:00
|
|
|
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
|
2024-11-22 14:20:38 -08:00
|
|
|
cp sbin/vpanel-php-fpm-socket-helper.sh /usr/local/sbin
|
|
|
|
chmod 755 /usr/local/sbin/vpanel-php-fpm-socket-helper.sh
|
|
|
|
cp systemd/vpanel-php-fpm-socket-helper.service /usr/local/lib/systemd/system/
|
|
|
|
chmod 644 /usr/local/lib/systemd/system/vpanel-php-fpm-socket-helper.service
|
2024-06-13 13:53:46 -07:00
|
|
|
# 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
|
2024-12-08 14:24:18 -08:00
|
|
|
phpPriority=$PHP_MAJOR_VERSION$PHP_MINOR_VERSION
|
2024-06-13 13:53:46 -07:00
|
|
|
# create versioned php fpm dir
|
|
|
|
mkdir etc/php/$phpVersion
|
|
|
|
mv etc/php/fpm etc/php/$phpVersion/
|
2024-12-08 14:24:18 -08:00
|
|
|
sed -i "s|PHPVERSION|$phpVersion|g" etc/php/$phpVersion/fpm/pool.d/vpanel.conf
|
2022-08-24 13:45:39 -07:00
|
|
|
cp -a etc/* /etc/
|
|
|
|
chmod 440 /etc/sudoers.d/vpanel
|
2024-06-13 13:53:46 -07:00
|
|
|
sed -i "s|;process_control_timeout = 0|process_control_timeout = 1s|g" /etc/php/$phpVersion/fpm/php-fpm.conf
|
2024-12-08 14:24:18 -08:00
|
|
|
service php$phpVersion-fpm restart
|
2024-08-30 14:54:56 -07:00
|
|
|
update-alternatives --install /run/php/php-fpm-vpanel.sock php-fpm-vpanel.sock /run/php/php$phpVersion-fpm-vpanel.sock $phpPriority
|
|
|
|
a2enconf vpanel
|
2022-08-24 13:45:39 -07:00
|
|
|
service apache2 restart
|
2024-11-22 14:20:38 -08:00
|
|
|
systemctl enable vpanel-php-fpm-socket-helper.service
|
2022-08-24 13:45:39 -07:00
|
|
|
cp -a panel /srv/www/html/
|
|
|
|
mkdir /srv/www/html/panel/tmp
|
|
|
|
git clone https://github.com/bcosca/fatfree-core.git /srv/www/html/panel/f3
|
|
|
|
rm -r /srv/www/html/panel/f3/.git
|
|
|
|
find /srv/www/html/panel -type d -exec chmod 755 {} +
|
|
|
|
find /srv/www/html/panel -type f -exec chmod 644 {} +
|
|
|
|
chown -R vpanel:vpanel /srv/www/html/panel
|