/usr/bin/phpize /bin/sh: bad interpreter: Permission denied

October 21, 2009    |   Posted by admin   |    Category: Linux Administration

Error Message:

/usr/bin/phpize: /tmp/tmpjMvBZg/package.x.x/build/shtool: /bin/sh: bad interpreter: Permission denied

If you receive the above error message while installing a package using “pecl”, it meant that the /tmp partition is mounted in “noexec” mode and that you do not have permissions to execute anything under /tmp partition.

Execute the “mount” command and you will see something like:

root@server [~]# mount
/dev/sdax on /tmp type ext3 (rw,noexec,nosuid)

To mount the /tmp partition in rw mode, execute:

root@server [~]# mount -o remount rw /tmp

Now, you can execute the “pecl” command to install the package you like. Once done, you can remount /tmp with noexec mode again:

root@server [~]# mount -o remount rw,noexec,nosuid /tmp

Howto: Install ImageMagick on Plesk

October 21, 2009    |   Posted by admin   |    Category: Plesk Management

How to install ImageMagick on Linux/Plesk server? Follow the below steps to install ImageMagick on a Plesk server. Login to your server as root and execute the following commands:

1. Install “ImageMagick” package via YUM.

yum install ImageMagick

2. Now install “ImageMagick-devel”

yum install ImageMagick-devel

3. Install “php-pear” required for “pecl”. It will install and compile ImageMagick with PHP for you.

yum install php-pear

4. Now, you need to install ImageMagick using pecl

pecl install imagick

A imagick.so file will be created under /usr/lib/php/modules/ directory. Now, edit the php configuration file /etc/php.ini and add the following line after the “extension_dir” directive

extension = “imagick.so”

Save the file and restart the httpd service. That is it. You can verify using the command:

php -i | grep imagick

Comments Off on Howto: Install ImageMagick on Plesk

ODBC support on a cPanel server

October 19, 2009    |   Posted by admin   |    Category: cPanel Management

How to compile unix odbc on a cPanel server? On a cPanel server, the /scripts/easyapache script almost provides all the modules that are required to host the websites but the modules such as odbc has to be installed manually. You first have to install the devel packages for unixodbc, then add a line in rawopts file and rebuild Apache+PHP. That is it.

1. Install the UnixODBC devel packages:

yum install unixODBC unixODBC-devel

2. You now need to create a file “all_php5” to add a line to enable odbc so that apache build will pick it up from there. File all_php5 is for PHP5 and all_php4 is for PHP4.

pico /var/cpanel/easy/apache/rawopts/all_php5

3. Add the following line:

--with-unixODBC=/usr

4. Rebuild Apache/PHP using the “easyapache” script and the above file will be picked up automatically:

/scripts/easyapache

Once the compilation completes, you should have odbc module compiled with PHP. You can check the module either using a phpinfo() file OR through shell by executing:

php -i | grep odbc

-bash: locate: command not found

October 19, 2009    |   Posted by admin   |    Category: Linux Administration

Error Message:

[root@server ~]# locate filename
-bash: locate: command not found

You may receive the above error message while searching a file using locate command and the error indicates that the package “slocate” required for the locate command is not installed. To install the package, execute:

yum -y install slocate

You will now be able to use the locate command but before that, execute the command “updatedb” so that the locate database is updated.

Comments Off on -bash: locate: command not found

Howto: Enable TUN module on a VPS for VPN

October 16, 2009    |   Posted by admin   |    Category: VPS Management

TUN module is required to configure VPN (Virtual Private Network) tunneling on a VPS,. The TUN module has to be enabled on the Hardware node as well as on the VPS from the node itself.  Login to your Host server and execute the following command:

First check if the TUN module is enabled on the hardware node:

lsmod | grep tun

If not, load the module using modprobe:

modprobe tun

Now, enable the TUN module on a VPS:

vzctl set VEID --devices c:10:200:rw --save
vzctl exec VEID mkdir -p /dev/net
vzctl exec VEID  mknod /dev/net/tun c 10 200
vzctl exec VEID  chmod 600 /dev/net/tun

where, VEID is the VPS ID you want to enable the TUN module on. Once done, you can configure VPN on the VPS using any available vpn server like OpenVPN.

Comments Off on Howto: Enable TUN module on a VPS for VPN