-
Notifications
You must be signed in to change notification settings - Fork 0
1. From zero to installing a control panel and apache
You will need:
- a VPS hosting plan that includes root access - this need not be expensive. If you look carefully, some hosts offer plans starting at $USD 5 or less per month. When ordering a VPS, the host should NOT need to know what domain name you plan to use - in other words, a true VPS should be able to be provisioned without asking you for your domain name or desired nameservers
- one or more domain names [optional] - but if you want SSL (which you do), it's best if you do it via a domain name
You will be able to host multiple domain names from the one hosting plan.
Using the credentials given to you by your web host, log into your host's server panel and it will let you point and click your way to installing the latest version of Ubuntu (unless your host has already done this for you). Regardless of whether you or your host installed Ubuntu, take note of the root password at this time.
We are using Ubuntu because it's easy for a beginner to work with and it's well-documented, with plenty of tutorials available for almost every aspect of server management. So regardless of your purpose, Ubuntu is a good base operating system on which to build a server.
The tutorial here was carried out with Ubuntu 22.04
Open a terminal on your machine, and then do:
ssh root@your.server.ip.address
It will prompt you for the password, enter the root password which was given to you by your hosting company or upon your OS install in your VPS panel.
NOTE: if at any point, the info upon login says you need to restart the server, go ahead and do it from your hosting company's control panel (the same place where you installed the operating system). Wait 5 to 10 minutes after a restart before logging in again, since it will take some time after startup to allow SSH to run again.
We will do a few things to secure your server to protect it from brute force attacks on the root password, but first, open necessary ports and install Webmin.
You'll want to open the port for the Webmin panel (10000), as well as those for your Apache server when you install it in later steps (80 and 443) and for your nameservers and DNS records (53)
type the following into the command line:
ufw allow 10000
ufw allow 80
ufw allow 443
ufw allow 53/tcp
ufw allow 53/udp
If later you try to access any panel or connection on your server that just hangs, there's a good chance that it's because you didn't open the relevant port. Don't worry - this tutorial will include opening the correct ports as we go.
Webmin, like most control panels, are best installed in a fresh environment so we will do that now.
[optional for extra reading - The official Webmin installation instructions are available at https://webmin.com/download/ ]
At the time of writing, the installation instructions for Webmin were pretty easy - just 3 lines! Type these one at a time in the server terminal from previous step where you are logged in as root:
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
sh setup-repos.sh
It's normal that this will take some time, it needs to download keys, install the software, etc.
At this point, it will tell you what command to use to install Webmin, so go ahead and do that. At the time of writing, it was
apt-get install --install-recommends webmin
Using any browser, navigate to http://your.server.ip.address:10000
Your browser will issue a warning about an insecure connection - this is because Webmin is using a self-signed certificate. Go to "advanced" and proceed anyway. We will fix this later, but on the very first connection you won't have the option to change this.
You will arrive at the Webmin login page. Log in as root and use the root password that you used in the previous steps.
Set the system time to your local timezone by going to the Webmin menu, then Hardware -> System Time
In the Webmin menu, go to Unused Modules and install Apache from there. I love the easy install! Next we'll move along to nameservers so that you can connect your domain(s) with your web server.