Posted by: Master Will | January 23, 2018

How to install missing ifconfig command on CentOS 7

yum install net-tools

Posted by: Master Will | December 8, 2017

Force HTTPS On All Pages Of Your Website and WordPress Site

This is the thing that got me when I was making the full transition to HTTPS for my blog. After changing the site name, all my CSS and JavaScript assets were still coming in with the HTTP URL path rather than HTTPS. This caused my site to appear broken in pretty much every browser.

These site asset files can easily be corrected by fixing the rewrite rules in your .htaccess file found at the root of your WordPress application.

# BEGIN WordPress
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} !^443$    <---- Add this line
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]   <---- Add this line
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
# END WordPress

Notice the highlighted lines in the above code. We’re saying that if the current port isn’t 443, then rewrite the URL to use HTTPS with a 301 redirect. The rest of the above code should already exist in your WordPress .htaccess file. Usually it will be found at the bottom of the file.


—– For non-Wordpress site ——

If you want to force a given website or path to use https, redirected from http, you can create an .htaccess file in the DocumentRoot for that domain or hostname, and add the following code:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

which will redirect any non-https connections to https using the same request and GET variables.

If your site is running through CloudFlare, your https requests to it may actually hit your server in plaintext (http), which is confusing.
For that case, you might need something like this for an http to https redirect:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

where the only usable header is X-Forwarded-Proto, because the %{HTTPS} variable is “off” for requests from the CloudFlare network.

If you’re running nginx, go to:

Admin Level -> Custom Httpd Config ->

and in token |CUSTOM4|, add:

|*if SSL_TEMPLATE=”0″|
return 301 https://$host$request_uri;





Posted by: Master Will | November 23, 2017

Forcing FTP SolusVM backups to run on a SolusVM slave

TP SolusVM backups can get stuck on a SolusVM slave. The way SolusVM backups run is it creates an image of the server whilst it’s still running then places that image into a dump file where it stays whilst it is uploaded to your backup server. If the upload is interrupted then the image will stay in the dump file and take up space. You should remove this file and follow the below to restart the SolusVM backups.

First, let’s remove the file that the server uses to run backups

rm -rf /usr/local/solusvm/tmp/

Then you need to restart the FTP service again by issuing;

php /usr/local/solusvm/includes/autoftpbackup.php
/usr/bin/php /usr/local/solusvm/includes/autoftpbackup.php --debug=1
If you see errors you can run this command with debugging to find out what is causing them;
php /usr/local/solusvm/includes/autoftpbackup.php --mode=all --debug=1
Posted by: Master Will | October 21, 2017

IMAP on DirectAdmin

If you need imap compiled into php, run these pre-install commands:

yum -y install pam-devel


apt-get install libc-client-dev

Once pre-install is done for your OS, run the following:

cd /root
chmod 755

supports both CustomBuild 1.x and 2.x.
For CB2, it will automatically detect the configure.phpX path.

Posted by: Master Will | October 4, 2017

Speed Test CLI on Linux

#### Install software
wget -O speedtest-cli
chmod +x speedtest-cli

#### Run speed test
./speedtest-cli –server 2953 –share



Posted by: Master Will | October 2, 2017

Using Curl to upload file instead of FTP

curl -T /vz/dump/vzdump-001.tgz –user root:yourrootpass

Posted by: Master Will | October 2, 2017

Let’s encrypt SSL on DirectAdmin

yum -y update
/usr/bin/openssl req -x509 -newkey rsa:2048 -keyout /usr/local/directadmin/conf/cakey.pem -out /usr/local/directadmin/conf/cacert.pem -days 9000 -nodes
chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
chmod 400 /usr/local/directadmin/conf/cakey.pem

cd /usr/local/directadmin/conf/
perl -pi -e ‘s/SSL=0/SSL=1/’ directadmin.conf
service directadmin restart

echo “letsencrypt=1” >> directadmin.conf
echo “enable_ssl_sni=1” >> directadmin.conf
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs
./build letsencrypt
vi /etc/httpd/conf/extra/httpd-alias.conf
###### And make sure you see this line
Alias /.well-known “/var/www/html/.well-known”
service httpd restart
service directadmin restart


Then login to DirectAdmin UI and select menu named “SSL Certificates” at the user level.

Note: If you want the server hostname using LetsEncrypt then do below:
cd /usr/local/directadmin/scripts
./ request 4096
cd /usr/local/directadmin/conf
perl -pi -e ‘s/SSL=0/SSL=1/’ directadmin.conf
echo “carootcert=/usr/local/directadmin/conf/carootcert.pem” >> directadmin.conf
echo “” >> directadmin.conf
echo “” >> directadmin.conf
service directadmin restart


—– Troubleshoot —-

Cannot Execute Your Request


Getting challenge for from acme-server…
User let’s encrypt key has been found, but not registered. Registering…
Account registration error. Response: HTTP/1.1 100 Continue
Expires: Wed, 03 Aug 2016 08:08:26 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache

HTTP/1.1 400 Bad Request
Server: nginx
Content-Type: application/problem+json
Content-Length: 265
Boulder-Request-Id: vdS0ublv2yTS3g8BkAW4mjM9f-HCiYV6DgYrfCkaLqI
Replay-Nonce: QUnGB2x_ZY1sJRrGG3MgS9fwtegzDawR8xj1uJ4E50o
Expires: Wed, 03 Aug 2016 08:08:27 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Wed, 03 Aug 2016 08:08:27 GMT
Connection: close

“type”: “urn:acme:error:malformed”,
“detail”: “Provided agreement URL [] does not match current agreement URL []”,
“status”: 400


Well, they have changed their license agreement and that broke the Let’s Encrypt client used in DA. Please use CustomBuild 2.0 (at least rev. 1572) to update script:

cd /usr/local/directadmin/custombuild
./build update
./build letsencrypt

Alternatively, “./build update_versions” can be used as well. The newest version of CustomBuild 2.0 is only available on and fileservers at the moment, other mirrors might take up to 24 hours to update.

To download the file manually (without CustomBuild), just execute:

wget -O /usr/local/directadmin/scripts/

Posted by: Master Will | April 8, 2017

Solusvm auto FTP backup shown already exists

If you see error like below in “Auto FTP backup” feature

/usr/local/solusvm/tmp/ already exists. Is backup already runing?


Just delete the file /usr/local/solusvm/tmp/ and the SolusVM backup will run fine.

rm -rf /usr/local/solusvm/tmp/

Posted by: Master Will | April 2, 2017

Auto FTP backup — debug

Run this command on solusvm master node.

/usr/bin/php /usr/local/solusvm/includes/autoftpbackup.php –debug=1

Posted by: Master Will | July 14, 2016

SolusVM – Moving the SolusVM Master

Moving the SolusVM Master

« Newer Posts - Older Posts »