Step-by-Step Process to Build and Manage a Website Using cPanel on a VPS Server

Step-by-Step Process to Build and Manage a Website Using cPanel on a VPS Server

Table of contents

  • Statistics on virtual private servers for 2024
  • The first step: setting up your server
  • Step 2: install cPanel
  • Step 3: create a website
  • The last step: monitor and protect

Stress tests comparing shared hosting and VPS hosting found that performance increased by 15% to 35% by switching from shared hosting to a VPS server. One reason VPS hosting is affordable is that Linux runs on about 60% of all VPS servers. It is open-source and free, meaning that hosting providers can offer much more budget-friendly VPS packages than if their offerings were limited to Windows.

More than 2,500 companies offer VPS hosting, so it shouldn't be impossible to choose a VPS provider that fulfills your requirements in terms of resources, budget, and location.

Setting up your server

Once you've signed up with a VPS provider, you'll need to set up your server. This typically involves selecting an operating system such as CentOS, Ubuntu, or Debian and configuring basic settings like secure shell (SSH) access and networking. On Linux-based systems, OpenSSH is a common choice for an SSH server. You can install it via the OS package manager. The main configuration file for SSH is usually located at /etc/ssh/sshd_config. You can edit this file to customize various settings, such as port number, authentication methods, and access restrictions.

By default, SSH operates on port 22. You can change the port number to improve security and avoid common port scanning attacks.

Installing cPanel

You'll need to purchase a cPanel license from the cPanel store or an authorized cPanel hosting partner. Choose the relevant license type depending on how many accounts you plan to host on your server.

Connect to your VPS server using SSH (Secure Shell) with root privileges. You'll need to have root access to install cPanel and configure your server.

cPanel provides an installation script that automates the installation process. You can access the cPanel & WHM control panel by navigating to https://your_server_ip:2083 through a web browser. You'll be prompted to log in with the username and password provided during the cPanel installation process.

Creating a Website

In cPanel, you can create a website using the built-in tools. This involves adding a domain, setting up DNS, installing an SSL certificate, and creating email accounts. You can register a domain name through your host or a domain registrar and add it to cPanel under the "Domains" section.

You can configure your DNS settings through the control panel to point your domain to your VPS server.

Enable SSL/TLS encryption for your website by installing an SSL certificate. cPanel offers free tools for generating and installing SSL certificates using Let's Encrypt.

Once your website is set up, you can manage various settings and configurations through cPanel, including database management, security settings, etc.

Among the security settings you need to configure are IP whitelisting, firewall rules, and directory permissions. To prevent data loss, set up automated backups of your website files and databases.

Final thoughts: Monitor and protect

Don't think it's over! Your website's performance and security need regular monitoring. cPanel provides tools for monitoring resource usage, website traffic, and security logs.

The main cPanel security issues in 2024 are data manipulation and code injection. One popular hack involves SQL injections and changing settings or parameters. Cybercriminals insert malicious SQL statements for execution into an entry field. In 2023, SQL injection was the primary source of critical web app vulnerabilities worldwide, with 23% of all vulnerabilities.

19% of the high-risk security issues found in 2022 tests performed by Synopsis were linked to cross-site scripting attacks.

Last but not least, the impact of code injections definitely shouldn't be overlooked. The entire server running a website can be affected. Code injections lead to data loss or corruption or denied access. They ranked 25th on the 2022