Category Archives: Hosting

Increase /tmp partition size in cPanel and secure it

/etc/init.d/cpanel stop
/etc/init.d/httpd stop
/etc/init.d/lsws stop
/etc/init.d/mysql stop

umount -l /tmp
umount -l /var/tmp
Move /usr/tmpDSK file to another location (just in case you’ll need to mount it somewhere else to preserve data):

mv /usr/tmpDSK /usr/tmpDSK_back
Modify /scripts/securetmp to set tmpdsksize to desired size:

vi /scripts/securetmp
$tmpdsksize = 2048000

/scripts/securetmp

Start cpanel, apache (litespeed), mysql services:
/etc/init.d/cpanel start
/etc/init.d/httpd start
/etc/init.d/lsws start
/etc/init.d/mysql start

munin running on nginx (ubuntu)

apt-get install nginx libfcgi-perl wget
mv -v /etc/nginx/sites-available/default /etc/nginx/sites-available/default.old
vi /etc/nginx/sites-available/default

server {
listen 80;
server_name linux4you.tk www.linux4you.tk;
root /var/www/linux4you.tk;
access_log /var/www/logs/example.com.access.log;

location / {
index index.html index.htm index.pl;
}

location ~ \.pl|cgi$ {
try_files $uri =404;
gzip off;
fastcgi_pass 127.0.0.1:8999;
fastcgi_index index.pl;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

mkdir /var/www/linux4you.tk
chown -R www-data:www-data /var/www/linux4you.tk

If you want enlarge your munin grahics, you need install fastcgi:

wget –spider -v http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper | grep exists

If exists run:

wget http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper -O /usr/bin/fastcgi-wrapper.pl
wget http://nginxlibrary.com/downloads/perl-fcgi/perl-fcgi -O /etc/init.d/perl-fcgi
chmod +x /usr/bin/fastcgi-wrapper.pl
chmod +x /etc/init.d/perl-fcgi
update-rc.d perl-fcgi defaults
insserv perl-fcgi

service nginx start
service perl-fcgi start

vi /var/www/linux4you.tk/index.pl
#!/usr/bin/perl

print "Content-type:text/html\n\n";
print <Perl Environment Variables

Perl Environment Variables

EndOfHTML

foreach $key (sort(keys %ENV)) {
print "$key = $ENV{$key}
\n";
}

print "";

chmod 755 /var/www/linux4you.tk/index.pl

munin: install_driver(mysql) failed: Can’t locate DBD/mysql.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 19) line 3

Error: install_driver(mysql) failed: Can’t locate DBD/mysql.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 19) line 3.
Perhaps the DBD::mysql perl module hasn’t been fully installed,
or perhaps the capitalisation of ‘mysql’ isn’t right.
Available drivers: DBM, ExampleP, File, Gofer, Pg, Proxy, Sponge.
at /etc/munin/plugins/mysql line 340

Fix: cpan -fi DBD::mysql

Centos install FFMPEG, Mencoder, GPAC for 3gp from source

# install dependencies
yum -y install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran subversion patch zlib-devel

# get encoding software
cd /usr/local/src

wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
wget http://downloads.sourceforge.net/gpac/gpac-0.4.5.tar.gz

tar xf gpac-0.4.5.tar.gz
tar jxvf amrnb-7.0.0.2.tar.bz2
tar jxvf essential-20071007.tar.bz2

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

# install encoding software

mkdir /usr/local/lib/codecs/
mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp

cd /usr/local/src/amrnb-7.0.0.2
./configure
make && make install

cd /usr/local/src/mplayer
svn update
./configure
make && make install

cd /usr/local/src/ffmpeg/
./configure –enable-libamr-nb –disable-mmx –enable-nonfree
make && make install

cd ./gpac
./configure
make && make install

# update library links
echo /usr/local/lib > /etc/ld.so.conf.d/ffmpeg.conf
ldconfig