FILE 1: /home/workout-plan-generator.digitalprank.com/public_html/tool_config.json code JSON { "tool": { "identity": { "slug": "workout-plan-generator", "name": "Workout Plan Generator", "category": "prank", "tagline": "Get jacked with totally custom workout routines!", "description": "Generate hilarious, over-the-top custom workout plans with ridiculous exercises, made-up trainers, and epic fitness goals. Perfect for pranks, memes, or just a laugh.", "keywords": ["custom workout", "funny gym plan", "fitness prank", "workout meme", "digital prank"] }, "features": { "bulk_enabled": false, "history_enabled": true, "export_enabled": true, "api_enabled": true }, "fields": [ { "id": "goal_type", "type": "select", "label": "Fitness Goal", "default": "shredzilla", "options": [ { "value": "shredzilla", "label": "Become Shredzilla" }, { "value": "dad_bod_upgrade", "label": "Upgrade Dad Bod" }, { "value": "beach_biceps", "label": "Beach Biceps Only" }, { "value": "hollywood_chest", "label": "Hollywood Chest Gains" }, { "value": "zero_effort_abs", "label": "Zero-Effort Abs" } ], "required": true, "pro_only": false, "help_text": "Pick your absurd fitness goal. Results may vary (wildly)." }, { "id": "gender", "type": "select", "label": "Gender", "default": "any", "options": [ { "value": "male", "label": "Male" }, { "value": "female", "label": "Female" }, { "value": "non_binary", "label": "Non-Binary" }, { "value": "any", "label": "Surprise Me" } ], "pro_only": false, "help_text": "We tailor the plan to your vibe… or not." }, { "id": "difficulty", "type": "select", "label": "Workout Intensity", "default": "medium", "options": [ { "value": "easy", "label": "Beginner (Low Sweat)" }, { "value": "medium", "label": "Intermediate (Sore Tomorrow)" }, { "value": "extreme", "label": "Extreme (No Survivors)" } ], "pro_only": true, "help_text": "Pick how hard you *think* you want to train." }, { "id": "include_supplements", "type": "checkbox", "label": "Include Custom Supplement Suggestions", "default": true, "pro_only": true, "help_text": "Adds ridiculous product suggestions like Unicorn Protein Powder." }, { "id": "include_testimonials", "type": "checkbox", "label": "Include Custom Testimonials", "default": false, "pro_only": true, "help_text": "Get custom reviews from made-up jacked influencers." } ], "limits": { "tier_daily": { "free": 3, "basic": 25, "gold": 100, "ultimate": -1 }, "rate_limit_per_minute": 10, "max_concurrent_requests": 3 }, "billing": { "credit_cost": 1, "one_off_enabled": true, "one_off_price_cents": 99, "bill_on": "success" }, "ui": { "theme": { "primary_color": "#1DB954", "secondary_color": "#121212" }, "layout": { "show_sidebar_ads": true, "form_style": "wizard", "result_display": "fullscreen" } }, "dependencies": { "php_extensions": ["json", "curl"], "system_packages": [], "python_packages": ["faker", "jinja2"], "requires_internet": false }, "database": { "tool_specific_table": "custom_workout_plan_history", "store_results": true, "enable_history": true, "retention_days": 30 }, "seo": { "meta_title": "Workout Plan Generator | Hilarious Gym Routines | DigitalPrank.com", "meta_description": "Generate custom workout plans with absurd exercises and meme-worthy routines. Perfect for gym bros, fitness influencers, or practical jokers.", "canonical_url": "https://digitalprank.com/tools/workout-plan-generator", "structured_data": { "type": "WebApplication", "category": "Entertainment" } }, "help": { "quick_start": [ "Step 1: Pick your custom goal and gender.", "Step 2: Customize intensity (Pro).", "Step 3: Add custom supplements/testimonials (optional).", "Step 4: Click 'Generate Plan' and laugh hard.", "Step 5: Download or share your workout masterpiece." ], "faq": [ { "question": "Is this a real workout plan?", "answer": "Nope. Absolutely not. This is for entertainment only. If you try to follow it, please don’t sue us when you attempt ‘Fire Hydrant Lunges’ with actual fire hydrants." }, { "question": "Can I customize the plan?", "answer": "Yes! Pro users can change difficulty, add custom products, and even export in multiple formats." }, { "question": "Can I share my custom plan?", "answer": "Absolutely! We encourage sharing the absurdity on social media. Tag us!" } ], "examples": [ { "title": "The Shredzilla 6-Pack Blitz", "description": "Unreal core workout with explosive custom cardio.", "input": { "goal_type": "shredzilla", "gender": "male", "difficulty": "extreme" } }, { "title": "Dad Bod to Rad God Plan", "description": "Hilarious mix of pushups, yard work, and emotional lunges.", "input": { "goal_type": "dad_bod_upgrade", "gender": "any", "difficulty": "easy" } } ] }, "monitoring": { "track_usage": true, "track_performance": true, "error_reporting": true, "analytics_events": [ "workout_plan_generated", "pro_upgrade" ] }, "security": { "input_sanitization": true, "csrf_protection": true, "rate_limiting": true, "blocked_domains": [], "max_input_length": 200, "allowed_file_types": ["pdf"] }, "version": { "schema": "3.0.0", "tool": "1.0.0", "api_version": "v1" } } } FILE 2: /home/workout-plan-generator.digitalprank.com/public_html/processor.php code PHP setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); } catch (PDOException $e) { http_response_code(500); logUsage(null, 'workout-plan-generator', $_SERVER['REMOTE_ADDR'], null, 'db_connection_failed', [], ['error' => 'Database connection failed.'], 0); echo json_encode(['success' => false, 'message' => 'Error: Cannot connect to the service. Please try again later.']); exit; } // --- Configuration & Initialization --- $startTime = microtime(true); $config_path = __DIR__ . '/tool_config.json'; if (!file_exists($config_path)) { http_response_code(500); logUsage($pdo, 'workout-plan-generator', $_SERVER['REMOTE_ADDR'], null, 'config_missing', [], ['error' => 'Config file not found.'], 0); echo json_encode(['success' => false, 'message' => 'Error: Tool configuration is missing.']); exit; } $config = json_decode(file_get_contents($config_path), true)['tool']; $tool_slug = $config['identity']['slug']; // --- Input & User --- $input = json_decode(file_get_contents('php://input'), true); $user_id = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : null; $user_ip = $_SERVER['REMOTE_ADDR']; $response = [ 'success' => false, 'data' => null, 'message' => '', 'usage' => [], 'access' => [], 'features' => $config['features'] ]; try { // --- Access Control & Usage Limits --- $access = getUserAccessLevel($pdo, $user_id, $tool_slug); $response['access'] = $access; $limit = $config['limits']['tier_daily'][$access['tier']]; $usageCheck = checkDailyUsage($pdo, $tool_slug, $user_ip, $user_id, $limit); $response['usage'] = $usageCheck; if (!$usageCheck['can_proceed']) { throw new Exception("Daily usage limit reached. Upgrade for more.", 429); } // --- CSRF Protection --- if (!isset($input['csrf_token']) || !hash_equals($_SESSION['csrf_token'], $input['csrf_token'])) { throw new Exception("Invalid session token. Please refresh the page.", 403); } // --- Feature Overrides --- $overrides = getToolOverrides($pdo, $tool_slug); foreach ($config['fields'] as &$field) { if (isset($overrides[$field['id']])) { $field['pro_only'] = ($overrides[$field['id']]['tier_required'] !== 'free'); if ($overrides[$field['id']]['override_type'] === 'disabled') { $field['disabled'] = true; } } } unset($field); // {{TOOL_PROCESSING_START}} // --- Input Validation --- $validated_input = []; $field_map = array_column($config['fields'], null, 'id'); $required_fields = array_filter($field_map, fn($f) => $f['required'] ?? false); foreach ($required_fields as $field_id => $field_config) { if (!isset($input[$field_id]) || empty($input[$field_id])) { throw new Exception("Missing required field: " . $field_config['label']); } } foreach ($input as $key => $value) { if (!isset($field_map[$key])) continue; $field_config = $field_map[$key]; if (isset($field_config['disabled']) && $field_config['disabled']) { throw new Exception("Field " . $field_config['label'] . " is currently disabled."); } if ($field_config['pro_only'] && !$access['has_pro_access']) { if (($field_config['type'] === 'checkbox' && $value === true) || ($field_config['type'] !== 'checkbox' && $value !== $field_config['default'])) { throw new Exception("You must have a Pro account to use the '{$field_config['label']}' feature."); } } // Sanitize and validate $sanitized_value = filter_var($value, FILTER_SANITIZE_FULL_SPECIAL_CHARS); if ($field_config['type'] === 'select') { $allowed_values = array_column($field_config['options'], 'value'); if (!in_array($sanitized_value, $allowed_values)) { throw new Exception("Invalid value for " . $field_config['label']); } } $validated_input[$key] = $sanitized_value; } // --- Content Generation Data --- $workout_data = [ 'exercises' => [ 'shredzilla' => ['Ab-bliterating Giga-Crunches', 'Volcano Squats', 'T-Rex Rows', 'Supernova Shoulder Press', 'Black Hole Lunges'], 'dad_bod_upgrade' => ['Lawnmower Pulls (each side)', 'Competitive Napping', 'Grocery Bag Farmer\'s Walk', 'Taking Out The Trash Sprints', 'Remote Control Curls'], 'beach_biceps' => ['Diamond-Cutter Curls', 'Ocean Wave Hammer Curls', 'Sun-God Bicep Pose (Hold)', 'Tidal Wave Tricep Extensions', 'Sand Bucket Raises'], 'hollywood_chest' => ['Red Carpet Flys', 'Paparazzi Push-ups (explosive)', 'Action Hero Bench Press', 'Movie Star Pullovers', 'Stuntman Dips'], 'zero_effort_abs' => ['Abdominal Contemplation', 'Synergistic Sofa Twists', 'Core Stabilization (while watching TV)', 'Deep Breathing Reps', 'Positive Affirmation Planks'] ], 'trainers' => [ 'male' => ['Chad Broseph', 'Rick Gains', 'Swole Daddy'], 'female' => ['Buffy McSwole', 'Tina Tonik', 'Shreddy Betty'], 'non_binary' => ['Alex Flex', 'Jordan Iron', 'Ripley Power'] ], 'supplements' => ['Unicorn Protein Powder', 'Gamer-Grade Pre-Workout', 'Kryptonite Creatine', 'Phoenix Tears Post-Workout', 'Hulk-Smash Mass Gainer'], 'testimonials' => [ 'I followed this plan for 3 days and now my biceps have their own biceps. Thanks, {TRAINER}!', 'My dad bod has been upgraded to a rad bod. 10/10 would mow the lawn for gains again.', 'I thought "Zero-Effort Abs" was a joke. It is, but now I can laugh without my core hurting. A win-win.', 'The Hollywood Chest Gains plan got me mistaken for a celebrity. Now I have a restraining order against the paparazzi. Worth it.', 'I am Shredzilla. Hear me roar. And see my abs.' ], 'titles' => [ 'shredzilla' => 'The Shredzilla Apocalypse Protocol', 'dad_bod_upgrade' => 'The Dad Bod to Rad God Transformation', 'beach_biceps' => 'Operation Beach Annihilation: Biceps Edition', 'hollywood_chest' => 'The A-List Chest & Pecs Blueprint', 'zero_effort_abs' => 'The Path of Least Resistance to a Six-Pack' ] ]; // --- Generation Logic --- $goal = $validated_input['goal_type']; $gender = $validated_input['gender']; $difficulty = $access['has_pro_access'] ? ($validated_input['difficulty'] ?? 'medium') : 'medium'; $include_supps = $access['has_pro_access'] && ($validated_input['include_supplements'] ?? false); $include_tests = $access['has_pro_access'] && ($validated_input['include_testimonials'] ?? false); if ($gender === 'any') { $gender = array_rand(array_flip(['male', 'female', 'non_binary'])); } $trainer = $workout_data['trainers'][$gender][array_rand($workout_data['trainers'][$gender])]; $plan = [ 'planTitle' => $workout_data['titles'][$goal], 'trainerName' => $trainer, 'goal' => $field_map['goal_type']['options'][array_search($goal, array_column($field_map['goal_type']['options'], 'value'))]['label'], 'difficulty' => $field_map['difficulty']['options'][array_search($difficulty, array_column($field_map['difficulty']['options'], 'value'))]['label'], 'weeklySchedule' => [] ]; $difficulty_map = [ 'easy' => ['sets' => 3, 'reps' => '8-10', 'days' => 2], 'medium' => ['sets' => 4, 'reps' => '10-12', 'days' => 3], 'extreme' => ['sets' => 'As many as you can before you cry', 'reps' => 'To failure, then one more', 'days' => 5] ]; $sets_reps = $difficulty_map[$difficulty]; $selected_exercises = $workout_data['exercises'][$goal]; shuffle($selected_exercises); $days_of_week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; for ($i = 0; $i < $sets_reps['days']; $i++) { $day_plan = [ 'day' => $days_of_week[$i], 'focus' => 'Full Body ' . ucfirst($goal) . ' Assault', 'exercises' => [] ]; $exercises_for_day = array_slice($selected_exercises, 0, rand(3,4)); foreach($exercises_for_day as $ex) { $day_plan['exercises'][] = [ 'name' => $ex, 'sets' => $sets_reps['sets'], 'reps' => $sets_reps['reps'] ]; } $plan['weeklySchedule'][] = $day_plan; } if ($include_supps) { shuffle($workout_data['supplements']); $plan['supplementStack'] = array_slice($workout_data['supplements'], 0, rand(2,3)); } if ($include_tests) { $testimonial = $workout_data['testimonials'][array_rand($workout_data['testimonials'])]; $plan['testimonial'] = str_replace('{TRAINER}', $trainer, $testimonial); } $output_data = $plan; // --- Store Results in Database --- if ($config['database']['store_results'] && $user_id) { $sql = "INSERT INTO {$config['database']['tool_specific_table']} (user_id, goal_type, gender, difficulty, settings_json, plan_output) VALUES (?, ?, ?, ?, ?, ?)"; $stmt = $pdo->prepare($sql); $settings = json_encode(['supplements' => $include_supps, 'testimonials' => $include_tests]); $stmt->execute([$user_id, $goal, $gender, $difficulty, $settings, json_encode($output_data)]); } // {{TOOL_PROCESSING_END}} $response['success'] = true; $response['data'] = $output_data; } catch (Exception $e) { $response['message'] = $e->getMessage(); http_response_code($e->getCode() > 200 ? $e->getCode() : 400); } $processingTime = microtime(true) - $startTime; logUsage($pdo, $tool_slug, $user_ip, $user_id, 'generate', $input, $response, $processingTime); // Update daily usage count on success if ($response['success']) { updateDailyUsage($pdo, $tool_slug, $user_ip, $user_id); $response['usage']['current_usage']++; } echo json_encode($response); FILE 3: /home/workout-plan-generator.digitalprank.com/public_html/tool_form.php```php 'free', 'has_pro_access' => false]; // In a real app, this would be fetched // Example: require_once 'path/to/user/functions.php'; $user_access = getUserAccessLevel(); ?> <?php echo htmlspecialchars($config['identity']['name']); ?> - DigitalPrank

code Code
>

Loading...
×
```### FILE 4: /home/workout-plan-generator.digitalprank.com/public_html/diagnostic.php ```php Unauthorized Access

You do not have permission to view this page.

'); } ini_set('display_errors', 1); error_reporting(E_ALL); function check($description, description}"; try { $result = c a l l b a c k ( ) ; i f ( callback();if( result === true) { echo 'OK'; } else { echo 'FAIL
' . htmlspecialchars($result) . '
'; } } catch (Exception e->getMessage()) . ''; } echo ""; } ?> System Diagnostic: Workout Plan Generator

System Diagnostic: Workout Plan Generator

getAttribute(PDO::ATTR_CONNECTION_STATUS) ? true : "Connection failed."; }); check("Required tables exist", function() use ($pdo, $config) { $tables = [ 'wp_digitalprank_tools', 'wp_digitalprank_usage', 'wp_digitalprank_usage_log', 'wp_pms_member_subscriptions', 'wp_digitalprank_entitlements', 'wp_digitalprank_tool_overrides' ]; if (isset($config['tool']['database']['tool_specific_table'])) { $tables[] = $config['tool']['database']['tool_specific_table']; } $stmt = $pdo->query("SHOW TABLES"); $existing_tables = $stmt->fetchAll(PDO::FETCH_COLUMN); $missing = array_diff($tables, $existing_tables); return empty($missing) ? true : "Missing tables: " . implode(', ', $missing); }); // --- Dependencies --- check("PHP Version (8.1+)", function() { return version_compare(PHP_VERSION, '8.1.0', '>=') ? true : "Current version is " . PHP_VERSION; }); check("PHP Extensions", function() use ($config) { $missing = []; foreach ($config['tool']['dependencies']['php_extensions'] as $ext) { if (!extension_loaded($ext)) $missing[] = $ext; } return empty($missing) ? true : "Missing extensions: " . implode(', ', $missing); }); check("Python Virtual Environment", function() { $venv_path = __DIR__ . '/venv'; return is_dir($venv_path) ? true : "Python venv not found at {$venv_path}"; }); check("Python Packages", function() use ($config) { $venv_python = __DIR__ . '/venv/bin/python'; if (!file_exists($venv_python)) return "Python executable not found in venv."; $missing = []; foreach ($config['tool']['dependencies']['python_packages'] as $pkg) { $command = escapeshellarg($venv_python) . " -c " . escapeshellarg("import {$pkg}"); exec($command . " 2>&1", $output, $return_var); if ($return_var !== 0) $missing[] = $pkg; } return empty($missing) ? true : "Missing Python packages: " . implode(', ', $missing); }); // --- File System --- check("Directory Permissions", function() { return is_writable(__DIR__) ? true : "Directory " . __DIR__ . " is not writable by the web server."; }); // --- Tool-Specific Test --- check("Core workout generation logic", function() { // A simple, non-DB dependent test of the core logic from processor.php $goal = 'dad_bod_upgrade'; $exercises = ['Lawnmower Pulls', 'Grocery Bag Curls']; if (is_array($exercises) && count($exercises) > 0) { return true; } return "Failed to retrieve exercise list for a sample goal."; }); ?>
CheckStatus
``` ### FILE 5: /home/workout-plan-generator.digitalprank.com/public_html/help.md ```markdown # Workout Plan Generator Help Generate hilarious, over-the-top custom workout plans with ridiculous exercises, made-up trainers, and epic fitness goals. Perfect for pranks, memes, or just a laugh. Quick Start Guide Here's how to get your first ridiculous workout plan in seconds: Step 1: Pick your custom goal and gender. Step 2: Customize intensity (Pro). Step 3: Add custom supplements/testimonials (optional). Step 4: Click 'Generate Plan' and laugh hard. Step 5: Download or share your workout masterpiece. Frequently Asked Questions (FAQ) Q: Is this a real workout plan? A: Nope. Absolutely not. This is for entertainment only. If you try to follow it, please don’t sue us when you attempt ‘Fire Hydrant Lunges’ with actual fire hydrants. Q: Can I customize the plan? A: Yes! Pro users can change difficulty, add custom products, and even export in multiple formats. Q: Can I share my custom plan? A: Absolutely! We encourage sharing the absurdity on social media. Tag us! Usage Examples Here are a couple of examples to get your creative (and muscular) juices flowing: Example 1: The Shredzilla 6-Pack Blitz Description: Unreal core workout with explosive custom cardio. Sample Input: Fitness Goal: Become Shredzilla Gender: Male Workout Intensity: Extreme Example 2: Dad Bod to Rad God Plan Description: Hilarious mix of pushups, yard work, and emotional lunges. Sample Input: Fitness Goal: Upgrade Dad Bod Gender: Surprise Me Workout Intensity: Beginner (Low Sweat) code Code ### FILE 6: /home/digitalprank.com/public_html/blog/data/tools/workout-plan-generator.json ```json { "@context": "https://schema.org", "@type": "WebApplication", "name": "Workout Plan Generator", "description": "Generate custom workout plans with absurd exercises and meme-worthy routines. Perfect for gym bros, fitness influencers, or practical jokers.", "applicationCategory": "Entertainment", "operatingSystem": "Any (Web-based)", "url": "https://workout-plan-generator.digitalprank.com", "image": "https://cdn.digitalprank.com/images/tools/workout-plan-generator.png", "potentialAction": { "@type": "CreateAction", "target": "https://workout-plan-generator.digitalprank.com" }, "mainEntity": { "@type": "WebPage", "mainContentOfPage": { "@type": "WebPageElement", "cssSelector": ".container" } }, "publisher": { "@type": "Organization", "name": "DigitalPrank", "url": "https://wp.digitalprank.com" }, "featureList": [ "Hilarious Fitness Goal Generation (e.g., Become Shredzilla, Upgrade Dad Bod)", "Customizable Gender for Trainer Names", "Selectable Workout Intensity (Pro Feature)", "Inclusion of Custom Supplement Suggestions (Pro Feature)", "Addition of Custom Testimonials from Influencers (Pro Feature)", "Instant Generation of a Full, Shareable Workout Plan", "Downloadable PDF Results" ], "technicalDocumentation": { "dependencies": { "php": "8.1+", "php_extensions": ["json", "curl"], "python": "3.x", "python_packages": ["faker", "jinja2"] }, "database": { "table": "custom_workout_plan_history", "stores_results": true } }, "userGuide": { "title": "How to Generate the Funniest Workout Plan", "steps": [ { "name": "Select Your Goal", "description": "Choose from a list of absurd fitness goals like 'Beach Biceps Only' or 'Zero-Effort Abs'." }, { "name": "Choose a Gender", "description": "This influences the name of the custom trainer who created your plan." }, { "name": "Go Pro for More Laughs", "description": "With a Pro account, you can crank the intensity to 'Extreme (No Survivors)' and add custom supplement recommendations and testimonials." }, { "name": "Generate and Share", "description": "Click the button and receive your masterpiece. Share it with friends or on social media to prank your fitness-obsessed followers." } ] } } FILE 7: /home/workout-plan-generator.digitalprank.com/public_html/deploy.sh code Bash #!/bin/bash set -e TOOL_SLUG="workout-plan-generator" TOOL_DOMAIN="${TOOL_SLUG}.digitalprank.com" TOOL_DIR="/home/${TOOL_DOMAIN}/public_html" VHOST_CONF="/usr/local/lsws/conf/vhosts/${TOOL_DOMAIN}.conf" DB_NAME="digitalprank_db" DB_USER="dp_user" DB_PASS="#$Dealer2355" echo "--- Starting deployment for ${TOOL_SLUG} ---" # 1. System & PHP Dependencies echo "[1/7] Installing system and PHP dependencies..." apt-get update > /dev/null apt-get install -y php8.1-json php8.1-curl php8.1-mysql python3-venv > /dev/null echo "Dependencies installed." # 2. Directory Structure & Permissions echo "[2/7] Setting up directory structure..." mkdir -p ${TOOL_DIR} chown -R www-data:www-data /home/${TOOL_DOMAIN} chmod -R 755 /home/${TOOL_DOMAIN} echo "Directory created at ${TOOL_DIR}." # 3. Python Virtual Environment & Packages echo "[3/7] Creating Python venv and installing packages..." python3 -m venv ${TOOL_DIR}/venv source ${TOOL_DIR}/venv/bin/activate pip install --upgrade pip > /dev/null pip install faker jinja2 > /dev/null deactivate chown -R www-data:www-data ${TOOL_DIR}/venv echo "Python environment is ready." # 4. Database Table Creation echo "[4/7] Creating tool-specific database table..." SQL_CREATE="CREATE TABLE IF NOT EXISTS \`custom_workout_plan_history\` ( \`id\` BIGINT PRIMARY KEY AUTO_INCREMENT, \`user_id\` BIGINT NOT NULL, \`goal_type\` VARCHAR(50) NOT NULL, \`gender\` VARCHAR(20) NOT NULL, \`difficulty\` VARCHAR(20) NOT NULL, \`settings_json\` JSON, \`plan_output\` JSON, \`created_at\` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, INDEX \`user_id_idx\` (\`user_id\`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;" mysql -u"${DB_USER}" -p"${DB_PASS}" -hlocalhost ${DB_NAME} -e"${SQL_CREATE}" echo "Table 'custom_workout_plan_history' created or already exists." # 5. OpenLiteSpeed Virtual Host Configuration echo "[5/7] Configuring OpenLiteSpeed virtual host..." cat > ${VHOST_CONF} <s %b \"%{Referer}i\" \"%{User-Agent}i\"" logHeaders 5 rollingSize 10M keepDays 10 } scripthandler { add lsapi:php81 php } extprocessor php81 { type lsapi address uds://tmp/lshttpd/php81.sock maxConns 35 env PHP_LSAPI_CHILDREN=35 initTimeout 60 retryTimeout 0 persistConn 1 respBuffer 0 autoStart 1 path /usr/local/lsws/lsphp81/bin/lsphp backlog 100 instances 1 } rewrite { enable 1 autoLoadHtaccess 1 } EOF echo "Virtual host config written to ${VHOST_CONF}." # 6. Log Rotation echo "[6/7] Setting up log rotation..." cat > /etc/logrotate.d/${TOOL_SLUG} < /dev/null endscript } EOF echo "Log rotation configured." # 7. Finalizing and Restarting Services echo "[7/7] Restarting OpenLiteSpeed to apply changes..." /usr/local/lsws/bin/lswsctrl restart echo "--- Deployment for ${TOOL_SLUG} completed successfully! ---" echo "The tool is now accessible at https://${TOOL_DOMAIN}"