Tag Archives: CentOS

The Instant Dynamic Caching System Of Sangkrit.net Hosting & Servers

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

How Dynamic Caching Works?

Dynamic caching works by temporarily storing the dynamically generated content in a cache. When a user requests a particular piece of content, the web server first checks if a cached version of that content is available. If it is, the server serves the cached content, which is faster than generating it from scratch. If not, the server dynamically generates the content, serves it to the user, and caches it for future requests.

How To Enable Dynamic Caching On Your Server?

After 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 may use this button to turn on catching, simply 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. 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.

Nginx Cache i.e. “HTTP Caching” Or “Proxy Caching

Nginx cache, often referred to as “HTTP caching” or “proxy caching,” is a powerful feature that allows you to temporarily store and serve web content more efficiently. It is designed to reduce the load on web servers, decrease page load times, and improve the overall performance and user experience.

Every cPanel user account created by you on your VPS or Dedicated Server also gives an option to enable caching over the websites running on the same server but have different hosting accounts.

You can turn on, turn off, or delete the cache on any website simply from the server’s main page on your Sangkrit.net account.

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.

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 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.