Pages

Saturday, May 26, 2018

How to check the Inode usage for an account in cPanel server

First of all, let me briefly explain about Inode. Index Node (inode) is a basic concept in Linux/Unix. Index node/number (inode) is a data structure which contain the information about a file in your server/hosting account.

Inode save the information such as user and group ownerships, access mode (read, write, execute permissions) and file type.
Number of inodes indicates the number of files and folders in your account. Every file like a webpage, image file, an email, cache file etc will count as 1 inode.
In a WHM server, you can view the inode usage of your account from left side of your cPanel which is denoted by the term “File Usage”.


Note, this feature must be enabled from the WHM's tweak settings (Display File Usage information in the cPanel stats bar (inode count)) to display in cPanel. [Default OFF]


How to Install eAccelerator on cPanel Server

eAccelerator is a free open-source PHP optimizer & accelerator. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. Enhances execution of scripts. It typically reduces server load and increases the speed of your PHP code by 10 times. Stores compiled PHP scripts in shared memory and executes code directly from it. It creates locks for a short time, so one script can be executed at the same time by several engines. Files that can’t fit in shared memory are cached on disk.
Installing eAccelerator on your linux dedicated/VPS can be achieved by just one command.

 
# /scripts/phpextensionmgr install eAccelerator 

Un-installation of eAccelerator

/scripts/phpextensionmgr uninstall EAccelerator


Check with the command below if eAccelerator has been installed properly.

Friday, May 18, 2018

Install Memcache onto cPanel

Memcached is a service that allows entire database tables to be stored in memory, drastically speeding up queries to those tables and alleviating database load. In WordPress and W3 Total Cache, the Memcached module allows you to store all cache tables in memory.
This guide can be used to set up Memcached on CentOS.

To install memcached on cpanel server, login to SSH as user root, run

   
yum install memcached
Enable memcached start on boot with
systemctl enable memcached
Start memcached with
   
systemctl start memcached

Enable memcached PHP module
For PHP applications to use memcached, we need PHP module installed. To install login to WHM as user root, go to
Home > Software > Module Installers



Install nginx as reverse proxy in cPanel

The web-hosting control panel’s default web-server is Apache. cPanel/WHM doesn’t have native support on Nginx, but we can install and configure it so that it will improve the server performance.

Why run Apache and Nginx together? Is there any advantage by using Nginx as reverse proxy on Cpanel?

Both Apache and Nginx are powerful and effective web-servers. Apache is the topmost webserver since it was released in 2006 and Nginx is now using top websites. The reason for using Apache and Nginx are clear, Apache’s power and Nginx’s speed. By setting Nginx as reverse proxy, we can increase the website’s speed and performance on the server. This is because, Nginx will take care of all static contents in the website such as CSS, images, SWF files, MP4 and more. Apache will manage the rest of requests (dynamic requests – php page). This is known as a Nginx reverse proxy setup. Nginx stand as a front end server with a powerful backend Apache server.

How to set up?


WHM/Cpanel Increase The Size Of /tmp (/usr/tmpDSK) Partition

You may have noticed that cPanel’s default partition size for /tmp is
512 MB, which in some cases can be way too small. And sometime you probably get this report email:
Drive Critical: /usr/tmpDSK (/tmp) is 100% full
Although cPanel automatically deletes the unused files, the /tmp would be getting full very quickly on a busy server.
The /tmp partition on cPanel servers, assuming it was the one cPanel created and not one you did yourself, is a file-based partition that can easily be resized.
By default on most servers, /tmp is the temporary dumping place for a lot of things, for example:
  • PHP session files
  • PHP temporary file uploads
  • MySQL temporary files
  • Cache files for certain Apache modules


Basic Linux Commands

In this article, I am going to provide you a brief overview of some of the most commonly used and essential Linux Commands. Becoming familiar with these commands will help you get far in a fairly short amount of time.


  • ls Displays everything in the current directory
  • ls -a Displays all files, including hidden
  • ls -l Displays all files, along with the size and timestamp
  • tar -zxpf Uncompresses tar.gz files
  • tar -xpf Uncompresses .tar files
  • gunzip Uncompresses .gz files
  • cp /path/to/old /path/to/new Copies a file to a new file
  • mv /path/to/old /path/to/new Moves a file to a new file, or rename
  • mkdir Creates a directory
  • rmdir Deletes a directory
  • rm Deletes a file
  • rm -rf Deletes a directory
  • cd /path/to/dir Moves to a directory
  • cd .. Move up one directory
  • cd ~ Moves to your home directory
  • cd – Moves to the previous directory
  • pwd Displays the present working directory (the one you’re in)
  • pico Edits a file
  • ftp Connect to a FTP server
  • lynx View a webpage
  • df Displays the hard drive stats
  • quota Displays your quota
  • uptime Displays the uptime of the server
  • uname -a Displays the operating system stats
  • whoami Displays your info
  • who Displays others connected to the server
  • last Displays the last login
  • whereis Tells where a file is located
  • BitchX IRC Client
  • mail Check your email
  • ps -x Displays processes your running
  • ps -a Displays all processes running
  • ps -ux Displays running processes, with CPU/Memory usage
  • kill pid# Kills a process
  • kill -9 pid# Kills an eggdrop process
  • killall proc_name Kills all running process of the same type
  • whatis Description of commands
  • man command Displays help on the command (manual)
  • nano Same as Pico (Use yum install nano if it doesn’t first work)
  • Top – gives an overall view of what is going on with the server including memory usage, serve load and running processes “q” to exit top
  • sar -q gives a report of the process list, 1 minute and 5 minute average load every 10 minutes since midnight server time
  • tar -zcf filename.tar.gz file Tars up the file or directory of your choice, replace filename.tar.gzwith the name you want your tar file to have…with the tar.gz extension on the end and replace file with the file or directory you want to tar up. Can also use a path/to/file for both.
  • updatedb – Updates the locate/search DB.