cPanel Nginx plugin 5.0 Released

Hello,
Today we are releasing the cPanel nginx plugin version 5.0 with the following new features and bug fixes.
New features :
a) Individual custom expire time for any doamins , subdomains or addon domains . So now you can easily set the expire time of every individual domains. So if you have big image websites , then you can set the maximum expire time. And which increase speed for browsing those websites from a visitor’s browser.
b) Option to add custom include configurations to any domains , subdomains or addon domains . So from this version you can include a custom nginx vhost configuration file to every vhost entry. So you can directly add Hotlink protection , IP denay , htpassword protection etc,. via nginx itself .

Please see the documentation from http://wiki.sysvm.com/CPanelNginx to know how to manage this features

Bug fix :
Addon domains were in direct proxy mode . Now it will configure addon domains as the general domains . That means nginx directly serve the static files.

How to Upgrade ?
The auto upgrade script will upgrade it within next 48 hours. If you need to manually upgrade please execute the following command from shell

 # sh /etc/cron.weekly/updatecpnginx.sh

How to enable PHP Mssql support in cPanel server

Please see the procedure below,

wget -c http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
tar -xzf freetds-stable.tgz
cd freetds-0.82/
./configure --prefix=/opt/freetds --enable-msdblib --with-openssl 
make 
make install

If it it is a 64 bit server then make the following softlink

ln -s /opt/freetds/lib/ /opt/freetds/lib64

Now add the following line to /var/cpanel/easy/apache/rawopts/all_php5

--with-mssql=/opt/freetds

Now compile php using /scripts/easyapache

After the compilation create a phpinfo page and test it.

Uninstall fantastico from cPanel server

Fantastico removal is easy from cPanel.

/usr/local/cpanel/bin/unregister_cpanelplugin /usr/local/cpanel/bin/fantastico_de_luxe.cpaneladdonmodule 
rm -rf /var/netenberg/
rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/
rm -rf /usr/local/cpanel/3rdparty/fantastico*
rm -rf /usr/local/cpanel/base/frontend/*/fantastico
rm -f /usr/local/cpanel/base/frontend/x/cells/fantastico.html
rm -f /usr/local/cpanel/whostmgr/docroot/cgi/addon_fantastico.cgi

Uninstall softaculous from cPanel server

The removal of softaculous is easy

/usr/local/cpanel/bin/unregister_cpanelplugin /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/softaculous.cpanelplugin 
rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/softaculous
rm -rf /var/softaculous
rm -rf /etc/cron.d/softaculous 
rm -f /usr/local/cpanel/whostmgr/docroot/cgi/addon_softaculous.php 

How to Secure /tmp using files

Securing /tmp  is easy in a web hosting linux server ,  if you don’t have a partition for /tmp

1) create a raw file of size 5 GB as follows
dd if=/dev/zero of=/usr/tmpfile bs=1M count=5000
2) Format it using ext3 file system
mkfs.ext3 /usr/tmpfile
3) Add the mount entry in /etc/fstab as follows
/usr/tmpfile              /tmp                    ext3 loop,nosuid,noexec,rw 0 0
4) Stop apache and mysql
/etc/init.d/httpd stop
/etc/init.d/mysqld stop
5) Move the current /tmp and mount as follows,
mv /tmp /tmp.old
mkdir /tmp
rm -rf /var/tmp 
ln -s /tmp /var/tmp
mount -a
chmod  1777 /tmp
6) Start mysql and apache
/etc/init.d/mysqld start
/etc/init.d/httpd start

Howto Directadmin+Apache 2.2+PHP5+SUPHP+Suexec perfect setup

To configure SUPHP in directadmin is an easy task. There are a number of ways to do it. But this method seems to be a perfect setup for it .

Why this method is better than default suphp?

  • The php will be installed under /usr/local/
  • There is no conflict with multiple server phps
  • The php ini path is /usr/local/lib/php.ini
  • This will help to set correct path for php scripts or crons without modifying the client files
  • No modification for default template , just use custom.
  • Use server mysql for php-mysql client , this will avoid client API conflict
  • Easy to implement

Any Auto installer script ?

Yes you can download an auto installer script from here.

How to setup is manually?

Please see the procedure below,

cd /usr/local/directadmin/custombuild
./build clean
./build update
mkdir -pv custom/ap2 
mkdir -pv custom/suphp
rm -rf custom/ap2/*
rm -rf custom/suphp/*
wget -c http://files.syslint.com/da/conf/suphp/configure.apache.conf
mv -vf  configure.apache.conf  custom/ap2/configure.apache
wget -c http://files.syslint.com/da/conf/suphp/configure.php5.conf
mv -vf  configure.php5.conf  custom/ap2/configure.php5
cp -vf  custom/ap2/configure.php5 custom/suphp/
wget -c http://files.syslint.com/da/conf/suphp/configure.suphp.conf
mv -vf configure.suphp.conf custom/suphp/configure.suphp

Now edit /usr/local/directadmin/custombuild/options.conf and make the following changes

php5_cli=no
php5_cgi=yes

Now build apache as follows

./build apache

Now build php as follows

./build php 5

Now create the custom config folder , so that you can simply include all thirdpary php extensions

mkdir -pv /usr/local/lib/php.d

Now make all required soft links

ln -sf  /usr/local/bin/php-cgi /usr/local/bin/php
ln -sf /usr/local/bin/php /usr/bin/php

Now set suphp.conf for the php-cgi location

sed -i 's/x-httpd-php5=.*/x-httpd-php5=\"php:\/usr\/local\/bin\/php-cgi\"/g' /usr/local/suphp/etc/suphp.conf

Now set the php.ini location for suphp

sed -i 's/suPHP_ConfigPath.*/suPHP_ConfigPath\  \/usr\/local\/lib\//g' /etc/httpd/conf/extra/httpd-suphp.conf

Restart apache

/etc/init.d/httpd restart

Testing :

Create a phpinfo page on you domain document root and check it.

Optional Settings:

The following settings are not recommended in a production environment . It will enable user_dir access to your domains and disable some security

Read more about this from here