Securing the Nibbleblog Admin area by renaming it

The default access for any Nibbleblog admin activity is via the link http://your.domain/admin.php and the underlying filesystem is located in {NB_TOPDIR}/admin. Whilst this suits most peoples needs. If your paranoia gets the better of it, you could simply adapt Nibbleblog to your needs.

In this article I provide a method of changing the default admin location to an alternate.

Whilst these steps have been written for Ubuntu 16.04, they should also work on other flavours of Linux with no or little tweaking.

For the purpose of this article we will rename admin to cpanel.

  1. Login to your system where Nibbleblog is installed
  2. Stop your Apache web service. For example:
    % sudo systemctl stop apache2 
  3. Change directory to the Apache web root where Nibbleblog is installed. For example:
    % cd /var/www/html
  4. Rename the admin directory and corresponding php files to cpanel:
    % mv admin cpanel
    % mv admin.php cpanel.php
    % mv cpanel/boot/admin.bit cpanel/boot/cpanel.bit
    % mv cpanel/boot/rules/11-admin.bit cpanel/boot/rules/11-cpanel.bit
  5. Update all Nibbleblog files with the replacement admin name
    % sed -i 's/admin.php/cpanel.php/g' \
       $(find . -type f -exec grep -l admin.php "{}" \;)
    % sed -i 's/admin/cpanel/g' \
       $(find . -type f -exec grep -l admin "{}" \; | grep -v lang)
  6. Restart your Apache web service. For example:
    % sudo systemctl start apache2 
  7. To access your new Nibbleblog admin area. Point your web browser to http://your.domain/cpanel.php.