Administration

DirectAdmin blacklisted and whitelisted IP

Recently my IP address was blacklisted by directadmin on my own server.  Here's a how-to that may save you time, in case you're unable to login to DirectAdmin.

Start DirectAdmin in debug mode

cd /usr/local/directadmin
killall -9 directadmin
./directadmin b2000

Now try to log into directadmin. You should see the reason why you are unable to. For me it was "Blocking blacklisted IP xxx.xx.xxx.xxx"

Tags: DirectAdmin Linux Administration

DirectAdmin how to set an external email server for Domain Pointers

If you ever created domain pointers in DirectAdmin, you may have wondered how to set the domain pointer NOT to process email locally.

For instance say you have PRIMARYDOMAIN.com as the main domain under your DirectAdmin account--and it is set NOT to process emails locally, but rather have an external email server handle that; Under MX Records you un-checked "Use this server to handle my emails. If not, change the MX record and uncheck this option". So now you decided to create a "domain pointer" under that same account for another domain SECONDARYDOMAIN.com ... You set the proper MX records for this domain pointer under DNS settings, pointing to the external mail server, and think you're all good to go...

Tags: exim DirectAdmin Linux Administration

How to prevent accidentally doing "rm -rf /" | How to Install safe-rm

As a server administrator, I rely mostly on root or sudo access--allowing me absolute control of the server. However, "with great power, comes great responsibility!"

You can easily accidentally do this devastatingly bad command of wiping your entire system clean.

rm -rf /
# or
rm -rf /*

Which looks almost identical to the popular command

rm -rf ./
# or
rm -rf ./*

There was a recent prank on 4chan /b/ forum that, in short, instructed users to execute the above command in order to "unlock Apple OS X bitcoin mining". 

Tags: Linux rm safe-rm Administration

How to upgrade coreutils to latest version (from source)

Say you're on CentOS 5.x, and want to pimp out your bash prompt using the pretty awesome Solarized color scheme. Well, there's a nice .bashrc Solarized setup here: https://github.com/seebi/dircolors-solarized. To use all the features of dircolors.256dark version, you'll need GNU coreutils 8.5 or higher, otherwise you'll get errors like this:

Tags: Linux coreutils centos Administration DirectAdmin

How to install Composer and Drush LOCALLY and GLOBALLY

Drush 9.x Install Composer to your LOCAL user directory

cd ~
mkdir .composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar ~/bin/composer
chmod +x ~/bin/composer
echo "PATH=$PATH:~/.composer/vendor/bin" >> ~/.bash_profile
. ~/.bash_profile

Install latest version of Drush locally

Get the latest (or whatever) version here:

https://github.com/drush-ops/drush/releases

cd /LOCATION/OF/DRUPAL
composer require drush/drush

And we done...

Tags: Drupal Administration Linux drush composer