Tag Archives: Linux

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 <http://gnu.org/licenses/gpl.html>


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

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?

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?

Easily Install Gnome 3.10 Environ In Ubuntu 13.10

Gnome 3.10 release contains 34786 changes by approximately 985 contributors. It has major new features and large collection of small-small enhancements and an improved experience for users. Want to switch Gnome 3.10 from Ubuntu Unity environ. Here’s how you can easily install or uninstall Gnome 3.10 in Ubuntu 13.10 Linux.

Continue reading Easily Install Gnome 3.10 Environ In Ubuntu 13.10