From 2080a60e9a89f7b39be69b0dd4a3febf99265a05 Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Sat, 10 Dec 2022 21:43:36 +0100 Subject: [PATCH] Move service enabling to setup.php --- README.md | 7 ------- var/www/setup.php | 6 ++++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bf72336..9da38ff 100644 --- a/README.md +++ b/README.md @@ -99,13 +99,6 @@ quotaon /home In some cases, you might get an error, that quota is not supported. This is usually the case in virtual environments. Make sure you have the full kernel installed, not one with a `-virtual` package. They usually are `linux-image-amd64`, `linux-image-arm64` or `linux-image-generic`, depending on your distribution. Also make sure, you are running a real virtual machine (e.g. KVM). Some providers sell containerized VPSes (e.g. OpenVZ), which means you don't run your own kernel... -Enable the PHP-FPM default instances and nginx: -``` -systemctl enable php7.4-fpm@default -systemctl enable php8.0-fpm@default -systemctl enable nginx -``` - Install sodium_compat for v3 hidden_service support ``` cd /var/www && composer install diff --git a/var/www/setup.php b/var/www/setup.php index bf4c861..2b662a9 100644 --- a/var/www/setup.php +++ b/var/www/setup.php @@ -292,7 +292,8 @@ env[HOME]=/ mkdir("/etc/php/$version/fpm/pool.d/", 0755, true); } file_put_contents("/etc/php/$version/fpm/pool.d/www.conf", $pool_config); - exec('systemctl reload '.escapeshellarg("php$version-fpm@default")); + exec("systemctl enable ".escapeshellarg("php$version-fpm@default")); + exec("systemctl restart ".escapeshellarg("php$version-fpm@default")); } echo "Updating chroots, this might take a while…\n"; exec('/var/www/setup_chroot.sh /var/www'); @@ -318,7 +319,8 @@ file_put_contents('/etc/nginx/streams-enabled/default', "server { listen unix:/var/www/var/run/mysqld/mysqld.sock; proxy_pass unix:/var/run/mysqld/mysqld.sock; }"); -exec('systemctl reload nginx'); +exec('systemctl enable nginx'); +exec('systemctl restart nginx'); // add new php/tor instances if not yet existing $check=$db->prepare('SELECT null FROM service_instances WHERE id = ?;'); $stmt=$db->prepare('INSERT INTO service_instances (id) VALUES (?);');