Managing Your Domain and VPS in DomainIndia.com without a Control Panel
When you have a Virtual Private Server (VPS) with DomainIndia.com, you may want to manage your domain without using a control panel like cPanel or Plesk. While these control panels are designed to make it easier to manage your server and websites, they are not always necessary, especially if you're comfortable with command-line interfaces.
The steps below will walk you through the process of connecting your domain with AlmaLinux 8.6/CentOS on DomainIndia.com's VPS, uploading files, and managing your server without a control panel.
Connecting Your Domain to AlmaLinux 8.6/CentOS VPS
-
Point Your Domain to the VPS IP Address
First, you need to log into your DomainIndia account and navigate to the DNS settings for the domain you want to connect to your VPS. Replace the existing A record with the IP address of your VPS.
-
Update Your VPS Configuration
Connect to your VPS via SSH. Once you're logged in, navigate to the
/etc/httpd/conf.d/
directory and create a new configuration file for your website. You can do this using the nano text editor by typingsudo nano yourdomain.conf
.In this new file, you'll want to create a new virtual host. Here's an example:
<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/yourdomain"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined
</VirtualHost>
-
Save and exit the file.
-
Restart the HTTPD Service
After saving your changes, restart the HTTPD service by typing
sudo systemctl restart httpd
.
Uploading Files to Your VPS
-
Establish an SFTP Connection
You can upload files to your VPS using Secure File Transfer Protocol (SFTP). You will need an FTP client like FileZilla or WinSCP for this. Use the IP address of your VPS, along with your username and password, to connect via SFTP.
-
Upload Your Files
Once you've established an SFTP connection, navigate to the DocumentRoot directory you specified in your VPS configuration (
/var/www/yourdomain
in our example). You can then upload your website files to this directory.
Managing Your VPS without a Control Panel
Without a control panel, you'll be managing your VPS from the command line. Here are a few common tasks you might need to perform:
-
Installing Software
You can install software using the
yum
ordnf
package managers. For example, to install the nano text editor, you would typesudo dnf install nano
. -
Managing Services
You can start, stop, and restart services using the
systemctl
command. For example, to restart the HTTPD service, you would typesudo systemctl restart httpd
. -
Creating and Managing Users
You can add new users with the
adduser
command and set their passwords with thepasswd
command. For example:
-
sudo adduser newuser
sudo passwd newuser
Updating Your System
It's important to keep your system up-to-date. You can update all of your system's software by typing sudo dnf update
.
Setting Up Email
You can set up a mail server on your VPS to handle email for your domain. Postfix is a popular open-source mail transfer agent (MTA) that can be used for this purpose.
-
Install Postfix and Dovecot
First, install Postfix and Dovecot, an open-source IMAP and POP3 server, with the following commands:
sudo dnf install postfix dovecot -
Configure Postfix
Next, you'll need to configure Postfix. Open the main configuration file with the following command:
sudo nano /etc/postfix/main.cf
In this file, you'll want to make sure the
myhostname
,mydomain
, andmyorigin
parameters are set to your domain name. You'll also want to setinet_interfaces
to all andinet_protocols
to ipv4.Save and exit the file when you're done.
-
Configure Dovecot
Next, configure Dovecot by opening its configuration file:
sudo nano /etc/dovecot/dovecot.conf
In this file, uncomment theprotocols = imap pop3 lmtp
line and save the file. -
Start and Enable Postfix and Dovecot
Now that you've configured Postfix and Dovecot, you can start them with the following commands:
sudo systemctl start postfix
sudo systemctl start dovecot
To ensure they start on boot, enable them:
sudo systemctl enable postfix
sudo systemctl enable dovecot
Here is an extension of our foundational article on setting up a mail server.
Setting Up Name Servers
To set up name servers for your domain, you'll need to create NS records in your DNS settings. These should point to the nameservers provided by DomainIndia.
-
Log into your DomainIndia account and navigate to the DNS settings for your domain.
-
Add two new NS records. The host should be '@', and the points to field should contain the nameservers provided by DomainIndia. It usually looks like ns1.domainindia.org and ns2.domainindia.org, but make sure to check the exact values from DomainIndia.
-
Save your changes. DNS changes can take up to 48 hours to propagate, so you might have to wait a bit for your changes to take effect.
Other Requirements
Managing a VPS manually requires a good understanding of Linux and server management. Here are a few additional skills and knowledge areas you should have:
-
Firewall Management: You should know how to configure a firewall to protect your VPS. You can use the
firewall-cmd
command to manage the built-in firewalld service in AlmaLinux/CentOS. -
Security Updates: Regularly updating your server's software is essential for security. You should understand how to use the
dnf
package manager to update your system and install security patches. -
Backup and Recovery: You should know how to back up your server's data and how to restore it in case of a problem. You can use tools like rsync for this.
-
Monitoring: Keeping an eye on your server's resource usage can help you spot problems before they become serious. You should understand how to use tools like top, htop, and vmstat to monitor your server.
In conclusion, managing a VPS without a control panel gives you full control over your server and can be a rewarding experience if you're up for the challenge. However, it does require a solid understanding of Linux and server management.