#!/bin/bash # Full Deployment Script for aliveawakeandrelativelyalert.com # Features: # - Homepage with banner caption + scrolling text # - Links to secret CalendarDev pages # - Our Journey + CalendarTemplate + Bob'sBoatPurchase (PHP balance tracker) # - Apache VirtualHost config with HTTPS # - .htaccess fallback for HTTPS + redirect # - Password protection on /info.php and /secret/CalendarDev/ # - Alias Bob'sBoatPurchase to both .php and .html DOMAIN="aliveawakeandrelativelyalert.com" WWW_DOMAIN="www.$DOMAIN" WEBROOT="/var/www/html" ADMIN_EMAIL="admin@$DOMAIN" SECRET_DIR="$WEBROOT/secret/CalendarDev" # Ensure root if [ "$EUID" -ne 0 ]; then echo "Please run as root" exit 1 fi echo "=== Step 1: Update system & install packages ===" apt update && apt upgrade -y apt install apache2 wget certbot python3-certbot-apache dnsutils curl fonts-liberation php apache2-utils -y echo "=== Step 2: Download default image ===" wget -O "$WEBROOT/index.jpg" "http://165.227.213.169/david-dibert-z-gL7br3MTk-unsplash.jpg" echo "=== Step 3: Create homepage (index.html) ===" cat < "$WEBROOT/index.html" $DOMAIN
Aliveawakeandrelativelyalert!
BitcoinPirates live!
EOF echo "=== Step 4: Create /secret/CalendarDev/ directory ===" mkdir -p "$SECRET_DIR" # Backup landing page cat < "$SECRET_DIR/CalendarDev.html" CalendarDev Backup

Aliveawakeandrelativelyalert - Backup Landing Page

Welcome to our secure CalendarDev section.

Our Journey

Calendar

Bob's Boat

EOF # Our Journey page cat < "$SECRET_DIR/OurJourney.html" Our Journey

Our Journey

This is the story of how Aliveawakeandrelativelyalert grew.

Back to CalendarDev

EOF # Calendar template cat < "$SECRET_DIR/CalendarTemplate1.html" Calendar Template

Calendar Template

Placeholder for interactive calendar content.

Back to CalendarDev

EOF # Bob's Boat page with PHP cat <<'EOF' > "$SECRET_DIR/Bob'sBoatPurchase.php" Bob's Boat Purchase

Bob’s Boat Purchase

Bob dreamed of owning a boat. With each Bitcoin trade, he saved until finally, he sailed away.





Back to CalendarDev

EOF # Symlink .html to .php for Bob'sBoatPurchase ln -sf "$SECRET_DIR/Bob'sBoatPurchase.php" "$SECRET_DIR/Bob'sBoatPurchase.html" echo "=== Step 5: Password protection setup ===" htpasswd -cb /etc/apache2/.htpasswd Charlesweinert GetLost26! cat < /etc/apache2/conf-available/protected.conf AuthType Basic AuthName "Restricted CalendarDev" AuthUserFile /etc/apache2/.htpasswd Require valid-user AuthType Basic AuthName "Restricted Info" AuthUserFile /etc/apache2/.htpasswd Require valid-user EOF a2enconf protected systemctl reload apache2 echo "=== Step 6: Configure Apache VirtualHost ===" cat < /etc/apache2/sites-available/$DOMAIN.conf ServerName $DOMAIN ServerAlias $WWW_DOMAIN DocumentRoot $WEBROOT RedirectMatch ^/$ https://$DOMAIN/secret/CalendarDev.html ServerName $DOMAIN ServerAlias $WWW_DOMAIN DocumentRoot $WEBROOT SSLEngine on SSLCertificateFile /etc/letsencrypt/live/$DOMAIN/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/$DOMAIN/privkey.pem AllowOverride All EOF a2ensite $DOMAIN.conf a2dissite 000-default.conf systemctl reload apache2 echo "=== Step 7: SSL Setup ===" certbot --apache -d $DOMAIN -d $WWW_DOMAIN --non-interactive --agree-tos -m $ADMIN_EMAIL echo "=== Step 8: Add .htaccess fallback ===" cat < "$WEBROOT/.htaccess" RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Redirect root to CalendarDev.html RewriteRule ^$ /secret/CalendarDev.html [L,R=302] EOF systemctl reload apache2 echo "=== Deployment Complete ===" echo "Site: https://$DOMAIN" echo "Backup Landing: https://$DOMAIN/secret/CalendarDev.html" echo "Homepage: https://$DOMAIN/index.html" echo "Bob’s Boat: https://$DOMAIN/secret/CalendarDev/Bob'sBoatPurchase.html"