In the professional Linux webhosting world, cPanel rules as king. That is not necessarily a bad thing! cPanel is rich in features and largely stable and reliable. But it is also completely unsuitable for a small, inexpensive VPS, which you will find here at LowEndBox. Most likely the The license for cPanel costs significantly more than the VPS you use, and the resources of a smaller VPS are heavily loaded. Does that mean that you're out of the web hosting game altogether? Not for a long time! We have an excellent number of open source control panel options. In this tutorial, we will focus on installing such a solution:
Enter Virtualmin. Virtualmin GPL (the free open source version of the commercial product Virtualmin) is a full-featured open source web hosting control panel that lets you run multiple websites on the same server. Virtualmin uses less disk space (less than 1 GB) and supports CentOS, Debian and Ubuntu without any additional complications. It has a user-friendly web-based user interface for server and account management. It also respects the package manager of your chosen operating system and allows you to make configuration changes outside of Virtualmin without overwriting them.
For this tutorial we go to Virtualmin on a CentOS 7 VPS, which can be found here on LowEndBox. Our KVM-VPS has 15 GB hard disk space, 1 CPU and 512 MB RAM. How is it possible to have a complete web control panel on such a small server, you ask? Read on to find out!
You must use SSH for this tutorial. If you have not signed up for your new VPS yet, read our tutorial. "Use SSH keys to connect to your VPS, "It helps you to sign in and configure your SSH keys.
If you have not yet selected a host name for your server, you must do so now. It can be tempting to use "yourawesomevps.com". To work properly, a fully qualified domain name is required. An FQDN uses a prefix like "server" before "virtualmin-tutorial.tld". The FQDN would be "server.virtualmin-tutorial.tld".
If you have already selected a name for your VPS, it will be set for you by your VPS provider. Otherwise you have to set it manually. On CentOS 7, you can set the host name using SSH with the following command:
echo "server.virtualmin-tutorial.tld"> / etc / hostname
Next we disable SELinux, as its use is not supported for our purposes. We use & # 39; sed & # 39 ;, a Linux program that can do file editing without having to open the file at all. The following command changes the current line SELINUX = in / etc / selinux / config to "disabled":
sed -i's / SELINUX =. * $ / SELINUX = disabled / & # 39; / etc / selinux / config
Restart your server to make sure your hostname is set correctly and SELinux is disabled:
Log in to your VPS again and check the hostname to make sure it's set correctly:
[root@server ~]# Hostname
Let's also check if SELinux is disabled:
[root@server ~]# getenforce
Excellent! Now we will install some basic utilities, including a few that will help us install Virtualmin. Run the following command:
yum -y install perl lsof sysstat lsof traceroute whois wget ftp nano
Now we are ready for the next step: Installation!
To integrate Virtualmin into our little VPS, we use the Virtualmin installer minimal installation This feature essentially removes the main memory interventions – the e-mail server. Although it is possible to install the mail server with 512 MB of RAM, this is not recommended as spam filtering slows down the server considerably. If you want to enable Virtualmin's mail server capabilities, it's a good idea to install a VPS with at least 1GB of memory.
Using Virtualmin provides the ability to install Apache, MySQL, and PHP for you. We use the minimal installation as mentioned before. If you have a server with at least 1 GB of memory, you can omit the "-minimal" tag below.
sh install.sh --minimal
This is what the installation looked like on our test VPS:
Press "y" to continue. Now we only wait a few minutes for Virtualmin to install its minimal stack. As we wait, we talk about what's next. Minimal installation skips many of the most memory-intensive parts of the server, but installs a full LAMP stack. In 10 minutes or less, the installation should be completed! You should see something similar to the following screen:
In the lower right corner you will see a URL for the new control panel of your server. Copy this URL into your notes. Before we move on, we need to set the root password for MySQL. MySQL does not have a root password. This is not a secure configuration. Luckily that is very easy to solve. In the following few commands, replace "ROOTPASS" with a strong password. The password you choose does not have to be your root password. Make sure that you have a record because we will need it later.
First enter "mysql" to get a mysql prompt:
[root@server ~]# mysql
Welcome to the MariaDB Monitor. Commands end with; or g.
Your MariaDB connection ID is 25
Server version: 5.5.60 MariaDB MariaDB server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Enter "help". or & # 39; h & # 39; for help. Enter & # 39; c & # 39; on to clear the current input statement.
Now, after correcting the root password, you can insert:
Update User Password = PASSWORD ("ROOTPASS") where User = & # 39; root & # 39; is;
This is how the process looked on our VPS:
Log in to the URL of the Virtualmin control panel that you previously noted. Ours is ours https: //server.virtualmin-tutorial.tld: 10000, You will also notice that you receive a security alert during your visit. The SSL at this time is just a self-signed certificate. Invoke the URL in your browser, bypass the SSL certificate errors, and you should be greeted with a login screen for Webmin. Do not be alarmed – Webmin is based on Virtualmin and the actual server management is still done with Webmin. Virtualmin handles the virtual hosting part of the workload.
Log in with the username "root" and your root password. The wizard after installation is displayed. If you get a connection error, try using a private browser. Some browser extensions interfere with Virtualmin.
Click Next, and we'll work through the different options. The first question is whether we want to pre-load the Virtualmin libraries. We will choose No to minimize storage requirements. If you have a VPS with at least 1 GB of memory, you can select Yes.
The format is the same for the remaining questions.
Running a MariaDB / MySQL database server? Yes (almost everything uses that!)
Run PostgreSQL database server? No (unless you specifically need it)
Now you will see the MySQL password section of the wizard:
Enter your root password for MySQL that you have previously set. When prompted, select Yes to remove the test database and the anonymous user. Next click.
For the MariaDB / MySQL configuration size, select Medium System (512M). If you have a larger system, you can choose the appropriate size. Next click.
For the DNS configuration you have to select some options. Since our system is only 512 MB in size and the BIND DNS service may be a storage issue, our DNS will be run externally. To do this, you can simply check the "Skip resolution check" box and click Next.
The next configuration option is for password storage. Make a choice that makes sense for you. We selected "Save only hash passwords" for more security. Click Next, and you're done with the post-installation wizard. Click the "Recheck and update configuration" box and let it finish:
When the Verify Configuration screen is complete, click the dashboard in the left column. You get the following screen:
This is the first screen you will see when you sign up. The work is not done yet – we still have some things to do! In the next steps, you need to set up an SSL certificate for Virtualmin, configure Apache to use less disk space, install an updated version of PHP, and make some changes to the PHP configuration. All these things are considered in the second half of this tutorial:
Configure Virtualmin on CentOS for Website Hosting: Part 2