Posts Under Category: cPanel

cpanel-paper-lantern theme

In this small tutorial, I will explain how to show hidden files like .htaccess file in cPanel file manager under paper lantern theme.

Step 1

Login in cPanel and click File Manager to open file manager.
cpanel-file-manager

Step 2

In File Manager, Click Settings button located in top right corner. This will open settings popup window.
cpanel-file-manager-settings

Step 3

On popup windows, check Show Hidden Files (dotfiles) and save. Done!!
cpanel-file-manager-show-hidden-files

cpanel update error
If you are getting following warning mail message from your cPanel server

Cpanel update failure in upcp
Running `/usr/local/cpanel/scripts/updatenow –upcp –log=/var/cpanel/updatelogs/update.1434952321.log` failed, exited with code 29 (signal = 0)

Cpanel update failure during updatenow

An error was detected which prevented updatenow from completing normally.
Please review the enclosed log for further details

[20150622.015201] Detected version ‘11.48.4.4’ from version file.
[20150622.015201] Running version ‘11.48.4.4’ of updatenow.
[20150622.015600] Using mirror ‘66.23.237.210’ for host ‘httpupdate.cpanel.net’.
[20150622.015706] Using mirror ‘75.126.236.226’ for host ‘httpupdate.cpanel.net’.
[20150622.020037] Using mirror ‘83.170.94.2’ for host ‘httpupdate.cpanel.net’.
[20150622.020042] ***** FATAL: Unable to retrieve tier version info: Interrupted system call
[20150622.020042] The Administrator will be notified to review this output when this script completes
[20150622.020042] E Detected events which require user notification during updatenow. Will send iContact the log

Follow below steps to solve it.
Step 1:
Login to your server via SSH as user root.

Step 2:
Run following commands

/scripts/autorepair fix_duplicate_cpanel_rpms
/scripts/upcp --force

Step 3:
The above commands will update cPanel to latest stable version. After update is completed, login in WHM as root to check if everything is fine.

Done!!

Wordpress security
I am seeing a lot of WordPress wp-login.php brute force attack these days. In this tutorial I will explain how to stop wp-login.php attack on a cPanel server. read more

In this tutorial, I will explain how to install cPanel on a new Linux server with CentOS installed on server.

Step 1:

Before installing cPanel, make sure you have a cPanel license for your VPS. If you do not have cPanel license, you can get a free 15-days trail license. It will take hardly 1-minute to get a 15-days trail licence.
Get cPanel 15-Days Trail Licence
read more

If Apache / HTTPS is using lots of memory on your server, here is how you can optimize Apache on your server / VPS.
Login as root in WHM and navigate to:

WHM Home >> Service Configuration >> Apache Configuration >> Global Configuration

And change value of Max Connections Per Child. Default value of Max Connections Per Child is 10,000
You should reduce this value to 1000. This will greatly reduce memory usage by Apache on your server.

Our Recommended VPS Hosting

For security reason, it is highly recommended that you use SSH key to login to your server via SSH instead of using root password. In this tutorial I will explain how to use SSH key to login to your server via SSH as root user.

Step 1:

Disable SSH Password Authorization Tweak. For security reason, you should disable SSH Password Authorization Tweak from:

WHM Home >> Security Center >> SSH Password Authorization Tweak

disable-password-auth

Step 2:

Now we will generate SSH key on a cPanel server. In WHM, navigate to:

WHM Home >> Security Center >> Manage root’s SSH Keys

And click Generate a New Key.
manage-root-key

Step 3:

Fill the form for the new SSH key and click Generate Key button. Key name can be anything like your server name or your name. Use a strong key password. Please note, you should not use your root password.
manage-root-key

Step 4:

In this step we will authorize the key. Click Manage Authorization for the key that we have generated.
authorize-ssh-key
And Authorize this new key.

Step 5:

In this step we will download the SSH key. Click View/Download Key under Private Keys section.
view-download-ssh-key

Enter the password that you have used in step 3 while generating this key and click convert button.
convert-ssh-key

Step 6:

Copy the key and paste it on a notepad file. Save this text file as ssh.ppk on your computer. Please note, you may use different name for this ssh key file, but you must use .ppk extension.
putty-ppk-ssh-key

Step 7:

So, we have generated and downloaded the SSH key. To use this SSH key with putty, we need to download Pageant.
Download Pageant

Step 8:

After downloading pageant, run it and click Add Key button.
pageant

Browse and select the ssh.ppk file that we have saved in step 6. Pageant will ask for password. Enter the password that you have used in step 3. This will add the key in pageant.
pageant-enter-password

Step 9:

Start putty and try to login to your server as root.
ssh-login

Done!! You will get logged in to your server as root user.

Our Recommended VPS Hosting

For security reason, it is recommended that you change your server default SSH port from 22 to any other port. We have a detailed step by step tutorial for changing SSH port.
How to change SSH port of a Linux server

But if you have forgot your server new SSH port number, or if the new SSH port is blocked at server, here is how you can reset SSH port back to default 22 port on a cPanel server.

Step 1:

Login in WHM of your server using root.

http://serverip:2086

Step 2:

Add following url at the end of your WHM url and run it.

scripts2/doautofixer?autofix=safesshrestart

The final url may be like:

http://serverip:2086/scripts2/doautofixer?autofix=safesshrestart

Your server SSH port is now reset to default 22. If its not working, you may need to restart SSH from

WHM >> Restart Services >> SSH Server

Our Recommended VPS Hosting

In this tutorial, I will explain how to update cPanel License key of a server / vps. cPanel license key can be updated from SSH. You need to update your server license key when you have a new licence key, or you want to upgrade from trail version to paid version.

Login to your server as root and via SSH and run following command

/usr/local/cpanel/cpkeyclt

Done!!

Now try to login in WHM using URL: http://server-ip:2086 OR http://server-ip/whm

Our Recommended VPS Hosting

For security reason, it is recommended that you disable directory listings / indexing on your server. Apache default configuration comes with this feature enabled but its always a good idea to get it disabled unless you really need it.

When this option is enabled, user can see the list of files / folder of a directory when no index file is present.
apache-directory-index

With Apache listings / indexing option disabled, user will not be able to see content of a directory in absence of a index file.

Here is how you can disable this on a cPanel server.

Step 1

Login to your server WHM as root.

Step 2

Navigate to:
WHM Main >> Service Configuration >> Apache Configuration >> Global Configuration

Step 3

Under Directory ‘/’ Options >> uncheck Indexes >> Save >> Restart Apache

apache-directory-index-2

Done!!

Our Recommended VPS Hosting

MySQLTuner is great script to optimize mysql database of a server. It reports a large number of statistics and settings from your MySQL database engine, and then offers general recommendations to improve performance.

To run MySQLTuner on a serve / VPS with cPanel, run following command in SSH

/usr/local/cpanel/bin/mysqltuner.pl

Our Recommended VPS Hosting