Vasudeva Server

Adding LetsEncrypt certs to a cPanel account with more than 100 domains using AutoSSL

We recently had to add Let’s Encrypt SSL certs to a cpanel account which contained over 100 parked domains (or domain aliases, as they are now called)

The problem is that Lets Encrypt has a 100 domain limit for SAN certs (multiple domains on the same certificate). In reality that limit is 50, because you have to issue certs for both the non-www and www versions of the domain to ensure effective non-www to www redirect (or vice versa)

The WHM AutoSSL function adds an SSL certificate for each Apache virtual host. Parked domains are included in the account domain’s virtual host, so AutoSSL will try to add all the parked domains to the same SSL certificate, adding as many as it can before the domain limit is reached.

However if you add each domain to the account as an add-on domain, cPanel creates an Apache virtual host for each add on domain, and AutoSSL will issue a seperate certificate for each host.

So the solution in our case, was to remove all our parked domains, and turn them into add-on domains pointing at the account domain’s web root.

Useful command line snippets for investigating site downtime

Look at incoming hosts – can be good for seeing if there is some kind of system abuse (eg ddos)

netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nrk 1 | head

Isolate Apache processes by account owner – sometimes it is Apache processes belonging to a particular site that are consuming memory.

lsof | grep '^httpd' | grep '/home/'

Using this command in conjunction with top should be able to point out the culprit account

Hat tip: our hosts Wiredtree – this little bit of info came in response to working out a recent issue

Batch renaming files using command-line find and replace

This turned out to be quite easy:

replace 'old text' 'new text' files-to-replace

So for example to change all spaces to underscores in a folder of jpegs, you can cd to the folder and type

replace ' ' '_' *.jpg

I did see some other syntax for this online which looked more like sed, so maybe it depends on the linux distribution (I was using Red Hat at the time).

New Drupal modules by Vasudeva Server

We are pleased to announce some new Drupal modules we have developed

  • Rearrange Child Pages – allows you to change the order and titles of the child pages of the node you are currently on. This is very useful if you are using Drupal’s book funtionality on a very large site and the books contain very many nodes. View project page…
  • Domain Migrate – Allows users to migrate content on existing Drupal sites to their own domains. View project page…

In addition, we have merged our Domain Administration Helper module into the Domain Admin module, and are now co-maintainers of that module