How to backup WHM/cPanel accounts to DigitalOcean Spaces

For the past several years I have been using Amazon S3 to backup my WHM/cPanel accounts. It works quite good but the problem is Amazon’s complex pricing model (that charges you for things like diskspace, bandwidth, requests) making price for the service is quite unpredictable. I’ve read on many places that people often got surprised at the end of the month receiving the bill from Amazon.

Recently I have started testing DigitalOcean Spaces, a service similar to Amazon’s S3 (S3 compatible alternative) but with a pricing structure anyone can understand: for $5/month you get 250 GB of storage and 1 TB of outbound transfer (inbound transfer is free like on S3). If you need more than that it will cost you 2cents per every additional GB of storage and 1cent for every additional of outbound GB. Also first two months for every new space are free!

Continue Reading

Tags: https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1820 vhI0XA1vXAezLn7kSjtgqnchUim1XEx1t-8t9kz1NHVfSmiBh_s-yyyPy7KyTefk cadad27791c6ee2082c0b797bc30e53439bb3ec8&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme, https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1834 UtziwESFxZlXZc96MxejPdRcoQiPGeiDs1sXPZJcCx8qQjehWFkVArQGL5wOS4uB 802655013c1cadfe83229b2bb6447b893f270691&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme

How to mount Amazon S3 bucket with Goofys?

While experimenting with s3fs I have also found out another tool written in go programming language that named Goofys. Like s3fs, this tool can also mount Amazon S3 bucket as a folder that can later be accessed just like any other local folder making accessing files in S3 bucket, backing up data or syncing files quite easy. Detailed installation manual for Goofys covers only Mac while Linux installation guide is basically non-existing, so this will be my guide on how to install Goofys and mount Amazon S3 bucket on an Ubuntu Linux. This has been tested on DigitalOcean droplet running a Ubuntu version 16.04.3 x64. If you’re also testing this out on a new VPS like me – make sure to execute apt-get update  before you start.

But why would anyone want to use Goofys if s3fs is working fine? Well, according to benchmarks available at Goofys github main reason you would like to use this is performance! Goofys is much faster than s3fs. For some operations Goofys is ten times faster than s3fs making it the right choice for situations when you need access to S3 to be really fast (or as close as it being just a folder on the same drive).

Continue Reading


How to disable excessive resource usage alert emails?

If you have CSF firewall installed in cPanel you might noticed that you’re getting an email every time some process (usually a php script) uses more than 250MB of memory (default value) or more than 1800 secoonds (also default value).

These emails are being sent by LFD service that sends excessive resource usage alerts to the email address which is assigned to it, normally to root user account. This notification points out a particular process or service using excessive server resources and helps in identifying the resource eating process/service. We can either kill/stop the process/service to free the resource or allocate more resource to it, if necessary, increase the limits or simply do nothing and wait for it to finish it’s work.

Sample LFD email message when memory is exceeded:

—Time: Mon Nov 14 09:41:10 2016 +0530
—Account: xxxxxx
—Resource: Virtual Memory Size
—Exceeded: 205 > 200 (MB)
—Executable: /usr/bin/php
—Command Line: /usr/bin/php /home/xxxxxx/public_html/index.php
—PID: 26953 (Parent PID:24974)
—Killed: No

Sample LDF email message when execution time is exceeded:

—Time: Mon Nov 14 09:41:10 2016 +0530
—Account: xxxxxx
—Resource: Virtual Memory Size
—Exceeded: 125389 > 1800 (seconds)
—Executable: /usr/bin/php
—Command Line: /usr/bin/php /home/xxxxxx/public_html/index.php
—PID: 28429 (Parent PID:26561)
—Killed: No

Getting Started
1) Login to your WHM
2) Go to Home >> select Plugins
3) Click “ConfigServer Security & Firewall”
4) Locate and click at “Firewall Configuration” button

Method 1
This method will permanently disable the LFD excessive resource usage alert and you won’t receive any more emails. Performing this method could pose a a potential security/stability issue (you have been warned! 🙂 ).

5) Modify the value of directives PT_USERMEM and PT_USERTIME to 0.

PT_USERMEM = 0
PT_USERTIME = 0

Method 2
We will increase the values of both memory and time to stop or minimize the LFD alerts. If any process/service uses more resources than defined, you will still continue to receive the LFD alerts, but hopefully less.

5) Modify the value of directives PT_USERMEM and PT_USERTIME to desired.

PT_USERMEM = 500
PT_USERTIME = 150000

Finish
Save the changes you have made and restart CSF+LFD. By doing any of these two methods above should result in getting less or no email alerts from LFD.

Tags: https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1821 wae7YdyUwd0GYPw6YDfXaMA4URY26-PcHUyuIamu4Fx66SzBumWZXBk8nJYCwk7a 05e7b5004ed5f01634a1d6c301c5b8b1782d1c54&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme

How to instal s3fs-fuse on CentOS 6.8?

In case you have CentOS 6.8 server (or DigitalOcean droplet/vps) and you want to install s3fs-fuse the proposed way you’ll run into a problem: the s3fs-fuse requires fuse library version 2.8.4 or higher, but your yum install fuse fuse-devel will install you fuse 2.8.3. If you are running CentOS 7 you won’t have this problem at all, since by default, yum will install fuse 2.9.2.

To fix this problem you need to remove the fuse and install it manually.

1. Remove fuse installed by yum

yum remove fuse fuse* fuse-devel

2. Install some dependencies (for both fuse and s3fs-fuse)

yum install automake gcc-c++ git libcurl-devel libxml2-devel make openssl-devel

3. Download and install latest fuse library (version 2.9.7)

cd /usr/local/src
wget https://github.com/libfuse/libfuse/releases/download/fuse-2.9.7/fuse-2.9.7.tar.gz
tar -xzvf fuse-2.9.7.tar.gz
rm -f fuse-2.9.7.tar.gz
mv fuse-2.9.7 fuse
cd fuse/
./configure --prefix=/usr
make
make install
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
ldconfig

4. Test that fuse is installed (should return “2.9.7″)

pkg-config --modversion fuse

5. Install the s3fs-fuse (using the default instructions from github)

git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure
make
sudo make install

6. If there were no errors along the way, this should return the s3fs-fuse version (currently 1.80)

s3fs --version

Hopefully, this will help you successfully install s3fs-fuse on your system. For details on how to use it please refer to documentation at the github page. Please do not hesitate to leave your comments below! Thank you.


Installig git on CentOS 6 fails with Requires: libcurl.so.3()(64bit)

Today I had to install git on one server running on CentOS 6, but yum install git returned the following error:

Error: Package: git-1.7.12.4-1.el5.rf.x86_64 (rpmforge)
Requires: libcurl.so.3()(64bit)

To fix this bug you have to run this command:

and then confirm the removal of that package:

Loaded plugins: fastestmirror, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package rpmforge-release.x86_64 0:0.5.3-1.el5.rf will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                                       Arch                                                Version                                                      Repository                                              Size
=============================================================================================================================================================================================================================================
Removing:
 rpmforge-release                                              x86_64                                              0.5.3-1.el5.rf                                               @rpmforge                                               13 k

Transaction Summary
=============================================================================================================================================================================================================================================
Remove        1 Package(s)

Installed size: 13 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : rpmforge-release-0.5.3-1.el5.rf.x86_64                                                                                                                                                                                    1/1
  Verifying  : rpmforge-release-0.5.3-1.el5.rf.x86_64                                                                                                                                                                                    1/1

Removed:
  rpmforge-release.x86_64 0:0.5.3-1.el5.rf

Complete!
[root@hosted-by boot]#

After that the standard yum install git will work just fine!

Tags: https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1822 xpO7RGjjn5DBUbbJ-PjQ79atxViAwFBRwqkwRdhTEcgfoPQFj68Kmg9iGg5IlvTh c4fa654acdaf3ec35a1d2154b6c1918f4e984fab&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme, https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1883 uNjnK0t8Y9rB3PolAXTO0Ajh81tVbxtz8eNiTN0iN10dwIl9YznBOFoW2ht-HUjd 5af4e6099d5e8e8adb3e70c61b0839e22ae263b2&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme