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 you, 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 web server where Nibbleblog is installed
  2. Stop your Apache web service:
    • Debian 8 (or later), Ubuntu 15.04 (or newer)
      % sudo systemctl stop apache2 
    • Debian 7 (or older), Ubuntu 14.04 (or older)
      % /etc/init.d/apache2 stop
    • CentOS/RHEL 7x (or newer)
      % sudo systemctl stop httpd.service
    • CentOS/RHEL 4x/5x/6x (or older)
      % sudo service httpd stop 
      • Change directory to the Apache web root where Nibbleblog is installed. For example:
        % cd /var/www/html
      • 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
      • 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)
      • Restart your Apache web service. For example:
        % sudo systemctl start apache2 
      • To access your new Nibbleblog admin area. Point your web browser to http://your.domain/cpanel.php.