Howto: Enable/Install T1Lib PHP support in cPanel

February 11, 2010    |   Posted by admin   |    Category: Installations

How to enable/install the T1Lib module on a cPanel server?

T1Lib is mainly required with GD module but there is no option to enable T1Lib via easyapache OR to install it using yum. You will either have to compile PHP manually with the T1lib option i.e. –with-t1lib OR by including the module in the rawopts file.

Easyapache mostly offers all the modules that is basically required but some unique modules like T1lib is not offered in which case, you can add it to rawopts file.

EasyApache during the compilation process, look for this file and compile any module mention in there along with the modules it offers. But before executing easyapache, install T1Lib manually.

SSH to your server as root user and goto a temporary directory

# cd /usr/local/src

Download T1Lib

# wget ftp://sunsite.unc.edu/pub/linux/libs/graphics/t1lib-5.1.2.tar.gz

Unpack the package and enter the directory

# tar -zxf t1lib-5.1.2.tar.gz
# cd t1lib-*

Configure T1Lib

# ./configure

Create the installation files and install

# make
# make install

Now, once T1Lib is installed, create a “all_php5” file under the ‘rawopts’ directory

# touch /var/cpanel/easy/apache/rawopts/all_php5

Add the following line to it

# echo --with-t1lib=/usr >> /var/cpanel/easy/apache/rawopts/all_php5

Make sure to add other custom modules one per line if you need them. Now, the next step is to rebuild Apache + PHP via the usual method

# /scripts/easyapache

Just go through the options you normally do and the custom module will be picked up automatically.

Once Apache + PHP is compiled, you can either verify it from the command prompt

# php -i | grep t1lib

Or by creating a phpinfo.php file under the default directory of the server and access it via the web i.e.

http://yourserverip/phpinfo.php

You should see the “T1Lib” module under the GD section of that file.

Comments Off on Howto: Enable/Install T1Lib PHP support in cPanel

postdrop: create file maildrop/xxx: Permission denied

February 6, 2010    |   Posted by admin   |    Category: Linux Administration

You may see quite a few maildrop warning messages in the postfix logs such as

postdrop: warning: mail_queue_enter: create file maildrop/xxxx.xxxx: Permission denied
postdrop: warning: mail_queue_enter: create file maildrop/yyyy.yyyy: Permission denied

The error occurs when postfix is not able to write under the “maildrop” folder and hence unable to send emails. This is due to incorrect ownership on the ‘maildrop’ folder i.e. the “maildrop” folder is not owned by ‘postfix’.

Check the ownership/permissions of the postfix files:

# /etc/init.d/postfix check
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/public
postfix/postfix-script: warning: not owned by postfix: /var/spool/postfix/maildrop

Solution:

Stop the postfix service:

# /etc/init.d/postfix stop

Kill the postdrop processes:

# killall -9 postdrop

Correct the ownership of the above directories:

# chown postfix.postdrop /var/spool/postfix/public -R
# chown postfix.postdrop /var/spool/postfix/maildrop -R

Now, start the postfix service:

# /etc/init.d/postfix start

Emails should now be working fine.

Unable to get tty name: Bad file descriptor

February 6, 2010    |   Posted by admin   |    Category: VPS Management

You may receive an error as “Unable to get tty name: Bad file descriptor” while accessing a VPS from the host server. The problem occur when some files from /lib directory of the VPS goes missing. See example below:

root@hostserver:/# vzctl enter VEID
entered into CT VEID
Unable to get tty name:
Bad file descriptor
root@VEID:/#

In this case, you will either have to copy the /lib directory from a different VPS of the same template

# cp -R /vz/root/VEID1/libĀ  /vz/root/VEID/

(where, VEID1 is the VPS ID of a different VPS using the same OS template)

OR extract the respective OS template and copy the /lib directory from it:

# tar -zxf /vz/template/cache/os_template.tar.gz
# cp -R /vz/template/cache/lib /vz/root/VEID/

Reboot the VPS

# vzctl restart VEID

Comments Off on Unable to get tty name: Bad file descriptor