Category Archives: Linux

Install multiple versions of PHP on Linux

You can install all versions of php either from source or install the default version using yum installer. My server has php5.3 already installed and I am going to install PHP5.6 from source. Prerequisites Create required folders mkdir -p /usr/local/php56 mkdir -p /etc/php56 mkdir -p /etc/php56/php.d Download php5.6 wget http://de1.php.net/distributions/php-5.6.19.tar.gz Compile php ./configure –prefix=/usr/local/php56 –with-config-file-path=/etc/php56 …

Read more

Caused by SystemException in API_Linux.cpp:444: execve() for program “/usr/bin/php” failed: Permission denied

Scenario: My Cpanel server is installed with multiple php version and All of a sudden all my sites thrown 500 internal server error. Troubleshooting: The logs was showing the following message Caused by SystemException in API_Linux.cpp:444: execve() for program “/usr/bin/php” failed: Permission denied Resolution: I checked and I could see that the permission of “/usr/bin/php” …

Read more

how to find current ssh port number in whm server

How to see the SSH port number if we have WHM with root access. Normally many hosting providers will change the default SSH port from 22 to any custom numbers. There is very easy method to find it if you have WHM root access.  You do not need to install any plugin to find it. …

Read more

How to install SSL certificate on Centos Web Panel

When we install SSL certificate on Centos Web Panel (CWP) the SSL certificate may not work using default installations. You may need to do some edits in Centos Web Panel (CWP)  apache configuration files. To install Certificate go to the SSL manager Security–> SSL Manager Use the SSL Generator to generate Key, CSR  and Selfsigned …

Read more

innodb-error-log-file-ib-logfile0-is-of-different-size

This error comes and mysql server is rebooted dues to a power failure of any unplanned shutdown. If you try to start mysql service you will get the same error in mysql error log. The solution is to go to the mysql data directory and move the logs ( ib_logfile0, ib_logfile1 etc) file to a temporary location. …

Read more

Convert MyISAM Tables to InnoDB

If you want to convert all MyISAM tables to InnoDB, following Script will do the smae. #!/bin/bash DBNAME=””; DBUSER=””; DBPASS=””; for t in $(mysql -u$DBUSER -p$DBPASS –batch –column-names=false -e “show tables” $DBNAME); do echo “Converting table $t”; mysql -u$DBUSER -p$DBPASS -e “alter table ${t} type=InnoDB” $DBNAME; echo “Repair table $t”; mysql -u$DBUSER -p$DBPASS -e “repair …

Read more

Create Swap Memory on Centos

Check for Swap Space swapon -s Create and Enable the Swap File sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k ( create 512 K Swap ) sudo mkswap /swapfile The results display: Setting up swapspace version 1, size = 536866 kB Finish up by activating the swap file: sudo swapon /swapfile sudo nano /etc/fstab Paste in the …

Read more

Alert when file is modified in Linux

This is one of the script I used many years ago. There are many other methods now, but just thought of adding it. I had a server where few files were modified by malware. I applied all security measures and in order to alert me in case file is modified again, I created below shell …

Read more

Add Secondary IP in Linux and Permanently Save

I am going to add the ip 1 192.168.8.1 on to to eth0 as eth0:1 cp /etc/sysconfig/network-scripts/ifcfg-eth0  /etc/sysconfig/network-scripts/ifcfg-eth0:1 Edit the file with new IP, device name and subnet.

Upgrade Webmail in Cpanel

You can try below command to upgrade webmail in cpanel/whm servers. /usr/local/cpanel/bin/update-squirrelmail /usr/local/cpanel/bin/update-roundcube I am not sure how to upgrade Horde. I will add once I get it .