SOLVED Problem adding LittleUtils

Friends4U

Member
Jan 20, 2005
18
2
153
Hi,

I have installed LittleUtils on my CloudLinux server:

First the dependencies:

Code:
# yum install gcc libpng libpng-devel gifsicle pngcrush p7zip lzip lzma
Downloading and untarring LittleUtils (1.0.37 is also available):

Code:
# 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
Installing:

Code:
# ./configure --prefix=/usr && make && make install && make install-extra
It is also possible that your binaries aren't accessible to your web server user. You can link these binaries using the following commands:

Code:
# ln -s /usr/local/bin/opt-jpg /usr/bin/opt-jpg
# ln -s /usr/local/bin/opt-png /usr/bin/opt-png
# ln -s /usr/local/bin/opt-gif /usr/bin/opt-gif
# ln -s /usr/local/bin/tempname /usr/bin/tempname
# ln -s /usr/local/bin/imagsize /usr/bin/imagsize
# ln -s /usr/local/bin/gifsicle /usr/bin/gifsicle
# ln -s /usr/local/bin/pngcrush /usr/bin/pngcrush
# ln -s /usr/local/bin/pngrecolor /usr/bin/pngrecolor
# ln -s /usr/local/bin/pngstrip /usr/bin/pngstrip

Verifying installation:

Code:
# which to-xz
# which opt-jpg
# which opt-png
- Last one does not find anything?!?

Code:
# which lowercase
# which opt-gif
- Last one does not find anything?!?

Code:
# which tempname
# which pngstrip
# which jpegtran
# which imagsize
# which filesize
# which pngcrush
- Last one does not find anything?!?

Code:
# which gifsicle
- Does not find anything?!?

Code:
# which pngrecolor
If it's installed correctly you should see something like:

[email protected] [/usr/local/bin]# which opt-jpg
/usr/local/bin/opt-jpg

On every which.

After that I created:

Code:
# vi /etc/cagefs/conf.d/littleutils.cfg
And inserted:

Code:
[littleutils]
comment=Littleutils
paths = /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
Run the update of CageFS

Code:
# cagefsctl --force-update
And enable CageFS

Code:
# /usr/sbin/cagefsctl --enable-all

However, it's not working (yes only for jpg), the others (see above) are not to be found using which... What am I doing wrong here?
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
Hello,

I see support ticket number 8591435 was opened to request assistance with this issue. I'll monitor the support ticket and update this thread with the outcome once the ticket is complete.

Thank you.
 

Friends4U

Member
Jan 20, 2005
18
2
153
I wish... But, I got a message from CPanel support that they will not honour my support request because it's thirth party software.
 
Last edited:

Friends4U

Member
Jan 20, 2005
18
2
153
What I did find... on the following site: CW Image Optimizer (it's from the WordPress plugin why I need it)
For the opt-png, the following RPM is needed:

Code:
# cd /usr/local/src/
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# rpm -i rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Problem is that that host doesn't exist anymore: unable to resolve host address “packages.sw.be

So I've found another host:

Code:
# wget http://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# rpm -i rpmforge-release-0.5.2-2.el6.rf.i686.rpm
But if I run:

Code:
# yum install gcc libpng libpng-devel gifsicle pngcrush p7zip lzip
I get (again):

Code:
Loaded plugins: fastestmirror, rhnplugin, universal-hooks
Setting up Install Process
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://apt.sw.be/redhat/el6/en/mirrors-rpmforge error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'apt.sw.be'"
 * EA4: 85.13.201.2
 * cpanel-addons-production-feed: 85.13.201.2
 * cloudlinux-x86_64-server-6: de-proxy.cl-mirror.net
http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'apt.sw.be'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge. Please verify its path and try again
So that doesn't work also :(
This is probably because I need to update rpmforce mirrors... But that's where the system lost me... I'm just to stupid I'm afraid... Don't want to mess my server up...
 
Last edited:

Friends4U

Member
Jan 20, 2005
18
2
153
I remove the old rpm

Code:
yum remove rpmforge-release
And installed a newer version

Code:
# cd /usr/local/src/
# wget http://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
# rpm -i rpmforge-release-0.5.3-1.el6.rf.i686.rpm
No errors this time about not existing url's :)

After that I did the install from above (with the latest LittleUtils) and this time:

Code:
# which opt-png
Does work!

However, the plugin still says: CW Image Optimizer requires littleutils. You are missing: opt-png, opt-gif.
So I am still not completely there :( Any ideas?
 

Friends4U

Member
Jan 20, 2005
18
2
153
Found it :) Some files where not in /usr/local/bin but in /usr/bin so I changed the symlinks and now it's working :)
I hope I did everything correct.

Code:
ln -sf /usr/bin/opt-png /usr/local/bin/opt-png

ln -sf /usr/bin/opt-gif /usr/local/bin/opt-gif

ln -sf /usr/bin/jpegtran /usr/local/bin/jpegtran

ln -sf /usr/bin/pngcrush /usr/local/bin/pngcrush

ln -sf /usr/bin/gifsicle /usr/local/bin/gifsicle
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
I'm happy to see the issue is now addressed. Thank you for updating us with the outcome.
 

Friends4U

Member
Jan 20, 2005
18
2
153
Still could use your help Michael...

Everything is installed correct but I get the error:

Bad response from optimizer

I should be able to see the error (and why it's there) in the Apache Error log (the error log), but I don't know where to find it....

The complete install I've done so far:

Code:
LittleUtils



Edit:



vi /etc/cagefs/conf.d/littleutils.cfg



[littleutils]

comment=littleutils

paths = /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/local/bin/jpegtran, /usr/local/bin/imagsize, /usr/local/bin/filesize, /usr/local/bin/pngcrush, /usr/local/bin/gifsicle, /usr/local/bin/pngrecolor



Run (just to be sure):



yum remove rpmforge-release



Batch:



cd /usr/local/src/
wget http://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
rpm -i rpmforge-release-0.5.3-1.el6.rf.i686.rpm

yum install file gcc libpng libpng-devel gifsicle pngcrush p7zip lzip lzma

#First need to install old version, else tempname does not get created

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

./configure --prefix=/usr && make && make install && make install-extra

cd ..

rm -r -f littleutils-1.0.27

rm -f littleutils-1.0.27.tar.bz2

wget http://downloads.sourceforge.net/project/littleutils/littleutils-source/1.0.37/littleutils-1.0.37.tar.bz2

tar -jxf littleutils-1.0.37.tar.bz2

cd littleutils-1.0.37

./configure --prefix=/usr && make && make install && make install-extra

cd ..

rm -r -f littleutils-1.0.37

rm -f littleutils-1.0.37.tar.bz2

ln -sf /usr/bin/opt-png /usr/local/bin/opt-png

ln -sf /usr/bin/opt-gif /usr/local/bin/opt-gif

ln -sf /usr/bin/jpegtran /usr/local/bin/jpegtran

ln -sf /usr/bin/pngcrush /usr/local/bin/pngcrush

ln -sf /usr/bin/gifsicle /usr/local/bin/gifsicle

ln -sf /usr/bin/tempname /usr/local/bin/tempname

cagefsctl --force-update

/usr/sbin/cagefsctl --enable-all
When I disable CageFS for this user, all works fine!
 
Last edited:

Friends4U

Member
Jan 20, 2005
18
2
153
I did, and it's fixed now :)

I had an error in my /var/log/apache2/error_log

Code:
sh: /usr/local/bin/opt-jpg: /bin/dash: bad interpreter: No such file or directory
sh: /usr/local/bin/opt-jpg: /bin/dash: bad interpreter: No such file or directory
sh: /usr/local/bin/opt-jpg: /bin/dash: bad interpreter: No such file or directory
So they added dash:

Code:
cagefsctl --addrpm dash
cagefsctl --force-update
And now it works :)
 
  • Like
Reactions: cPanelMichael