In this post we will explain how to install littleutils (which are required for the wordpress plugin: CW Image Optimizer) on a CloudLinux based server with CageFS enabled.Please note: this installation was tested on the 64 bit version of CloudLinux 6.4 with Cpanel as control panel
Requirements
- 15 minutes time
- Root SSH Access
- Little SSH knowledge
Step 1. Installation of littleutils
First we are going to install littleutils and make sure installation paths are ok.
- Login to your webserver with your favorite SSH client. (If you do not have root permissions please write “su” to receive root permissions)
- Make sure you have all the required dependencies just execute to following code to install the missing depedencies:
- Download and extract littleutils.
- Configure and install littleutils.
- Verify installation paths (needed for CageFS configuration).
# yum install gcc libpng libpng-devel gifsicle pngcrush p7zip lzip lzma
# wget http://downloads.sourceforge.net/project/littleutils/littleutils-source/1.0.27/littleutils-1.0.27.tar.bz2# tar -jxf littleutils-1.0.27.tar.bz2# cd littleutils-1.0.27.tar.bz2
# ./configure# make# make install# make install-extra
# which to-xz# which opt-jpg# which opt-png# which lowercase# which opt-gif# which tempname# which pngstrip# which jpegtran# which imagsize# which filesize# which pngcrush# which gifsicle# which pngrecolor
Note: if correctly installed you should see something like this in the output for every which:
root@server [/usr/local/bin]# which opt-jpg/usr/local/bin/opt-jpg
Step 2. Configuration of CageFS
We are now going to make sure littleutils is working when a user will be added to the CageFS in CloudLinux. The first thing we need to do is create a custom file system template (/etc/cagefs/conf.d/littleutils.cfg).
- Create and edit littleutils.cfg
- Force update of CageFS Skeleton
# cagefsctl --force-update[pre>Note: You should see in the output that the littleutils files are being copied to the CageFS Skeleton
- Enable CageFS
# /usr/sbin/cagefsctl --enable-all
Please execute the following code
#vi /etc/cagefs/conf.d/littlutils.cfg
You will now see the file editor for littleutils.cfg (which is probably still empty). Please add the folowing code to the file: (press i on the keyboard to enable the vi editor and then just copy paste)
[littlutils]comment=Littleutilspaths = /usr/local/bin/to-xz, /usr/local/bin/opt-jpg, /usr/local/bin/opt-png, /usr/local/bin/lowercase, /usr/local/bin/opt-gif, /usr/local/bin/tempname, /usr/local/bin/pngstrip, /usr/bin/jpegtran, /usr/local/bin/imagsize, /usr/local/bin/filesize, /usr/bin/pngcrush, /usr/bin/gifsicle, /usr/local/bin/pngrecolor
Good idea about the cage, thank you. Just one note about that, you misspelled [littlutils] in the cage template.nnAlso, gifsicle pngcrush p7zip were unavailable via in the default or REHL extras repos. They are rpm at http://pkgs.repoforge.org/. Might wanna add that in your guide.nnAlso also, littleutils 1.0.27 seems to be the last that includes “tempname” and “filesize” utils, both of which are required by the 3 opt-[ext] image compressors. As a note to folks, install that version first so those are included before upgrading to a newer one.nnThanks