All Articles by Sangkrit

Register/transfer domain names at http://system.sangkrit.net and mail to system@sangkrit.net to get your web/app made/managed as per the budget allocated.

4275 Articles

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.

America Is Out To Make CPC’s Insistence On One China Policy Backfire Democracy Into The Mainland

In a press briefing on Sunday the 1st of August 2022 at the White House, the National Security Council Coordinator for Strategic Communications John Kirby said, “The world has seen the United States government be very clear that nothing has changed — nothing has changed — about our One China policy, which is of course guided by the Taiwan Relations Act, the Three Joint U.S.-PRC Communiqués, and the Six Assurances.”  

On the same day, the US House Speaker Nancy Pelosi set off on a tour of Asia without any mention of Taiwan on her official itinerary, which included Singapore, Malaysia, South Korea and Japan, but landed in Taiwan too in a military plane and said, “Forty three years ago, America made a promise to always stand with Taiwan… today our delegation came to Taiwan to make it unequivocally clear we will not abandon our commitment to Taiwan,” reaffirming that the US won’t ever leave the democracy in Taiwan unguarded. 

In retaliation, China started a series of military operations surrounding the island of Taiwan from Tuesday night.

“We have the determination, ability and confidence to ensure national security,” Taiwan said in a statement.

Initially America was an ally to Taiwan and Pakistan. Pakistan brought democratic America in touch with communist China. Thereafter following the footsteps of capitalist America, China also made its fortune by supplying to Europe. Now cash-rich Communist China has formed an axis with Russia and North Korea firmly in its league. 

America’s adherence to one China policy is clearly in conformity with its adherence to democracy above all so as to the Communist Party of China’s insistence on one China policy backfires democracy into the mainland. Democracy from America seems out for that.  

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.

Managing Apache & PHP Modules On Your Server

You can install necessary PHP modules for Apache on your VPS and Dedicated Server and then enable them manually.

You can enable, disable, or customize such modules using a tool called EasyApache. By using this tool, the PHP and Apache options are rebuilt on the basis of the options you select.

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

The easiest way to upgrade PHP is through EasyApace which you can find in the software section of WHM:

  1. Lookup for EasyApache using the search box on the left section of WHM
  2. Click to open it then click EasyApache (ApacheUpdate) option
  3. This will open the present time Apache Configuration Profile
  4. Click the gear icon for a customized profile option
  5. You will see Apache wizard guiding you through various steps
  6. Here, select the Apache version
  7. Then, select your PHP versions
  8. Next, from the Short Options List, select the features you like to include in your Apache
  9. You can enable the modules you like to add and you can also disable the modules which you don’t want
  10. For more configuration options you may click the Exhaustive Options List
  11. Finally, select the Save and Build option

In the Exhaustive Options List, you can select or deselect various other modules. There is also an option called Save Only that only saves your profile and doesn’t starts the building process.

To start building you will need to click Save and Build option as explained above. Once you click this option, do not close your browser window and wait for the process to complete.

This may take some time depending on the options you have selected and the power of your server. If you are using a small server with limited resources then you should not enable many options at once and instead enable a few options first and then repeat the process for enabling more modules.

Upgrading PHP On Your Dedicated Server

Before upgrading PHP on your VPS or Dedicated Server, you need to make sure that all applications and websites are compatible with the version of PHP you are switching to.

Next, take a backup of all your websites and apps, then follow the given 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

The easiest way to upgrade PHP is through EasyApace which you can find in the software section of WHM:

  1. Lookup for EasyApache using the search box on the left section of WHM
  2. Click to open it then click EasyApache (ApacheUpdate) option
  3. This will open the present time Apache Configuration Profile
  4. Click the gear icon for a customized profile option
  5. Apache version screen will appear
  6. Select the Apache version you want
  7. Click on the next step button
  8. A screen will appear where you can select the PHP version
  9. Select the PHP version and click the next step button
  10. Follow the next two steps to save, build, and upgrade

The directories you must know:

Directory for the specific references to the PHP directory or extensions:

/usr/local/cpanel/3rdparty/php/version-number/

Directory for the specific references to PHP libraries or extensions:

/usr/local/cpanel/3rdparty/php/version-number/lib

Directory for the specific references to PHP binaries:

/usr/local/cpanel/3rdparty/php/version-number/bin/

Every version of PHP has its own php.ini file which is found in:

/usr/local/cpanel/3rdparty/php/version-number/etc

Every time you edit this file, the changes are not transferred to other PHP versions you upgrade to or switch to. Hence, after an upgrade, you also need to change your php.ini file to match it with your newer version of PHP.

Perform Power Cycle When You Lose Access To Server Boot Options

Power Cycle is an option used to immediately disconnect power from your server to power it up again. This is mostly done when you lose access to rebooting options on your server.

Before performing a power cycle you should know that it does not shut down your server applications gracefully and thus could result in data loss.

If you are a Dedicated Server owner, and you want to turn it off and then restart it forcefully, just follow these steps:

  1. Login to your SANGKRIT.net account
  2. Visit your My Products page
  3. Click the Servers option
  4. Click Manage next to the server you want to restart
  5. Select Server Actions > Power Cycle from the upper-right corner of the page
  6. Click the Request Power Cycle option

Now the power cycle begins and this may take some time, a couple of minutes. Next, when it is finally done the cycle is added to the history list of your server.

The VPS owners need to follow a different set of steps:

  1. Login to your SANGKRIT.net account
  2. Visit your My Products page
  3. Click the Servers option
  4. Click Manage next to the server you want to restart
  5. Select Server Actions > Restart Server

That’s it. These options are useful especially when you are not able to boot your server via SSH. These don’t cause any loss to saved content but you may lose any unsaved files or temporary settings on your server after enforcing a power cycle.

Configuring MySQL Repository On Linux Server CentOS

CentOS offers you no native MySQL package so you need to add it on your own. This you can do by adding a MySQL hosted repository on your Linux System CentOS.

Add the MySQL Yum repository to your system’s repository list. This can be done by installing an RPM that comes with MySQL.

  1. Go to the Download MySQL Yum Repository page (https://dev.mysql.com/downloads/repo/yum/) in the MySQL Developer Zone
  2. Select and download the release package for your platform
  3. Use the yum package manager to install MySQL (yum -y install mysql-server)
  4. Enable the MySQL Daemon Service, use these commands systemctl start mysql followed by systemctl enable mysql

That’s it. Now you may check and make sure that MySQL is up and running, simply use this command – sudo service mysqld status.

Configuring WAF & CDN On Your Dedicated Server & VPS

To configure WAF or CDN, you’ll need to additionally purchase a Website Security alongside your hosting option such as Business Hosting, VPS, or Dedicated Server.

Then, there are a few steps you will need to take to activate the Web Application Firewall(WAF) and Content Delivery Network (CDN) over your websites.

Start by subscribing to a Website Security option. Then, simply login to your Sangkrit.net account, move to the product page, and follow these steps:

  1. Select ‘Manage All’ given next to Website Security and Backups
  2. Select Set Up under Firewall, for the domain, you want to set up WAF and CDN
  3. For hosting users, the setup completes in a few minutes. But the server users need to follow a few more steps which are given below
  4. Use the link supplied under Internal Domains to make sure your site loads correctly
  5. Login to the account where your DNS is hosted and configure the A Record so it points to the Website Firewall using the IP address listed under your Firewall IP address
  6. Once A Record is updated, the Website Security dashboard will update and show that the service has been activated. This can take up to a day to complete

If you have a firewall on your hosting servers like CSF or ModSecurity, you should allowlist some IPs. Because all connections to your server will pass through this firewall and adding associated IPs to your firewall’s allow list is going to prevent your sites from being blocked incorrectly.

These are the addresses you should allow:

192.88.134.0/23, 185.93.228.0/22, 2a02:fe80::/29, 66.248.200.0/22, 208.109.0.0/22

Once WAF is activated, the Content Delivery Network (CDN) automatically starts working.

Reprovisioning Your Linux VPS or Dedicated Server

In the previous lessons of System Engineering, you have learned how to startup working with VPS or Dedicated Server. Now sometimes it happens with the newbies that they mess up with config on their server and in that case when no return is possible or you don’t know the solution you can just rebuild your server to give yourself a fresh start.

For reverting to a clean setup on your Linux Server, you can rebuild it which is also called reprovisioning. This reprovisioning process is done to return your server to a newly purchased state.

Reprovisioning erases all problematic code and content on your server’s hard drive, including all backups, files, everything and this cannot be undone.

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. On the upper-right corner, click Server Actions
  5. Select Rebuild Server

Now, follow the prompts on the rebuild your server screen, and then re-set-up your server by following these steps:

  1. Next to your server, click Manage
  2. Enter a name for your server in the Server name field
  3. Select an OS and data center location (if available) and then click Next
  4. Complete the fields for making a username and password
  5. Click Finish

It takes sometimes and your server is rebuilt, configured, and restarted and then you may log in to your server and do whatever you like doing.

China’s Playing Pakistan Can Make India Recognize Taiwan

India and China should better refrain from wasting their historic chances against each-other as this has been a favourite game plan of the West that the two neighbours are getting entrapped to play. Contrarily by coming together they can consolidate their prospects even better instead of spoiling everything in struggling with each-other.

Provocative measures are not going to serve the two neighboring countries. China’s playing Pakistan can make India recognize Taiwan. Is this even worth trying? Whereas India-China Informal Summits independently possess all the potential to drive the world the way that suits best to the peoples of two countries. Not enjoying this understanding is a sheer waste of their historic time that is already arrived.

NATO’s Very Existence And Further Expansionism Provokes A World War.

Staying decently distant from all the international conflicts by being neutrally nice to all the nations alike has been India’s historically correct choice and only that is correct for every other country also. So if the United Nations has to continue in business, this must ban all military alliances at once. Instead only UN should exercise an international Peace Keeping Force for anywhere.

NATO was not necessary. This was established under the pretext to prevent Communism from spreading into Europe. Then why this military alliance is continued to be in existence even when there was no such notional threat anywhere? Actually NATO’s establishment played provocateur to bring Warsaw pact into existence and thus the cold war did begin in the world. Still its very existence and further expansionism provokes another world war.

NATO’s very origin did undermine the relevance of then recently established United Nations Organization. UNO was proclaimed to be the ultimate design of preventing another world war, whereas NATO was an instrument of making that kind of a war.

India Is Increasingly Required Staying World’s Neutral Space

India’s increasing prosperity must have a purpose of stabilising the world into an order of peace. Not only Ukraine and Russia but Tibet, Taiwan, Japan, China, Iran, Afghanistan and even Pakistan can also benefit from a neutral India; not aligned with any countries in any conflict at any point of time.

Historically the West didn’t understand this but that too is gradually coming to understand now. India is increasingly required staying world’s neutral space actually a lot more than Switzerland was necessary earlier.