cpanel-php

Create New Hosting Account in WHM

To create new hosting account in Cpanel/WHM, login to WHM at

http://yourserverip/whm

Now to go

You can also use the search box on left top side of WHM. Search for “create”, then click on “Create a New Account” link.

On “Create a New Account” page, you need to enter your domain name. User name will be auto generated. Click “Password Generator” to generate secure password. Make sure you copy this password as you need it later for login to Cpanel/FTP.

Scroll down and click “Create button”.

Now your hosting account is ready.

You will be able to login to Cpanel at

http;//yoru-server-ip/cpanel

Change PHP version

To change PHP version for a web site, login to cpanel at

http;//yoru-server-ip/cpanel

Once logged in search “php”

Click on “MultiPHP Manager” button. On next page, you will be able to change PHP version for the web site.

On this page, click the checkbox right side of your domain name. From “PHP Version” drop down, select the PHP version you need. Click Apply. Now your site have selected PHP version.

Amazon Ec2 Fixing Cpanel IP after restore from snapshot

On an Amazon EC2 server running Cpanel, i had to restore from Snapshot as some data was missing. Once restored, i changed Elastic IP to new EC2 instance. But sites did not work. This is because Internal IP of EC2 instance got changed when you restore from snapshot.

In httpd.conf VirtualHosts where using old internal IP 10.0.0.200. But this IP was no longer available in the server, new Internal IP was 10.0.0.204.

Check if sites are still using old internal IP address

To change IP, you need to do the following

WHM >> Home >> Multi Account Functions >> Change Multiple Sites’ IP Addresses

1. Select all the accounts showing 10.0.0.200 for the current ip
2. Select “Change IPs of Selected Accounts”
3. In the New Address dropdown, you would select the External IP for all the accounts
4. Select Change IPs

In Change Multiple Sites’ IP Addresses, drop down listed 52.4.207.175 (Elastic IP Address) and 10.0.0.204. I selected 52.4.207.175 for all sites and is working fine now.

Now rebuild httpd.conf file with

See Cpanel Server Behind NAT (Amazon AWS), Cpanel Server

Cpanel Server Behind NAT (Amazon AWS)

When hosting Cpanel server behind NAT like Amazon AWS, Google Cloud etc.. where you have internal IP and external IP, you need to enable NAT so cpanel will map external IP to internal IP.

First make sure external IP is not added to your server. Now run

On AWS, this generate a file like

Here 172.31.39.115 = internal IP. 18.218.172.134 = external IP.

Now login to WHM, go to Home > IP Functions > IP Migration Wizard

Change your sites IP address with INTERNAL IP address.

Show IP Address Usage will show your external IP address

Home > Server Configuration > Basic WebHost Manager® Setup > Basic Config > The IPv4 address (only one address) to use to set up shared IPv4 virtual hosts. will show your external IP address.

See Cpanel Server, Amazon Ec2 Fixing Cpanel IP after restore from snapshot

Cpanel Server Block Incoming SPF Failed Mails

One of the customer email account as getting too much incoming emails from [email protected]

First i tried to block the sender IP, but they are using too many IP.

To stop this incoming email, i edited

Find

Add below

Restart exim

Now watch the mail log with

Enable DKIM on Cpanel Server

DKIM (DomainKeys Identified Mail) is a way to digitally sign your out going emails. This help prevent spam.

On Cpanel server, you can install for a site, run

If you want to enable DKIM on all sites on a cpanel server, run following as user root.

This will also enable SPF.

whmapi1

Getting WHM Access from SSH on Cpanel Server

To get WHM access from SSH, run

This is useful when you have SSH key access to server, but no root password.

whmapi1

Open the URL you get in terminal in a browser, you have WHM root access with out password.

For Cpanel, use

Cpanel

Install Docker on Ubuntu 18.04

I was running Ubuntu 18.04 daily build on my server just to get ready for upcoming Ubuntu 18.04 LTS release.

Since Ubuntu 18.04 is not yet released, Docker.com do not provide a away to install docker on Ubuntu 18.04.

To install Docker on Ubuntu 18.04, run

On 2018-02-28, repository have docker version 17.03-2-ce

Restart php-fpm in Cpanel Server

To restart php-fpm on Cpanel server, run

For Cpanel php-fpm, run

php-fpm config stored in /opt/cpanel/ea-php70/root/etc/php-fpm.conf, pool config available in folder

php70 is for PHP version 7, replace it with actual PHP version you are using.

Cpanel Server

php-fpm

Fix Cpanel SSH Service in WHM

You may need to restart SSH on Cpanel server with default settings to get SSH access. This may needed when you work on a server with unknown SSH port or when SSH service on the server is failed/limited for some reason.

To fix SSH, login to WHM, then access following URL

URL will look like

Cpanel Server