๐ŸŒ Web Server Build

Debian 12 with nginx ยท Migrated from VirtualBox to Proxmox

๐Ÿ“Œ Overview

This web server runs Debian 12 with nginx, hosting static content, documentation, and lab status pages. Originally running on VirtualBox, it was migrated to a Proxmox VM on dedicated hardware.

๐Ÿšง Migration Issues Faced

Issue #1: SSH Access Blocked

kex_exchange_identification: read: Connection reset by peer
Connection reset by [CLIENT_IP] port 22

Cause: SSH was hardened to only accept connections from specific clients, blocking management access.

โœ… Fix: Used Proxmox console directly instead of SSH for local access.

Issue #2: Web Server Not Visible Externally

curl: (7) Failed to connect to [DOMAIN] port 80: Connection refused

Cause: nginx was pointing to the wrong directory and had duplicate root lines in its configuration.

โœ… Fix: Cleaned up nginx config and pointed to correct root:
sudo nano /etc/nginx/sites-available/default
# Set root to web directory
sudo nginx -t
sudo systemctl reload nginx

Issue #3: Blank Homepage

<body>
</body>

Cause: The index.html file had no content between the body tags.

โœ… Fix: Added proper HTML content with site branding.

Issue #4: Projects Link Returning 403 Forbidden

403 Forbidden

Cause: No index.html file in the /projects/ directory.

โœ… Fix: Created a projects index page or linked directly to projects.html.

Issue #5: Multiple nginx Root Directories

root /path/to/first;
root /path/to/second;
root /path/to/third;

Cause: Duplicate root lines in nginx config โ€” nginx used the last one, which pointed to a non-existent directory.

โœ… Fix: Removed extra root lines, kept only the correct one.

โœ… Successful Migration Steps

Unlike other VMs, the Debian migration was smooth using the IDE-first method:

# Convert VDI to RAW (preserves partition table)
qemu-img convert -f vdi -O raw debian-web.vdi debian-web.raw

# Create VM with IDE controller (CRITICAL)
qm create [VMID] --name "debian-web" --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0
qm importdisk [VMID] debian-web.raw local-lvm
qm set [VMID] --ide0 local-lvm:vm-[VMID]-disk-0
qm set [VMID] --boot order=ide0
qm start [VMID]

โœ“ Booted first try! Later upgraded to VirtIO for performance.

Why it worked: Debian expects /dev/sda. IDE presents as sda, while SCSI would present as vda and break GRUB.

๐Ÿ“Š Current Status

๐Ÿ“ Key Lessons

โ† Back to Projects