#!/bin/bash # ============================================================================== # FEDORA SERVER DEPLOYMENT SCRIPT (React + Vite + Nginx) # ============================================================================== # This script configures a Fedora Server to host your Fedora-PIS website. # It handles Nginx setup, Firewall rules, and SELinux permissions. # ============================================================================== # --- CONFIGURATION --- DOMAIN="10.1.22.62" # Replace with your actual domain or new IP INSTALL_DIR="/var/www/fedora-website" echo "🚀 Starting deployment on Fedora Server..." # 1. Update and Install Dependencies echo "📦 Installing Nginx, Node.js, and Security Tools..." sudo dnf update -y sudo dnf install -y nginx nodejs git certbot python3-certbot-nginx # 2. Prepare Directory echo "📁 Setting up web directory at $INSTALL_DIR..." sudo mkdir -p $INSTALL_DIR sudo chown -R $USER:$USER $INSTALL_DIR # 3. Build the Project echo "🏗️ Building the React application..." cd $INSTALL_DIR if [ -f "package.json" ]; then npm install npm run build else echo "⚠️ Warning: No package.json found. Make sure your files are in $INSTALL_DIR" exit 1 fi # 4. Configure Nginx echo "⚙️ Configuring Nginx for $DOMAIN..." cat <