Category Archives: System Engineering

Server Management Made Easy & Affordable At Sangkrit.net

A dedicated server is like your own computing machine. It is easy to use if you know how to. In olden times when people use to host a large website with heavy traffic, they use to spend thousands of dollars in setting up their own server.

Time changed and those bare metal servers came up with lease and subscription options so that anyone can subscribe to them online and host his domains.

That has made things easier, as you get a control panel such as Plesk or cPanel WHM and that can make the server manageable for everyone but not always as there are times when you get stuck in something and you only have the command line to resolve the issue. Here, Fully Managed Dedicated Server and Webhosting Plus save you from facing such issues.

Fully Managed Dedicated Servers

You won’t face such problems in Sangkrit.net because here you can subscribe Fully Managed Dedicated Server option offering you round-the-clock online support from the experts. And to make things even simpler for everyone the Webhosting Plus option is now available with a super easy control panel.

Webhosting Plus

The Webhosting Plus offers you the speed of a server accessible to you with a simple control panel as you get on a shared hosting option. This hosting is an ideal option for users who don’t have good tech skills or cannot afford a fully managed dedicated server.

This is a powerful hosting and all its plans include a one-click install option so that you can simp,y install WordPress on any domain of yours to start a business or eCommerce website. Its simple backup and restore option allows you to upload or transfer your website. Uptime is just like a server, 99.9%. Security monitoring is 24/7, SSL is free and you can easily set it up to work. You also get the benefit of daily backups to keep files and content of your website safe.

Overall Webhosting Plus is for those who don’t have any idea on how to work with servers, whose budget is limited but at the same time need a powerful hosting option.

Get The Benefit Of Dynamic Caching On Sangkrit.net VPS & Dedicated Servers

Now every server owner at Sangkrit.net can easily accelerate his websites by caching both static and dynamic content to reduce the load on the servers.

So if you buy any Linux-based VPS or Dedicated Server, you can enable caching for yourself and also your clients by providing a caching button on every hosting account you make on your server. You and your users can simply turn this button on to turn on catching, no other configuration is required.

Follow these steps:

  1. Login to your SANGKRIT.net account
  2. Visit your ‘My Products’ page
  3. Click the ‘Servers’ option
  4. Next to ‘Server Actions’ click ‘Launch WHM’
  5. Open ‘Nginx Manager’ from the software section menu on the left
  6. You can now enable the caching

The page allows you to enable the caching on any or all hosting accounts running on your server You can also enable cache by default for all hosting accounts or click the ‘User Settings’ tab to enable NGINX caching selectively on accounts. It also provides you the option to selectively or collectively delete your server’s cache.

Every cPanel user account created by you on your VPS or Dedicated Server will also provide an option to enable caching over the websites running on that hosting account.

Using The Upgraded Hostnames On Your Sangkrit.net Server

The hostnames will upgrade shortly so if you are still using legacy hostnames you will need to update them to the new format i.e. the reversal of the IP octets.

You can update the hostname for your VPS or Dedicated Server. You can do that simply by logging into your Sangkrit.net account and then following these steps:

  1. Visit your ‘My Products’ page
  2. Select ‘Servers’
  3. Next to your server click select ‘Manage’ 
  4. Select the ‘Settings’ option next to the ‘Dashboard’ section, the default page
  5. From the Server section click Change which is next to Hostname
  6. Now type or paste the new hostname in the Server Hostname field,
  7. Select Save

The hostname should meet the requirements, the server tests the hostname, and then only it accepts to save it. After you have successfully saved all the changes, the new hostname will appear in the Settings section.

Link Multiple Servers Using Configuration Cluster On Your Dedicated Server

The Configuration Cluster is a server interface that enables you to link the master server to other additional servers. On your Dedicated Server, you can easily add a server to the configuration cluster by following these steps:

  1. Login to your server
  2. Click ‘Create’ at the top-right corner of the configuration cluster servers table
  3. Type the server name in the ‘Server’ text box
  4. Type the server’s root-level account username in the User text box
  5. Paste the server’s API token
  6. Alternatively, you can enter a remote access key in the API Token or in the Remote Access Key box

Remember, API token can be generated in the WHM’s Manage API Tokens interface. Simply navigate to WHM -> Home -> Development -> Manage API Tokens page.

If you own a Linux-based dedicated server at Sangkrit.net, you can simply copy the changes made to the master server to all other servers by navigating to WHM -> Home -> Server Configuration -> Update Preferences settings on the master server. This simply outs all changes to all servers on the cluster.

Configuring One Server To Handle HTTP & HTTPS Respectively

On an Nginx server, it is possible for you to configure it to manage both HTTP and HTTPS requests.

You should also know that prior to 0.7.14, it was not possible to enable SSL certificate selectively over individual listening sockets, as we have done here in the following given code:

server {
    listen              80;
    listen              443 ssl;
    server_name         www.yoursite.com;
    ssl_certificate     www.yoursite.com.crt;
    ssl_certificate_key www.yoursite.com.key;
    ...
}

Before SSL could only be enabled over the entire server using an SSL directive, thus it was impossible to put up a single HTTP/HTTPS server. Afterward, the SSL parameter of the listen directive was added to resolve this problem.

The use of the SSL directive in newer versions has been discouraged.

When Multiple HTTPS Servers Listen On A Single IP Address

In SSL protocol conduct, a typical problem occurs when two or more configured HTTPS servers listen on a single IP address.

server {
    listen          443 ssl;
    server_name     www.yoursite.com;
    ssl_certificate www.yoursite.com.crt;
    ...
}

server {
    listen          443 ssl;
    server_name     www.yoursite.org;
    ssl_certificate www.yoursite.org.crt;
    ...
}

As shown above, what exactly happens here is that the client browser starts to receive the default server’s certificate (www.yoursite.com) regardless of the name of the server requested.

This is pushed by SSL protocol conduct. Here, the connection via SSL is made before the browser sends another HTTP request and Nginx does not know the server name requested. Hence, it may only offer the default server’s certificate.

Here’s the solution:

server {
    listen          192.168.1.1:443 ssl;
    server_name     www.yoursite.com;
    ssl_certificate www.yoursite.com.crt;
    ...
}

server {
    listen          192.168.1.2:443 ssl;
    server_name     www.yoursite.org;
    ssl_certificate www.yoursite.org.crt;
    ...
}

Above given is the ancientest and most powerful way used for resolving this issue. Here a separate IP address is assigned for each HTTPS server.

Updating Nginx Server Configuration To Use The SSL You Have Purchased

You need to update the config file on your server to use the SSL certificate you are subscribed to. This can be done by accessing the command line SSH and opening the Nginx config file for the domain you are installing the SSL certificate.

Simply run the following command:

sudo vim /etc/nginx/sites-available/yourwebsite.com

Now update the config file to use the SSL certificate:

server {
        listen 80;
        server_name yourwebsite.com;
        return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;

    server_name yourwebsite.com;
    ssl_certificate     /etc/nginx/ssl/yourwebsite.crt;
    ssl_certificate_key /etc/nginx/ssl/yourwebsite.key;

    root /usr/share/nginx/yourwebsite.com/;
    index index.php  index.html index.htm;

}

The next step is to save the file using this command:

wq!

And then restart your Nginx server with this command:

sudo service nginx restart

That’s it.

Configuring SSL & Intermediate Certificates On Nginx Server

In the previous lesson, you learned about installing and configuring Nginx on your dedicated server. Now this lesson is on installing SSL and other standard certificates.

The first thing you need to do is get an SSL certificate from Sangkrit.net, once you subscribe to it and your certificate request is approved just download it to install those files on your dedicated server.

To download and install your certificate files follow these steps:

  1. Visit your Sangkrit.net product page
  2. Select SSL Certificates
  3. Select Manage next to the certificate you need to download
  4. Select a Server type
  5. Click the Download Zip File option
  6. Your certificate would start downloading now.
  7. Copy the SSL certificate file and the certificate bundle file to the Nginx server
  8. You already have a key file on the server which you got when you generated your certificate request.
  9. Now edit your Nginx configuration to reference these files

Your certificate is installed now. Remember, the actual configuration file you edit depends on your version of Nginx, your OS platform, or the method you are using to install Nginx.

Installing & Configuring Nginx On Your Dedicated Server

Nginx is a web server that is also used as a reverse proxy option. It also balances the load on your dedicated server and acts as a mail proxy as well as an HTTP cache. It is software used for high performance on your server.

This lesson will guide you in installing and configuring Nginx and for that, you are going to need the root privileges. You will also require to set up your CentOS server to use the EPEL Repository which stands for Extra Packages for Enterprise Linux.

To install EPEL simply run this command:

sudo yum install epel-release

You can read more about its configuration steps here. Earlier we installed yum as a package manager but it does not include any new version of Nginx in its default repository so installing EPEL will make sure that Nginx on CentOS remains up to date.

You are ready to install Nginx

Now you are ready to install Nginx on your server, simply run the following command:

sudo yum install nginx

Next, start Nginx:

Nginx doesn’t start on its own, so you will need to run a command for starting Nginx on your server:

sudo /etc/init.d/nginx start

To make sure Nginx is properly installed on your server, just direct your browser to your server’s IP address. If you see the words, “Welcome to Nginx”, it means you have Nginx installed and working.

Executing Sofware Packages On Your Dedicated Server With YUM

The package management or software installations on your CentOS-based Linux server can be performed in two different ways, the first is via using a graphical user interface while the other is via command line terminal. The GUI is ok but YUM is a lot more powerful tool globally used by most system administrators.

YUM is one tool made available a long way for managing packages on CentOS Linux systems. One advantage of YUM is it not only keeps track of outdated packages but also monitors outdated dependencies on your server.

Running yum check-update

By running yum check-update command on your server you can check packages that can update candidates. If you have subscribed to a new dedicated server, running this command is going to install the updated candidates on your system.

Installing updated candidates with yum update

Another command called yum update will install all updated candidates on your system, this might take some time to complete depending upon the size of the installation and the speed of your server.

Now you are ready to install software packages

Once these things are done, you are ready to install any software from a central repository with YUM.

Similarly, the list all command of YUM will list all currently available packages, the list installed command shows the packages which are installed using YUM, and the install command is used for installing any package, whereas remove command first removes and then installs a package.

There are many more commands that you will learn about while working on your server. The man yum command is going to provide you with the help file showing all important information.

Installing & Configuring Apache On Your Dedicated Server

Before installing PHP or MySQL, the first thing you need to do is install Apache on your dedicated server. In order to do that you simply need to access the command line of your server and log in as the root user:

  1. Connect your server via SSH
  2. Run this command: sudo su –
  3. Enter your server password

You now have root access.

Once you have that, you can install Apache using the ‘Yum‘ command:

[root@admin]# yum install httpd
Loaded plugins: fastestmirror, langpacks
base
| 3.6 kB 00:00:00
extras
| 3.4 kB 00:00:00
updates
| 3.4 kB 00:00:00
extras/7/x86_64/primary_d
| 121 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.sigmanet.com
* extras: linux.mirrors.es.net
* updates: mirror.eboundhost.com
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-45.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-45.el7.centos for package:
httpd-2.4.6-45.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.645.el7.centos.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-45.el7.centos will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
Installed:
httpd.x86_64 0:2.4.6-45.el7.centos

Dependency Installed:
httpd-tools.x86_64 0:2.4.6-45.el7.centos
mailcap.noarch 0:2.1.41-2.el7

Complete!
[root@admin]#

Once Apache is installed, the next thing you need to do is configure it and then make sure it works on your server, use the following command:

[root@admin]# systemctl start httpd && systemctl enable httpd

To make sure the Apache services are running on your server:

[root@admin] sudo systemctl status httpd

This will show you an active status if the service is running on your dedicated server.

Verifying The Presence Of Required PHP Libraries On Your Dedicated Server

In the previous lesson, you have learned about getting yourself to know whether the Memcached service on your server is installed and listening to Port 11211.

Now this lesson is on checking the presence of the required PHP libraries needed to make Memcached work for you.

You can verify the installation from SSH. Another important thing is to make sure to use the same version of PHP as the website you want to use Memcached on.

On a dedicated server having WHM/cPanel with PHP version 7.3, the following command is used with the output as shown:

[root@server[~]: ea-php73 -i | grep "memcached" /opt/cpanel/ea-php73/root/etc/php.d/memcached.ini,
memcached
memcached support => enabled

Verifying Memcached service & PHP libraries are working

From the command line, telnet to the Memcached service.

[root@server ~]# telnet localhost 11211

This output will be returned, and you will be connected to the Memcached service.

Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Enter the command stats. A full page of output will appear, but towards the middle, look for the lines STAT bytes_read and STAT bytes_written.

stats
STAT pid 6374
STAT uptime 37567
...
...
STAT bytes_read 3733268975
STAT bytes_written 6526192728
STAT limit_maxbytes 1073741824
...
...
END

When you see a big amount of data is read and written, that means Memcached is working.

Entering the command stats again is going to show changes to these values.

And when you are seeing a very tiny amount of data read and written, or the values of 0, that means Memcached is not functioning good.

stats
STAT pid 30601
STAT uptime 603941
...
...
STAT bytes_read 7
STAT bytes_written 0
STAT limit_maxbytes 1073741824
...
...
END

Use quit to return to a standard prompt.

quit
Connection closed by foreign host.
[root@server ~]#

So that is how you can know that the caching is working as expected.

Know Whether Your Server’s Memcached Service Is Listening On Port 11211

If you’re not sure whether your dedicated server‘s Memcached service is listening on port 11211 i.e. it is installed and running properly, there are some easy tests you can do to make sure everything is operating fine.

Before you start, enable the administrator access on your server (in case you have not), connect via SSH then switch to the root user.

Next, in the command line, type the following command and PRESS ENTER:

telnet localhost 11211

This will report to you back that it was able to connect to the service.

[root@server[~]: telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

In case, if it’s not installed properly, you will see something like this:

[root@transfer[~]: telnet localhost 11211
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

And you will not be able to connect to the service.

In the next lesson, you will learn about testing the presence of the needed PHP libraries to make Memcached work for you.

Configured Memcached PHP Libraries On Your Server, Next What?

In the previous lessons, you have learned about installing Memcached PHP Libraries and configuring Memcached Daemon on your dedicated server. Now next steps are to configure your apps and websites to use them so that you can get their real benefit.

So once you get the Memcached Daemon and PHP libraries installed on your CentOS-based dedicated server, you are required to configure your PHP application to use Memcached. In case you don’t it, Memcached is going to use your server resources without providing you any of the advantages.

Before starting, the system recommends you take a backup of your websites and then follow the changes outlined below.

WordPress users can take its benefit simply by using a plugin called W3 Total Cache Plugin. Yes, there are many other plugins as well but the system finds it best for most of its users. If in case this plugin doesn’t suit you or it is in conflict with some other plugin you are using, it that’s your case then you can choose some other plugin such as Batcache, Cachify, Memcached-Redux, etc.

In this lesson, you will learn about configuring the first and the best one i.e. W3 Total Cache. Simply start by installing-activating the plugin and then to configure, navigate to the Performance -> General Settings page.

Next, make sure the Enable tickbox is checked and Memcached is selected with the cache method for:

  • Page Cache
  • Object Cache
  • Database Cache
  • Fragment Cache

Once you do this, your website starts to use the Memcached services for imporving the performace of your website at the same time reducing the load on your dedicated server.

How Memcached Daemon Works On Your Dedicated Server?

The loading of files and code on your dedicated server take lots of its resources, this resource usage can be reduced by using an object caching system and when you do that, the performance of your server automatically increases. This happens because then your server needs fewer resources to run web applications.

Memcached is a free high-performance, distributed memory object caching system which is generic in nature. It is planned for speeding up dynamic web applications simply by alleviating your database load.

Earlier you learned about configuring the Memcached PHP Libraries on your dedicated server. Now this lesson will let you know what is Memcached and how you can easily install it on your CentOS-based dedicated server at Sangkrit.net.

On CentOS servers, installation of the Memcached daemon is performed via command line and it is freed of any control panel you may be using such as WHM or cPanel, etc.

How this all works for you?

The cache data is simply stored in the hardware units such as RAM and that can also be used in correlation with a software segment.

As we have explained before, the primary purpose of cache is to increase the retrival of information stored in the form of data by minimizing the requirment to access the lower layers of storage every time a new request is made by the client.

Yes, this data is not the actual data stored on your server but it is a subset of data copied from the databases having the real data fed by your application.

This is like when you keep actual notes in your diary or anywhere else but you remember those notes anyway in your mind. So when the time comes when you need those notes; Instead of opening your diary again and finding them you directly make use of them because you already remember them anyway.

Hence, the main advantage of caching is to speed up loading and minimize the system resource usage that is generally needed to load any request such as a web page of your website or application.

Configuring Memcached PHP Libraries On Your Dedicated Server

The dedicated servers at SANGKRIT.net offer you the option to configure your object caching system in the way that suits you best.

The lesson will guide you on how and why configuring Memcached PHP Libraries on your Linux-based dedicated server benefits you.

Memcached is one free object caching system that can be installed on your server for improving the performance of your website. It only works when you install the daemon, install the PHP libraries and configure your PHP application correctly.

You can easily do all that by following these steps:

  1. Login to your SANGKRIT.net account
  2. Visit your My Products page
  3. Click the Servers option
  4. Click Manage
  5. Open WHM

Next, on the WHM panel follow these steps:

  1. From the Software section on the left, select EasyApache 4
  2. Click the Customize button present in the Currently Installed Packages section.
  3. Click PHP Libraries on the left
  4. Type Memcached in the search box
  5. Click the button to install Memcached on the desired versions of PHP
  6. Click the Review button on the left,
  7. Click the Provision button at the bottom of the page

The installation should be complete now.

Apart from this, you should also know that the same modules can also be installed with yum in SSH. But be very conscious about the naming convention i.e. ea-php72-php-memcached. It must be installed on each version of PHP.

The next coming lesson will help you in the process of installing and managing the Memcached Daemon.

How To Quickly Setup Your New CentOS Server At Sangkrit.net?

The new dedicated servers at Sangkrit.net offers you CentOS system that is highly customizable offering you easy to use command panels making it manageable for you to perform important tasks for yourself or your clients.

When you look forward to creating a new CentOS Server space, you need to perform several steps to end up getting a configured server with a working network protocol and SSH access.

This lesson will guide you through the steps for further server setup of CentOS after you purchase a Dedicated Server plan at Sangkrit.net

First of all, setup SSH as explained in this lesson here, then login with your personal account using this command –

ssh root@server-ip

In the above line, type the IP address of your server replacing the ‘server-ip’ text. When you select an SSH key for authentication, the command looks something like this:

ssh root@server-ip -i path/to/ssh/key

Next, upgrade the server package using this command:

dnf update

Once the process is complete, you will need to clean the cache and clear up the disk space by using this command:

dnf clean all

The initial setup of your server is now complete. Next, learn to host your domain name on your server.

Configure Linux Server For The EPEL Repository

In order to have access to some important traffic monitoring controls, you will need to set up your CentOS system to use the EPEL Repository i.e. Extra Packages for Enterprise Linux.

However, this repository is not officially strengthened or endorsed by CentOS. Instead, it is supported by a bunch of Fedora Core enlistees to handle the packages which are normally used by Enterprise Linux professionals, especially the packages that are not included in either CentOS, Fedora Core, or Red Hat Linux Enterprise.

Possible conflicts on CentOS

Hence, sometimes there might be some chances for this repository to bring some conflicts on a server having common dependencies. To overcome such a situation, before deploying it you must test it on a non-production Linux system running the same servers as the production.

Advantages of EPEL Repository

The biggest benefit of operating the EPEL Repository over any other repository with CentOS is that the binaries are never impaired.

Installation & Configuration

Anyone can easily install it via YUM.

[root@user]# yum -y install epel-release

Once installation completes, you will need to update it

[root@user]# yum repolist

At this juncture, the EPEL Repository becomes ready to use.

Configuring Reverse DNS On Your Dedicated Server

DNS i.e., the Domain Name Server also known as Domain Name System is the hierarchical and decentralized system of identifying systems reachable through the Internet Protocol networks.

It works by looking up your website by finding its domain name and then locating its associated IP address. Whereas, the reverse DNS first looks up for an IP address and then locates the associated domain name.

At SANGKRIT.net, you can easily set up a reverse DNS (rDNS) lookup for your Dedicated Server. To start, simply login to your SANGKRIT.net account and follow these steps:

  1. Visit your My Products page
  2. Click Servers
  3. Next to your server, click Manage
  4. Enter the domain name you want to be associated with the server IP address, in the DNS record field
  5. Now click Update

The system will start an automated process of completing the reverse DNS setup. This can take up to 48 hours for the changes to propagate to your server.

You should also know that, when you run your own email server, and configure DNS to point to your domain name, there are some servers that are going to reject emails from IP addresses when not having an rDNS. The reverse DNS also helps when you need to troubleshoot your network while running a traceroute etc.

Managing The Hostname For Your Linux Server

A hostname is a selectable name for your Dedicated Server or VPS host. These are composed of a sequence of labels attached with dots. Here’s how you can change the hostname of your server by following a few easy steps.

  1. Login to your SANGKRIT.net account
  2. Visit your My Products page
  3. Click the Servers option
  4. Click Manage
  5. Select Settings
  6. Next to Hostname, click Change
  7. Enter the new hostname in the Server Hostname field
  8. Click Save.

Remember, the hostname should meet the requirements of an appropriate hostname before you can save it. Once you save your changes, the new hostname will appear in the Settings section and will start to work like the old one.

Managing Ports On Your Server, Nydus & Port 2224

For a server to function smoothly, port 2224 is kept open by default during its provisioning time.

But at the same time, if your VPS or dedicated server affairs don’t complete due to the reason of a blocked port 2224, you can unblock it and try again after a few minutes.

On Windows servers, you can use the Windows Defender Firewall for unblocking the port. And for Linux servers, the steps are given below.

For unblocking ports on a Linux server you can use firewallD. In case you use a different firewall utility, you will need to change the given sample code.

First of all, connect your server via SSH and then run the following command:

sudo firewall-cmd –permanent –zone=public –add-port=2224/tcp

Followed by these commands:

sudo firewall-cmd –reload

sudo firewall-cmd –list-ports

These two commands are for confirming the ports are cleared i.e. unblocked.

Next, What is Nydus?

It refers to a pair of agent applications (nydus-ex and nydus-ex-api) that functions on your dedicated server and communicates with your server dashboard.

They provide resource metrics and perform the server functions that you’ve requested. The agent listens on port 2224.

Since the server dashboard and its upgrades are dependent on Nydus, so blocking port 2224 – or removing Nydus from your server will stop these features.

In a case, if you accidentally or knowingly remove the Nydus components, you are required to restore them from a backup that you have taken before. If you don’t have a backup, you will need to rebuild your server.