This tutorial isn’t just about how to install and configure CWP on a server. It is rather a complete guide to help you to set up a server or VPS from start to finish. You will not only install & configure the Control Web Panel on a CentOS server but also become proficient to handle a VPS yourself.
If you are new to VPS hosting and don’t know how to proceed then this article is for you. You will have the good technical expertise to manage servers after reading this install & configure CWP on the CentOS guide.
My Experience with the First Virtual Private Server
When I bought the first VPS from ResellerClub, I didn’t know enough about it to get started. Luckily, it had the WHM/cPanel software preinstalled for server administration. Still, I had to learn a lot of technical stuff to be able to effectively handle that.
Later when I became proficient, I found the server expensive in long term. Additionally, I started implementing things myself rather than waiting for the host to perform them. Also, I liked my granular control than sharing stuff with hosting guys.
So I searched for alternatives. Then I came to know that I’m using a managed VPS which is much costlier compared to an unmanaged one. I switched to unmanaged hosting with vpsserver.com and now I’m a fan of unmanaged VPS.
I have mentioned the differences between both types of VPSs in the next section. I found CWP a better and suitable application among many for server and hosting management in unmanaged VPS. Still, the information, how to install and configure the CWP, how to set up & secure the VPS and make it ready, all were discrete at that time.
So I decided to gather all the scattered information into one place and here is this guide. You will not only learn to set up VPS from start to finish but also know various aspects like choosing the right VPS, SSH, security, performance.
Managed vs Unmanaged VPS
While there are several types of VPS products available, we’re focusing on a very important difference. This is managed vs unmanaged VPS hosting.
A hypervisor software divides a physical server into tens or hundreds of virtual servers. Each of them runs its own OS as well as acquires a certain portion of the server’s resources. So basically a VPS you purchase, is a virtual server or container in a dedicated physical server.
In managed VPS, the service provider is responsible to take care of the server like core updates, maintenance, and software installation. So you can focus on running websites while leaving server management tasks to them.
Managed VPS hosting has its own advantages and disadvantages. On the positive side, you get support. You don’t require having that technical knowledge. Also, it saves time for you.
However, you pay extra money to the hosting provider for managing services. Also, the cost increases due to the license fee of the server management software like cPanel or Plesk used.
Further, depending on the hosting plan, you may have or haven’t the root access to the server. So you may have to depend on the hosting support.
While it’s purely a matter of faith as web hosts already have access to all data stored on the server despite the type of hosting, remember that you grant DIRECT access to your data on the VPS for the host in a managed hosting environment.
It is you who have to take care of the server management in unmanaged VPS hosting. Either it is application installation, updates, backup feature, or security of the virtual private server.
The hosting provider only takes care of the physical server, hardware, availability, and initial Operating System installation.
So you only pay the cost of the server but invest time to manage it. But it gives you complete access to the virtual server and you can control every aspect of it. The only things you require are a little time and initial technical expertise that you will gain in this article.
Managed or Unmanaged – Which VPS is Right for Me
Now here is the key question. Managed or unmanaged one, which VPS you should select? The explanations below will help you to choose the better option.
- It requires quite a little or less time every once or twice a month to maintain the VPS after the initial set up.
- Generally, the server management application like CWP or cPanel updated itself with an automated script.
- Not all those programs offer automatic RPM packages updates. In the case of CWP, only the pro version provides an option to update selected or all packages. Just, it is not a configure once and forget thereafter option. However, the SSH command always exists to easily update them.
- While I’m not a Linux administrator, I didn’t find it difficult or technically incapable to manage VPS.
However, there might be cases when you feel the need for the host’s support if not everything is set up properly. For example security concerns, unexpected technical issues as well as lack of time at a certain point.
If you’re unsure then my advice is, read this guide and try unmanaged VPS hosting first for a month through a monthly plan. If you feel ok then continue with it else upgrade to managed or buy the Service Level Agreement to receive the host’s support. SLA is kind similar to managed VPS hosting.
Finally, below are points mentioning conditions when each of these could be a better choice.
Unmanaged VPS if Good if You
- Want cost savings.
- Don’t have crucial business requirements.
- Want to learn everything from the basics.
- Don’t want to give control to an outside party.
Opt a Managed VPS if You
- Feel yourself less-confident.
- Still lack technical expertise.
- Want to focus only on the business.
- Can wait for your request to get processed.
What VPS Configuration do I Need?
Hiring servers is somehow like buying computers. When you buy either, you have to consider CPU, RAM, storage requirements in common. Bandwidth is an additional consideration for servers. While these vary for websites and businesses, here are a few practical tips to choose the right configuration.
Check the Requirements of Server Management Application
The first consideration is checking the requirements of the VPS management program you wish to use. You can visit the official website of the program for this. For example, CWP requires a 64 bit CentOS Operating System and recommends 4+ GB of RAM.
Antivirus and Email Services Require Significant Memory
Antivirus and system scanning services demand a considerable memory. The same is true for email and spam protection services. So if you’re using these services then 4GB minimum memory is advisable for CWP.
In contrast, if the VPS is for a small and personal level without email services, you can cut down the memory requirement to half. I have also utilized a low resources VPS with moving email operations to a third-party service.
Disk Space and Bandwidth Consideration
On average, 20GB disk space is good for the Operation System, server management program, applications, and updates. The websites’ hosting requires additional space. Further, a backup feature always demands a huge availability of storage space.
Usually, servers come with plenty of bandwidth. So websites with average traffic don’t reach that limit. However, this can be an important consideration for huge traffic websites.
Software and Relevant Considerations
Acquiring knowledge before buying VPS hosting can help to choose the right VPS, saving significant money, as well as better management.
For example, a VPS I inquired about had OpenVZ virtualization technology instead of KVM. As result, I won’t be able to restrict traffic from certain countries due to the limit of OpenVZ. Thus I always use KVM based virtual private servers.
The scalability of the server, and the reliability of the host, both are important considerations. Always choose a reputed host that offers VPS scalability. It allows to us start with a reliable VPS with minimal resources and expand it later as requirements grow.
Similarly, there are standard (private) virtual servers as well as cloud VPS. And the latter is better. All web hosts I mentioned in the article, provide quality VPS services. Also, each of them is well-known in the industry.
About CWP – Control/CentOS Web Panel
CentOS Web Panel is a free web hosting control panel for quick and easy management of dedicated as well as virtual private servers. It is a web-based application with a GUI and a set of tools to simplify server management processes.
There are other cPanel alternatives as well. But I prefer CWP because it appears as a feature-rich panel. While it is not completely free, the free version has plenty of options and does its job beautifully. Also, the price of the pro version is quite economical.
Formerly, CWP was known as CentOS Web Panel prior to its release for CentOS version 8. And the old website link is http://centos-webpanel.com. This website has the documentation related to CWP for CentOS 6 and 7.
With the release of CWP for CentOS 8, the developers have officially renamed it to Control Web Panel. Also, they have set a separate site for this. You can find all the recent information using the link https://control-webpanel.com.
Web Hosts Offer Application Installation too
When you buy a VPS, you’re being asked for an Operating System like CentOS, Ubuntu, Fedora, or Windows OS alternatives for the server. Further, some web hosts also offer a list of hosting management applications (cPanel, Plesk, CWP, VestaCP, Froxlor, etc.). There you can choose one and the host will install it for you.
If you have this facility then you can get Control Web Panel (CWP) preinstalled. However, I would suggest, don’t use the application installation feature offered by the host. Rather follow this easy tutorial to understand what are the processes and steps.
Once you have understood, you would never have any trouble in setting up a VPS regardless of the web hosting company you pick. You will also learn new things that are never present in shared hosting.
Details You Get when Buy a VPS
When you buy a VPS, the web host provides you a set of credentials to let you begin. It includes:
- Username – It’s generally “root”.
- Server IP
- SSH port – By default, the port is 22.
Early Pointing Domains to VPS with Custom Nameservers
You have obtained the IP address of the server. So you’re capable to point domains to the VPS. Doing it earlier would let you rather smoothly set up hostname and NS records in the CWP later. It will also help you avoid waiting for domain propagation as well as facing unnecessary issues.
Due to the above reason, it is a good idea to point at least the main domain under which the hosting account is setup. Later, you can follow an almost similar approach to point additional domains.
However, if the main domain is in production. Or there is a website set up on that, perform the nameserver change later to minimize the downtime.
Adding Child Nameservers at Domain Registrar Level
These steps are only for the main domain of the VPS. You need to create two child nameserver records for this domain.
Assuming that the main domain is example.com and the nameservers we will use are ns1.example.com & ns2.example.com. Also, the IP address of the server is 22.214.171.124. The steps are:
- Login to the domain registrar’s website.
- Go to the DNS management page of this domain.
- Find the section that allows to set up child (branded/custom) nameservers.
- Add two records so that they could appear like:
Pointing Domains to Custom Nameservers
In the previous step, you have registered two custom nameservers. Now you can use these child nameservers as nameservers for other domains. Know that registering child NS in the main domain doesn’t mean that it will automatically start pointing itself to those.
You have to manually point the main domain as well by specifying NS. To point the domain example.com to the VPS using branded nameservers:
- Login to the domain registrar’s website.
- Go to the DNS management page of this domain.
- Find the section that allows adding nameservers records.
- Add two records so that they could appear like:
Point all other domains you want to host on the VPS by replacing nameservers with the child NS of the main domain. Also, don’t forget to replace domain names, nameservers as well as the server IP with actual ones.
Technically, it takes up to 48 hours to propagate before the record is fully active. In general, it starts reflecting in a few hours. Also, it would work only after you would have added domains in the VPS management application (CWP here) which will generate necessary DNS records in turn.
Setting up the Server – Before You Start
In the next few sections, you will learn to install Control Web Panel. Keep in mind that CWP requires CentOS 64 bit Operating System. It doesn’t work on other Linux based OS.
So I assume you have purchased a VPS and chosen CentOS as Operating System during the checkout. If not then visit vpsserver.com and get a free VPS for 7 days.
It doesn’t matter that the VPS is either managed or unmanaged. The essential things are it should have CentOS installed. Also, there should be no other hosting management application preloaded.
If you are using a VPS the very first time, it might be a bit trickier for you to set it up initially. It’s because it requires connecting through the command-line and issue commands. There is no Graphical User Interface yet unless you get a server management application preinstalled.
However, it is pretty simple to connect and operate the VPS after knowing the right tool. Also, there are plenty of tutorials on the internet to know the right command for an operation in the given OS. Nevertheless, using the command-line is a prominent and efficient route that you must know.
Understanding SSH Access
SSH (Secured Shell) ensures the secure transfer of information between two computers. It is a network protocol providing you access to remote servers. SSH access is the way for us to connect and manage the remote virtual private server.
You’re already familiar with FTP (File Transfer Protocol). Also, you’ve used FTP clients like FileZilla to transfer files between your local computer and the remote server. A similar concept applies here.
Using an SSH client, we connect to the remote server (VPS) and issue commands using a command-line interface. Shell is the actual program run by the operating system to process stuff entered into the command-line.
Modern Operating Systems like Windows 10, macOS already come with a built-in native SSH client. Also, there are free as well as paid SSH clients to download and use. These tools work with old OS like Windows 7.
Below are my favorite and free SSH client programs. Although, you can configure and use the built-in client as well. All is just a matter of preference.
- OpenSSH Client (Windows 10, native)
- Terminal (MacOS X, native)
- PuTTY (Windows)
- Termius Basic (Windows, Mac)
I have Windows OS and I prefer PuTTY to connect to my remote servers and VPSs. So I’m using it here in the article to demonstrate. Although, commands would work in the same manner for any other SSH client of your choice.
Connecting to Your VPS for the First Time
Start with opening PuTTY to connect to your CentOS powered VPS. Enter the server’s IP address in the Host Name field and change the Port if it is another number instead of 22. Choose the Connection type to SSH and click the Open button after that.
You will receive a screen like the below upon successful connection. It shows a security alert since you have connected to the server for the first time. Click Yes to add the host key into PuTTY’s cache and proceed.
If the alert appears again later on, means either another server is now running under the same IP address, or someone has broken in and changed the key.
Now enter the username you’ve received from the host. Typically it is “root”. Hit Enter and type the password or copy it from your file and paste it there by right-clicking the mouse once.
Whatever you do, remember that the security feature of PuTTY won’t show you anything or even move the cursor. Just supply the password and hit the Enter key again on the keyboard. Congratulations! You have the SSH login now the first time.
Remember that it was password-based authentication which isn’t the best way for SSH access to the server. The security of the server is our topmost priority. So you will sooner learn key-based SSH auth as well as hardening the VPS security.
I have a Username other than the root
Some hosts don’t provide the “root” username. Instead, they give another username with root privileges. If it is in your case then do SSH login using that. Later run the following command.
# sudo su
The above command switches the current user to the root. In Linux, the root is the administrator user with maximum permission to do anything on the system. This term is fixed and you can’t change the “root” username to something random (till the time of writing the article).
Ok, so you have shell access to the system with root privileges. Run the following commands to update existing packages, optionally install wget package and change the current directory.
# yum -y update
# yum -y install wget
# cd /usr/local/src
Below, you will find the code to install the compatible version of CWP in CentOS 8, 7, or 6. Also, note that it would take some time to complete the installation (usually around 15-20 minutes).
Install Control Web Panel in CentOS 8
# wget http://centos-webpanel.com/cwp-el8-latest
# sh cwp-el8-latest
Install CentOS Web Panel in CentOS 7
# wget http://centos-webpanel.com/cwp-el7-latest
# sh cwp-el7-latest
Install CWP in CentOS 6
# wget http://centos-webpanel.com/cwp-latest
# sh cwp-latest
After the installation, it prompts to reboot the server. You can simply restart the server by issuing either
shutdown-r now command. Remember that you will lose the existing SSH connection.
Accessing the CWP Admin Panel
So the installation of CWP is complete in the previous section. Now you can access the CWP admin panel using the SERVER_IP:2031 URL in a web browser. Just replace the SERVER_IP with the actual IP address of your server. It will display the admin login page.
If you receive a connection not private (Chrome) or potential security risk (Firefox) warning, you can simply ignore that and process ahead. We will setup the right alternative later.
root in the Admin Username field, enter the password and click Login. After the login, you will see the CWP dashboard screen quite similar to this:
Configure CWP (Control Web Panel)
It is time to configure and set up the panel properly to make the VPS ready to serve. This is the part that requires the most of your time for once, especially security. But it is also the thing that will make you capable enough to handle the server despite the OS and the application.
Below are things that you need to implement in a fresh VPS or CWP. So keep reading them and make changes to the VPS accordingly.
Securing the Server
Securing the Virtual Private Server and Control Web Panel are the most vital tasks. Below are the security aspects that need to implement.
- SSH security
- Firewall implementation
- Mod security
- Hide processes
I have seen my email inbox getting full of SSH attack warnings in the past. The moment you buy the VPS, it becomes a soft target for hackers trying to gain access via SSH. So I advise you to take the security concern seriously.
Since security requires a detailed explanation, I have decided to cover them in dedicated articles. But for now, let us change the default SSH port 22 to something else. It is an effective weapon to fail a majority of such illegal hacking attempts.
Change the Default SSH Port
While the Command Line Interface is the essential and most powerful tool, I rather prefer GUI due to the ease of use. So wherever possible, I have used CWP to perform operations. In the background, there are Linux commands that execute.
From your CWP admin panel, visit the Services Config → SSH Configuration page. There you will find line #Port 22 in the configuration file. Remove the hash (#) and change 22 to 3088. Here 22 is the default port number for SSH service and I’m replacing it with 3088.
You can run SSH service on any other unused port number between 1024 and 65535. Also, the Service SSH → Netstat Port Usage page in CWP admin displays port numbers in use. Linux command for the same is netstat -tulnp.
Save the change after updating the SSH port to the desired one. Now visit the dashboard and restart SSH Server from the Services Status block. Finally, open PuTTY and connect to your server with the new port number.
Edit Nameserver Records
You have already provided two child nameserver records at the domain registrar level. Here it needs to create DNS zones files and populate records for them. When you edit nameserver information, CWP performs those tasks.
Visit the DNS Functions → Edit Nameservers IPs link to update NS records. Provide the same nameservers and their IPs there which you have registered as child NS at the domain registrar. Also, keep the Update DNS zone file and Restart DNS Server options checked and save the changes.
The next thing to do is setting a hostname for the VPS. From the left navigation pane, click the Server Settings → Change Hostname link.
There, provide a hostname in the New Hostname field. It should be a subdomain of your primary domain name. if the domain name is example.com then it could be server.example.com or something else. But it can’t be:
- subdomains used as nameservers (here ns1.example.com or ns2.example.com)
- subdomain names starting with reserved words like cpanel, mail, webmail, cwp, etc.
After saving the page, it will update you with a new hostname as well as CWP user panel and admin panel links. Also, it should pass the rDNS/PTR check with a SUCCESS label.
rDNS/PTR Check Fails
If the rDNS/PTR check doesn’t pass then you should visit the host-provided VPS management page. It should contain a field to insert the rDNS record. Put the main domain name (example.com) there and refresh the CWP hostname page.
If there is no such option for rDNS entry then contact the host to resolve this reverse DNS lookup issue.
Some hosts also offer to set the hostname within their control panel. In that case, you can use that feature or add it within CWP. But if you are using a VPS with OpenVZ/Virtuozzo/Lxc containers then it needs to update the hostname at both places.
Securing CWP Admin and User Panel URLs
CWP generates Admin and User Panel URLs when you add the hostname as shown in the previous image. If I have server.example.com as the hostname, the recommended URLs to access panels are:
- Admin Panel: https://server.example.com:2087
- User Panel: https://server.example.com:2083
However, if you logout and access either of the URLs, the browser displays the connection not private (Chrome) or potential security risk (Firefox) warning. This is because the SSL certificate generated by CWP is self-signed.
Change and Install SSL for Hostname in CWP – Control web panel
To overcome this issue you need to add a valid A record for the hostname first. Then after CWP will obtain and install a free SSL certificate from Let’s Encrypt for the hostname. Here are the steps to change and install the SSL.
- Visit the page DNS Functions → List DNS Zones.
- Click the Edit Records button next to the DNS zone file for the hostname (server.example.com.db in this guide).
- Add an A record as shown in the screenshot below using your server values.
After adding the record, restart the DNS service by clicking the Restart button in the Info panel at the top right of the page.
Visit the Server Settings → Change Hostname page again. The hostname is already there. Just click the Change Hostname button again without making any change. It will let CWP discard the self-signed certificate and install the one from Let’s Encrypt.
At last, it needs to restart CWP. Go to the admin Dashboard page. Click the Restart CWP Services button from the Process panel.
Now logout from the CWP Admin panel, re-enable the warning, and reload the login URL (https://server.example.com:2087). There should be no warning and the browser should show a valid secured URL.
Checking Server Date and Time
You may also want to check once that the server is using the correct date, time, and timezone. Visit the Server Settings → Change Date & Time link for this. Notice the server’s current date & time there. It will also display the timezone.
I highly recommend the UTC timezone. You can also check the server timezone using the shell command date +%Z. Below is my date/time settings.
Admin Email Settings in CentOS Web Panel
You require to add an email address in order to receive important emails from the system. Visit the CWP Settings → Edit Settings page to update the same. There, add the email address to the Admin Email field as well as tick the Forward server system emails checkbox.
Optionally, you can add an email address for CSF/LFD firewall alerts there too. We will cover this in a separate article.
Setting up Default Web Servers
Control Web Panel offers standalone as well as a combination of Apache and Nginx web servers along with Varnish cache. However, Varnish caching is available in the pro version only.
Visit the WebServer Settings → Select WebServers link to open the webserver setup page. There are different webservers options available to choose from along with performance comparison. I have used Nginx & Apache server option in the free version. Whereas for the pro version, I recommend Nginx & Varnish & Apache along with PHP-FPM.
After changing the web server, click the Save & Rebuild Configuration button. It will take a little time to build the server.
Choosing the Right PHP Version
The 0.9.8.x version of the Control Web Panel (CWP) comes with PHP 5.6.x version enabled by default which is quite outdated. So it requires updating the PHP version to a newer one.
Visit the PHP Settings → PHP Version Switcher page. It will display the main PHP version in use. Here you can select the desired improved version of PHP. It will update the version in the background and take around 15 minutes.
Unfortunately, the free version of CWP doesn’t offer multiple PHP versions enabled. So a pro license is required to use another version of PHP other than the main one for a domain hosted on the VPS. Additionally, the CWP Pro allows using the PHP-FPM implementation for faster processing.
You can check all the pro features here. Also, the cost is almost $12/year which is quite affordable and quite lesser than the monthly cPanel price.
If you feel confused, here are the explanations of PHP switcher and selectors in the CentOS Web Panel.
PHP Version Switcher
Here you can select the default PHP version globally available for all domains in your VPS.
PHP Selector 2
This page lets you install additional PHP versions in the CWP VPS. This is the selector for the legacy CGI-based PHP method like SuPHP. You can use a different PHP-CGI version per account/domain rather than the default one after the installation from here.
PHP FPM Selector
This lets you also install and use additional PHP versions. The difference is that it selects PHP Fast CGI Manager (PHP-FPM) versions instead of traditional CGI.
Both selectors are the same as the multi PHP feature in cPanel. Also, multi PHP is a pro feature of CWP. Also, you don’t need to use both selectors. It should be either CGI or FPM versions selector.
Managing Hosting Packages in CWP
Hosting packages control resource allocation among user accounts on the VPS. CWP comes with a predefined package which you need to review and modify if requires. Additionally, you can create new hosting packages there as per the requirements.
Visit the Packages → Packages link to view the list of available packages as well as add new ones. Horizontally scroll to the right in a row if you can’t see the icons to manage a specific package.
CentOS Web Panel – User Accounts
Creating user accounts and managing websites within them are integral parts of web hosting. Reach to the User Accounts → New Account page and create a new account there. While the fields are self-explanatory, there are a few things to note.
The domain name is the primary domain for the user account. There is no limit on user accounts you can create. But each account should have a domain associated. Additional or addon domains can be created using the Domains → Add Domain link as the package allows.
If the domain is already pointing to the server then you can enable the AutoSSL feature. It will create a free SSL certificate from the Let’s Encrypt authority for the website to use a secured connection (HTTPS).
Alternatively, you can enable the AutoSSL feature later as described in the next section after pointing the domain to your nameservers.
Accessing User Account
Once a user account is set up, the user can access it by visiting the hostname URL at port number 2083 (https://server.example.com:2083). This is a sleek interface to manage all hosting stuff within that account. This is similar to a shared hosting account you have already experienced.
While you can manage all hosting aspects for the user using the admin panel too, it is better to manage them within this user account panel itself. It saves you from file permission error as well as other issues in running websites.
Checking Website in CWP
If a domain in the user account is pointing to the VPS, you can check it in the browser. It will display the default CWP page.
Enable Admin Services in SSL Certificates Module
Visit the WebServer Settings → SSL Certificates page. This module has various tabs to manage certificates. The first tab, List Installed shows active SSL certificates.
Unlike cPanel, the certificate on CWP doesn’t apply automatically to the Mail, Webmail, FTP, and cPanel services to use a secured SSL connection with them. So here you need to manually add them via the Admin Services button for the specific domain.
Additionally, the AutoSSL (FREE) tab allows you to acquire an SSL certificate for a domain if you haven’t obtained it when it was added.
Finally, have a look at the Configure tab for SSL certificates. There are a few settings to tweak. I’m posting a screenshot of the Alerts and Autorenew configurations tab from my VPS.
Install & Configure CWP on CentOS – What is Next?
Till now, you have installed CWP and configured it to the elementary level. The CentOS Web Panel powered VPS is ready to do its job.
Using the Admin/User panel, you can set up further things like email accounts, databases, Cron Jobs as well as uploading websites through an FTP client and many others. Managing your own server is an exciting task.
You have covered a lot of things here about VPS and server management. However, we haven’t covered security implementations in CWP. Also, even we have changed the SSH port, there are a few more things to do for SSH security.
I would also like to share a couple of things like VPS optimization and related topics for better management. I will publish them very sooner for a complete VPS administration.