# Commands to run on server rotator-jago.online (152.42.221.54) # Copy and paste these commands one by one on the server # 1. Update system apt update && apt upgrade -y # 2. Install PHP 8.2 apt install -y software-properties-common add-apt-repository ppa:ondrej/php -y apt update apt install -y php8.2 php8.2-fpm php8.2-mysql php8.2-xml php8.2-curl php8.2-mbstring php8.2-zip php8.2-bcmath php8.2-json php8.2-cli # 3. Install Composer curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer chmod +x /usr/local/bin/composer # 4. Install MySQL apt install -y mysql-server # 5. Install Nginx apt install -y nginx # 6. Start services systemctl start php8.2-fpm systemctl enable php8.2-fpm systemctl start mysql systemctl enable mysql systemctl start nginx systemctl enable nginx # 7. Create database mysql -e "CREATE DATABASE IF NOT EXISTS domain_rotator;" mysql -e "CREATE USER IF NOT EXISTS 'domain_rotator'@'localhost' IDENTIFIED BY 'SecurePassword123!';" mysql -e "GRANT ALL PRIVILEGES ON domain_rotator.* TO 'domain_rotator'@'localhost';" mysql -e "FLUSH PRIVILEGES;" # 8. Create app directory mkdir -p /var/www/domain-rotator chown -R www-data:www-data /var/www/domain-rotator # 9. Configure Nginx cat > /etc/nginx/sites-available/rotator-jago.online << 'EOF' server { listen 80; server_name rotator-jago.online www.rotator-jago.online; root /var/www/domain-rotator/public; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } } EOF # 10. Enable site ln -sf /etc/nginx/sites-available/rotator-jago.online /etc/nginx/sites-enabled/ rm -f /etc/nginx/sites-enabled/default # 11. Test and reload Nginx nginx -t && systemctl reload nginx # 12. Setup firewall ufw allow 22/tcp ufw allow 80/tcp ufw allow 443/tcp ufw --force enable # 13. Install SSL certificate apt install -y certbot python3-certbot-nginx certbot --nginx -d rotator-jago.online -d www.rotator-jago.online --non-interactive --agree-tos --email admin@rotator-jago.online echo "✅ Server setup completed!" echo "🌐 Your server is ready at: https://rotator-jago.online" echo "📁 Upload your Laravel app to: /var/www/domain-rotator"