Deployment Guide

Add Oslob Paragliding to your existing Google Cloud server

argonarsoftware@instance-20251204-063532:/var/www$ ls

hillfrontpharkinn.com   html   oslobparagliding ← adding this

Domain

oslobcebuparagliding.com

Server IP

136.110.4.109

GitHub Repo

argonarsoftware-oss/oslobparagliding

Deploy Method

git clone / git pull

1

Push to GitHub (Local Machine)

From your XAMPP PC, push latest code to the repo

Run on your local machine

cd C:\xampp\htdocs\oslobparagliding
git add .
git commit -m "Latest changes"
git push origin main
2

Clone the Repo on the Server

In your cloud shell, clone alongside your existing sites

Run in cloud shell

cd /var/www
git clone https://github.com/argonarsoftware-oss/oslobparagliding.git

Verify

ls /var/www/
Expected: hillfrontpharkinn.com  html  oslobparagliding
3

Set File Permissions

Give Apache ownership, same as your other sites

Run in cloud shell

sudo chown -R www-data:www-data /var/www/oslobparagliding
sudo find /var/www/oslobparagliding -type d -exec chmod 755 {} \;
sudo find /var/www/oslobparagliding -type f -exec chmod 644 {} \;
sudo chmod -R 775 /var/www/oslobparagliding/uploads
4

Fix Base URL Paths

Change /oslobparagliding/ to / for production

Run in cloud shell

cd /var/www/oslobparagliding
sudo grep -rl '/oslobparagliding/' --include='*.php' | sudo xargs sed -i 's|/oslobparagliding/|/|g'
sudo sed -i 's|/oslobparagliding/|/|g' js/app.js

Verify (should return nothing)

grep -rn '/oslobparagliding/' /var/www/oslobparagliding/ --include='*.php' --include='*.js'
On XAMPP the site was at localhost/oslobparagliding/ — on the server it's at the domain root /
5

Create .htaccess for Clean URLs

Route /about, /booking, /services etc. through index.php

Run in cloud shell

sudo tee /var/www/oslobparagliding/.htaccess > /dev/null <<'EOF'
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/admin
RewriteRule ^(.+)$ index.php?page=$1 [QSA,L]
EOF
6

Add Apache Virtual Host

Point oslobcebuparagliding.com to /var/www/oslobparagliding

Create the vhost config

sudo tee /etc/apache2/sites-available/oslobparagliding.conf > /dev/null <<'EOF'
<VirtualHost *:80>
    ServerName oslobcebuparagliding.com
    ServerAlias www.oslobcebuparagliding.com
    DocumentRoot /var/www/oslobparagliding

    <Directory /var/www/oslobparagliding>
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/oslobparagliding_error.log
    CustomLog ${APACHE_LOG_DIR}/oslobparagliding_access.log combined
</VirtualHost>
EOF

Enable and reload Apache

sudo a2ensite oslobparagliding.conf
sudo a2enmod rewrite
sudo systemctl reload apache2
Your existing sites (html, hillfrontpharkinn.com) are untouched — Apache routes by domain name
7

Point Namecheap Domain

Add DNS A records pointing to 136.110.4.109

Nameservers — keep Namecheap BasicDNS

Keep Namecheap's default nameservers (BasicDNS):
  dns1.registrar-servers.com
  dns2.registrar-servers.com

Check yours: Namecheap → Domain List → Manage → Nameservers
Should say "Namecheap BasicDNS" — do NOT change them.

Namecheap → Domain List → Manage → Advanced DNS

Type    Name    Value              TTL
─────   ─────   ────────────────   ─────
A       @       136.110.4.109      600
A       www     136.110.4.109      600

Delete any existing A records pointing to a different IP.
Same IP your other sites use. DNS takes 5 min – 1 hour to propagate.
8

Run the Database Installer

Creates database, all 11 tables, and seeds content — one click

Open in your browser

http://oslobcebuparagliding.com/admin/install.php

Expected output

✓ users
✓ site_settings
✓ hero_slides
✓ services
✓ staff
✓ faqs
✓ gallery_images
✓ cafe_gallery
✓ customers
✓ bookings
✓ page_content
✓ Admin user created (admin / admin123)
✓ All seed data

Installation complete!

After it runs, delete the installer

sudo rm /var/www/oslobparagliding/admin/install.php
9

Add SSL Certificate

Certbot is already on the server — just add the new domain

Run in cloud shell

sudo certbot --apache -d oslobcebuparagliding.com -d www.oslobcebuparagliding.com
Choose option 2 (Redirect HTTP → HTTPS) when prompted. Auto-renews every 90 days.
10

Post-Deployment Cleanup

Change default admin password and remove this guide

Change admin password

1. Go to: https://oslobcebuparagliding.com/admin/
2. Login: admin / admin123
3. Go to Users → Edit admin → Set new password

Delete this deployment guide

sudo rm /var/www/oslobparagliding/deployment-guide.php
11

Setup GitHub Webhook (Auto-Deploy)

Push to GitHub → server auto-pulls. No more manual git pull.

Webhook Secret (already set in webhook-deploy.php)

(see .env WEBHOOK_SECRET)

Use this same secret when adding the webhook on GitHub.

Step C: Allow www-data to run git pull without password

sudo chown -R www-data:www-data /var/www/oslobparagliding
sudo chown -R www-data:www-data /var/www/oslobparagliding/.git

Step D: Mark the repo directory as safe for git

sudo -u www-data git config --global --add safe.directory /var/www/oslobparagliding

Step E: Add the webhook on GitHub

1. Go to: github.com/argonarsoftware-oss/oslobparagliding/settings/hooks
2. Click "Add webhook"
3. Fill in:

   Payload URL:    https://oslobcebuparagliding.com/webhook-deploy.php
   Content type:   application/json
   Secret:         (see .env WEBHOOK_SECRET)
   Events:         Just the push event
   Active:         ✓ checked

4. Click "Add webhook"
5. GitHub will send a ping — check for green ✓

Step F: Test it — push from local and check the deploy log

cat /var/www/oslobparagliding/deploy.log
Now just git push origin main from your local machine — the server auto-deploys within seconds. No more SSH needed for updates.

How Auto-Deploy Works

What happens when you git push

git push GitHub webhook POST webhook-deploy.php git pull + fix perms
  • Verifies GitHub signature (rejects fake requests)
  • Only deploys pushes to main branch
  • Runs git pull + fixes permissions automatically
  • Auto-fixes /oslobparagliding/ paths if they sneak back in
  • Logs every deployment to deploy.log

Troubleshooting

500 Error sudo tail -50 /var/log/apache2/oslobparagliding_error.log
DB connection failed sudo mysql -u root oslobparagliding_db (check if DB exists)
Pages 404 Check .htaccess exists + AllowOverride All in vhost
Wrong site loads sudo apache2ctl -S (check domain → folder mapping)
git pull denied sudo chown -R www-data:www-data /var/www/oslobparagliding/.git
Upload fails sudo chmod -R 775 /var/www/oslobparagliding/uploads
SSL fails dig oslobcebuparagliding.com (DNS must point to server first)

Delete after deployment: sudo rm /var/www/oslobparagliding/deployment-guide.php