How to increase /tmp size and secure

For shared hosting, big /tmp partition is recommended. If /tmp is too small then you may face /tmp full issue.

How to increase /tmp partition in cpanel

First stop cpanel, apache, mysql services.

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

Now unmount /tmp and /var/tmp

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

Now run following command.

sed -i -e ‘s/512000/2048000/g’ /scripts/securetmp
rm /usr/tmpDSK
/scripts/securetmp –auto
cd /tmp
ln -s /var/lib/mysql/mysql.sock

Once completed, restart all the service.

/etc/init.d/cpanel start
/etc/init.d/httpd start
/etc/init.d/mysql start

That’s it!