If you're looking to set up your own VPS server on a laptop or Raspberry Pi, here's a step-by-step guide to install all the tools you need to host unlimited websites using Webmin, DuckDNS, Apache, and Cloudflare for free SSL. This guide is tailored for an Ubuntu server running on VirtualBox, but the steps apply to most Ubuntu installations.
Step 1: Setting Up the Ubuntu Virtual Machine
1. Install VirtualBox and Create a VM
- Download and install Oracle VirtualBox.
- Create a new virtual machine:
- Select Ubuntu (64-bit) as the operating system.
- Allocate at least 2GB RAM and 20GB disk space.
- Attach an Ubuntu ISO file and install Ubuntu.
2. Enable Networking
- Set the VirtualBox network adapter to Bridged Mode so the VM can access your local network and internet.
- Boot into the Ubuntu VM and update the system:
Step 2: Install Webmin
Webmin is a powerful web-based control panel for managing servers.
1. Install Dependencies
Run the following commands:
2. Add the Webmin Repository
3. Install Webmin
4. Allow Webmin Through the Firewall
If ufw
(Uncomplicated Firewall) is enabled:
5. Access Webmin
Open a browser on your host machine and go to:
to ckeck you vm ip run
ip addr
Log in with your Ubuntu username and password.
Step 3: Set Up DuckDNS for Dynamic DNS
DuckDNS helps you manage a domain name even if your ISP assigns a dynamic IP.
1. Install DuckDNS
Run these commands:
2. Configure DuckDNS
Edit the install.duckdns.sh
script:
Add your DuckDNS token and desired subdomain:
Save the file and set up a cron job to run the script every 5 minutes:
Step 4: Install Apache Web Server
Apache will serve your websites.
1. Install Apache
2. Enable Apache
Start and enable Apache:
3. Allow HTTP and HTTPS Through the Firewall
Step 5: Configure Cloudflare for Free SSL
Cloudflare provides free SSL certificates and helps with DNS management.
1. Point DuckDNS to Cloudflare
- Log in to your Cloudflare account.
- Add your domain or subdomain.
- Configure the DNS settings to point to your DuckDNS subdomain.
2. Enable SSL
- In Cloudflare’s dashboard, go to the SSL/TLS tab.
- Select Full (Strict) mode.
Step 6: Test Your Setup
Access the Apache Server
- Open a browser and visit your DuckDNS domain:
- Open a browser and visit your DuckDNS domain:
Test HTTPS
- Ensure HTTPS works by visiting:
- Ensure HTTPS works by visiting:
Optional: Monitor and Manage with Webmin
Use Webmin to:
- Add virtual hosts for multiple websites.
- Monitor server performance.
- Configure DNS, firewalls, and more.
No comments:
Post a Comment