diff --git a/install.php b/install.php index 327c0fb5d..b70cfc00a 100644 --- a/install.php +++ b/install.php @@ -319,6 +319,35 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) { } } + // Suggest configuration files based on selected web server + out("\n--- Web Server configuration ---\n", 'info'); + echo "Which web server are you using? (nginx / caddy / apache): "; + $webserver = mb_strtolower(trim(readline())); + $install_dir = 'install' . DIRECTORY_SEPARATOR; + + switch ($webserver) { + case 'nginx': + $config_path = BB_ROOT . $install_dir . 'nginx.conf'; + if (is_file($config_path)) { + out("- Nginx configuration file: $config_path", 'success'); + } else { + out("- Nginx config not found: $config_path", 'warning'); + out('- You can find an example in the documentation', 'info'); + } + break; + + case 'caddy': + $config_path = BB_ROOT . $install_dir . 'Caddyfile'; + if (is_file($config_path)) { + out("- Caddy configuration file: $config_path", 'success'); + } else { + out("- Caddy config not found: $config_path", 'warning'); + out('- You can find an example in the documentation', 'info'); + } + break; + } + sleep(3); + // Cleanup... if (is_file(BB_ROOT . '_cleanup.php')) { out("\n--- Finishing installation (Cleanup) ---\n", 'info'); diff --git a/install/Caddyfile b/install/Caddyfile index 683d69994..43c8f8aa2 100644 --- a/install/Caddyfile +++ b/install/Caddyfile @@ -1,7 +1,7 @@ # Example Caddy configuration for TorrentPier example.com { - root * /path/to/root + root * /path/to/www encode gzip zstd php_fastcgi unix//run/php/php-fpm.sock try_files {path} {path}/ /index.php?{query} diff --git a/install/nginx.conf b/install/nginx.conf index 49a407ba4..66889cb2a 100644 --- a/install/nginx.conf +++ b/install/nginx.conf @@ -1,9 +1,9 @@ # Example nginx configuration for TorrentPier server { - listen 80; # port - server_name example.com; # your domain - root /path/to/root; # folder with TorrentPier installed + listen 80; + server_name example.com; + root /path/to/www; index index.php; charset utf-8;