Categories
Server

Does CSF Firewall Make Your WHM / Server Slow ?

There are various reasons why CSF firewall may make your WHM / server slow.
Here are some personal tips from me.

Categories
JavaScript Programming

How to Install PhantomJS in cPanel / WHM Server

Here is what i did to install PhantomJS in cPanel / WHM 🙂

Categories
Server

Empty a File Using Linux Command

Today i received an e-mail notification from cpanel that a partition in my server is almost full.
First i checked largest directories / files using this command :

du -h --max-depth=1 /some/path

Then i noticed that they were some log files which took space in my partition 🙂

Categories
Database Server

Regularly Runs MySQL FLUSH QUERY CACHE

In some situation, like suggested in some mysql optimization script, you may want to regularly run “FLUSH QUERY CACHE”.

First, open your terminal and try to run this command :

mysql -e 'FLUSH QUERY CACHE'

If there is no error, you can add that command in your cron job, such as this command to run it every 10 minutes :

*/10 * * * * mysql -e 'FLUSH QUERY CACHE'
Categories
Server

How to Create and Extract Tar.gz File in Linux

How to create tar.gz in Linux :

tar -zcvf "archive.tar.gz" "file.sql"
tar -zcvf "archive.tar.gz" "/home/example/public_html/"

How to extract tar.gz in Linux :

tar -zxvf "archive.tar.gz"
Categories
Server

How to Install PECL Memcache in WHM / CentOS

You can run these commands to install PECL memcache (not memcached).
However, this memcache will work with memcached.

wget http://pecl.php.net/get/memcache-3.0.8.tgz
tar xvfz memcache-3.0.8.tgz
cd memcache-3.0.8
phpize
./configure
make
make install

Take note of the php extensions directory that memcache is installed in.
Mine is: /usr/local/lib/php/extensions/no-debug-non-zts-20020429/

Then add this line to your php.ini

extension="/usr/local/lib/php/extensions/no-debug-non-zts-20020429/memcache.so"
Categories
Server

How to Install Memcached in WHM / CentOS

I use Centos & WHM.
Here is how to install memcached (not memcache) using command line.

First, installing memcached

wget http://memcached.org/latest
tar -zxvf memcached-1.x.x.tar.gz
cd memcached-1.x.x
./configure && make && make test && sudo make install
Categories
Server

How to Change SSH Port with WHM & CSF

If you are using WHM & CSF, under CentOS, you may follow this steps to change SSH port from 22 (default) to something else 🙂

Categories
Server

How to Install ConfigServer Security & Firewall (CSF) in WHM

To install ConfigServer Security & Firewall (CSF) in WHM, please run this commands in your SSH terminal one by one.

wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

After it completes, there is a new menu in WHM which is under “Plugins” category, named “ConfigServer Security & Firewall”. 🙂

Categories
Server

How to Install Litespeed in WHM

Here i will explain how to install Litespeed webserver in WHM.
According to the Litespeed wiki :

  1. Open & login to your SSH terminal
  2. Execute this command to download the installer :
    wget http://www.litespeedtech.com/packages/cpanel/lsws_whm_autoinstaller.sh
  3. Next we will make the file executable :
    chmod a+x lsws_whm_autoinstaller.sh
  4. Last step we can execute this command :
    (please check the litespeed wiki for parameter explanation)

    ./lsws_whm_autoinstaller.sh TRIAL 2 1000 admin a1234567 root@localhost 1 0

    If you have litespeed license, replace “TRIAL” with your serial number.
    You can replace “admin” with another litespeed admin username.
    You can replace “a1234567 ” with another litespeed admin password.
    You can replace “root@localhost” with another litespeed admin e-mail.

  5. Wait until it completes.
  6. A new sub menu named “Litespeed Web Server” will appear on your WHM.
  7. You must activate litespeed from that sub menu.