Tag Archives: Linux

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.

How To Login To SSH Server Without Password?

SSH key authentication is a secure method of logging into an SSH server without needing to enter a password. It relies on the use of a pair of cryptographic keys: a private key (kept secret) and a public key (shared with the server). This lesson guides you on how to set up SSH key authentication and login to the server without password.

Generate SSH Key Pair

First, you need to generate an SSH key pair if you don’t already have one. Open your terminal and run the following command to generate a new SSH key pair:bashCopy codessh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa

-t rsa: Specifies the type of key to create (RSA).-b 2048: Sets the key length to 2048 bits (you can use higher values for stronger security).

-f ~/.ssh/id_rsa: Specifies the file name for the generated key pair (the default location is ~/.ssh/id_rsa).

During key generation, you can choose to set a passphrase for added security, but it’s optional. A passphrase adds an extra layer of protection to your private key.

Copy the Public Key to the Server

Next, you need to copy your public key to the server you want to access via SSH. You can do this manually or by using the ssh-copy-id command.

Replace <username> and <hostname> with your server’s username and hostname:bashCopy codessh-copy-id <username>@<hostname>

If you prefer to do it manually, you can append the contents of your public key (~/.ssh/id_rsa.pub) to the ~/.ssh/authorized_keys file on the remote server:bashCopy codecat ~/.ssh/id_rsa.pub | ssh <username>@<hostname> 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys'

Make sure the ~/.ssh directory on the remote server has proper permissions (usually 700), and the ~/.ssh/authorized_keys file should have permissions set to 600.

Test SSH Key Authentication

You can now test SSH key authentication by attempting to SSH into the remote server:bashCopy codessh <username>@<hostname> If you set a passphrase for your private key, you’ll be prompted to enter it. Otherwise, you should be logged in without being asked for a password.

Disabling Password Authentication

For enhanced security, it’s a good practice to disable password-based authentication once you’ve confirmed that SSH key authentication is working. You can do this by modifying the SSH server’s configuration (typically located in /etc/ssh/sshd_config).

Set PasswordAuthentication to no.Reload the SSH server: sudo service ssh reload or sudo systemctl reload ssh.This ensures that SSH access can only be obtained using the authorized SSH key.

SSH key authentication is a secure and convenient way to access remote servers, and it’s widely used for server administration and secure file transfers. Just remember to protect your private key and use passphrases for added security.

The lesson guides you on the Linux server environment. If you’re using Windows, you can use an SSH client like PuTTY or Windows Subsystem for Linux (WSL) to follow similar steps.

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.

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.

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.

Patching Your Linux Server For Security Vulnerabilities

Once your Linux VPS or Dedicated Server is up and running the websites. You’ll need to keep it protected from security vulnerabilities. To do that, keep patching your server regularly.

Develop a monthly or weekly practice of performing this uncomplicated task and it will save you from a lot of hassle thereafter.

To start, you need to connect to your server via SSH, we have discussed it before, read this tutorial. Once you are connected, switch to root user by running this command:

  • sudo su –

and enter your server password. You now have root access.

Next, run the following command:

  • yum clean all
  • yum update

If you have Ubuntu Linux on your server then replace the above two commands with the following one:

  • apt-get upgrade

That’s it. In the case of Windows Server, you need to connect the server via RDC, follow these steps:

  1. Launch Remote Desktop Connection
  2. Enter your server’s IP address
  3. Enter your user name and password
  4. Select Control Panel from the Start menu
  5. Click Windows Update
  6. Click Check for Updates
  7. Complete the steps to update your server

Managed Hosting, Business Hosting, WordPress, and other assisted service plan customers do not need to patch their own servers. It works either automatically or by the support team.

How AutoSSL Secures All Websites On Your Server At SANGKRIT.net

AutoSSL is a free feature of VPS and Dedicated Servers you subscribe from SANGKRIT.net, it can be used as a free alternative to paid SSL certificates. Configuring AutoSSL, you can automatically secure your websites using a Domain Validated (DV) SSL.

Apart from the users of VPS and Dedicated Servers, the Business Hosting users also get the advantage of AutoSSL. The domain names associated with your VPS or Dedicated Server account automatically get an SSL certificate by AutoSSL unless you have purchased and installed another one. In that case, AutoSSL won’t override the existing certificates but still works for other domains on your server.

After the SSL certificate is installed, the auto-application installer of your server (that allows you to install WordPress and other apps) also lets you choose an HTTPS connection for your website. If you have made or uploaded a website manually then you can manually redirect it to a secure HTTPS connection.

This is done by making a few modifications to your .htaccess file which can be created (if not already present) in the root i.e. public_html directory of the domain you want to secure

If you just created the .htaccess file, use the following code (replacing the example.com with your own domain name) to set up the redirect to the HTTPS version of your website:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

At the time you change the primary domain or add another domain to your server, the AutoSSL immediately attempts the installation of an SSL certificate. But for the SSL to install and work successfully, your domain name must point to the server’s IP address.

If you see that the SSL is not working for any domain name or you want to manually activate or deactivate the SSL on some domain, you can do that manually from the SSL/TLS Status page in the cPanel administration area of your server.

Testing Linux, Apache, MySQL, & PHP On Your VPS Or Dedicated Server

In the previous lesson, you learned about configuring the super admin access to your server.

Next, while launching a new web application project or a simple website you will need to make sure that the server versions of Linux, Apache, MySQL, and PHP are compatible with the application you like to build or install on your VPS or Dedicated Server.

At SANGKRIT.net, you always get an up-to-date server so you won’t be facing any such compatibility issues here. But, there are commands to check different versions of commonly installed services on your LAMP Server (VPS or Dedicated) running CentOS, Ubuntu, or Fedora.

Simply run these commands to check your versions of Linux, Apache, MySQL & PHP:

Apache: /usr/sbin/httpd -v or httpd -v

Server version: Apache/2.2.29 (Unix) Server built: Oct 9 2020 11:35:25 Cpanel::Easy::Apache v3.26.8 rev9999


Apache on cPanel: /usr/local/apache/bin/httpd -v

Server version: Apache/2.2.29 (Unix) Server built: Oct 9 2020 11:35:25 Cpanel::Easy::Apache v3.26.8 rev9999


Curl: rpm -q curl

curl-7.19.7-40.el6_6.3.x86_64


Bash: bash –version

GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;


Exim: exim -bV

Exim version 4.84 #2 built 9-Oct-2020 15:02:41


Glibc: ls /lib/libc-*

/lib/libc-2.12.so*


Kernel: uname -r

2.6.32-042stab093.5


PHP: php -v

PHP 5.4.33 (cli) (built: Oct 7 2014 11:48:26) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies


MySQL: mysql -v

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 213432 Server version: 5.5.40-cll MySQL Community Server (GPL)


CentOS/Fedora: cat /etc/redhat-release

CentOS release 7.6 (Final)

Here, Linux is the operating system you are using on your VPS or Dedicated Server, Apache is the most popular HTTP server used on the public internet, MySQL is the database that contains all text and password information of your website and PHP is the programming language used to code web applications.

These most commonly used services need to work on your server so that you can build websites and web applications on your domains.

People Buy Products, Not Any Technology

Shipping a great new product, not necessarily based on a new technology is adequate for the growth of business.

Steve Jobs made NeXT once he was forced to leave Apple behind. WorldWideWeb was invented on a NeXT computer. Still the business was not that good for NeXT.

On the other hand Tim Berners-Lee refrained from releasing world-wide-web under GNU-GPL only on the basis that corporates might not get involved due to the leftist reputation of GNU and Richard Stallman. Thereafter came Linux, GNU’s much awaited kernel code from Finland. That struggled for desktop space although got server side business. Then came Andy Rubin. He simply made android by using Linux as its kernel and a great new product is born to get purchased by Google. That made its own space acquiring the highest growth rate ever seen in business.

Apple got in trouble and Amelio started looking for a new operating system. Fortunately Apple bought NeXT shelling out much larger amount for less valued stocks but for what? Steve Jobs was hired again and what he did? He stopped Apple, looking for a new operating system. Instead he prepared Apple to ship the great new product iPod. iPod by Apple was greater than Walkman by Sony. Considering that the concept was not new as music listening on the go has already been a popular behaviour. iPod simply added great value to that popularity and became successful within no time establishing a great new user experience. Business became good around that.

People do not buy a technology. People buy a product. Shipping a great new product, not necessarily based on a new technology is adequate for the growth of business.

How To Change Password Of An Encrypted LVM System In Linux?

During installation, many Linux distros like Ubuntu and Elementary OS etc asks you to encrypt your hard drive using LVM encryption. This simply makes all you data encrypted and one with its password can only open you laptop to use operating system or access your data files.

Continue reading How To Change Password Of An Encrypted LVM System In Linux?

How To Clean Up Noise Music Library In Elementary OS Linux?

Noise (Music) is the default music player for Elementary OS Linux. One common problem experienced by its users is that it doesn’t provides any visual option to clear-up unwanted music files from library in order to fresh start.

Continue reading How To Clean Up Noise Music Library In Elementary OS Linux?

How To Avoid Google Chrome Freeze On Ubuntu & Other Linux Distros?

Google Chrome freeze is a common problem experienced on Linux operating systems, specially on 64 Bit OS. This happens only with Google Chrome and Chromium browsers and it is happening since a very long time.

Continue reading How To Avoid Google Chrome Freeze On Ubuntu & Other Linux Distros?

How To Disable Hardware Acceleration In Google Chrome?

For rendering web pages Google Chrome doesn’t need to depend completely on the CPU. This is because, it supports GPU hardware acceleration.

This may be a good idea as it speeds things up but in many cases it becomes the main cause of system freeze, mouse and keyboard issues, slow web pages and many performance issues.

Continue reading How To Disable Hardware Acceleration In Google Chrome?

Now You Can Run Desktop Linux On Your Android Device

Android is Linux and in a few steps you you can get the benefits of running a complete desktop Linux system with in your Android device. You can turn Android into a desktop Linux working station running Debian, Ubuntu or any other popular distro.

Continue reading Now You Can Run Desktop Linux On Your Android Device

How To Easily Backup Gmail To Ubuntu Using Thunderbird?

Thunderbird is a free email application with easy customizations and set up, loaded with awesome features. It is default email application on various Linux distributions like Ubuntu. So first thing you need to do is visit your Gmail account to enable POP in Gmail.

Continue reading How To Easily Backup Gmail To Ubuntu Using Thunderbird?

How To Make Ubuntu HotSpot Wifi Network Visible For Android Devices?

A few months ago we discussed about using your Ubuntu laptop as a wifi router. In other words, creating a hotspot with your Ubuntu Linux. Default Ubuntu Wifi network is not visible for Android devices, specially for devices using Android 4.1.2 versions like Samsung Galaxy etc. In that case you may give a try to ap-hotspot from the webupd8 repository for creating an infrastructure AP but here a much better universal solution who need creating detectable hotspot with Ubuntu Linux.

Continue reading How To Make Ubuntu HotSpot Wifi Network Visible For Android Devices?

How To Create & Export Photo Slideshows As Video Files In Ubuntu?

Videoporama is available both for Linux & Windows. It is a free software you can use for creating videos or slideshow videos from images. It is mainly designed to make image slideshow and export them as video files.

Continue reading How To Create & Export Photo Slideshows As Video Files In Ubuntu?

Using Third Ubuntu Click To Open Apps, Tabs, Pasting Text & More

There are many mice and some touchpads available that provides you a middle mouse button. In general mouse and touch pads doesn’t provides you the third click button i.e. middle click but now problem you can use third click by pressing both mouse buttons at the same time. This is more easy on laptops becuase there you have to put your finger on the place where both (left & right) click buttons meet each other (in center) and press both of them together, it seems difficult but its very easy. Or on a mouse with a a scroll wheel, you can usually press directly down on the scroll wheel to middle-click.

Continue reading Using Third Ubuntu Click To Open Apps, Tabs, Pasting Text & More

How To Display Playing Song Lyrics On Ubuntu Linux Desktop?

Users who Want to know what they are listening to, for displaying the song lyrics on your Ubuntu desktop there are various desktop applications that automatically displays lyrics of the song you are currently listening to. OSDLyrics on of the app that displays lyrics directly on desktop and highlights the words in real-time, just like karaoke. The best thing is that OSDLyrics app is compatible with most popular Linux music players including Banshee, Rhythmbox (default Ubuntu Music Player), Exaile,Amarok, MPD etc. Its display options are configurable which enables you to set the colour, font, width and much more.

Continue reading How To Display Playing Song Lyrics On Ubuntu Linux Desktop?

How To Check Your Laptop Battery Health In Ubuntu?

Ubuntu has made laptop battery health check very-very easy. It uses ‘Power Statistics’ app which comes installed by default from Ubuntu.  It simply offers you power stats on a range of connected hardware and that is the thing which makes it useful for more than just checking battery and its info. The best thing about ‘Power Statistics’ app is that all information is presented in a clean and user-friendly style.

Continue reading How To Check Your Laptop Battery Health In Ubuntu?