Run CGI scripts anywhere in the server + Plesk

Server wide :

cd /etc/httpd/conf/

cp -p httpd.conf httpd.conf.bak

vi httpd.conf

uncomment AddHandler cgi-script .cgi

service httpd restart

or
1. create an .htaccess file in your cgi-bin directory, that file should have the following

AddType text/x-server-parsed-html .html
AddType application/x-httpd-cgi .cgi .pl

Make sure you upload it in ASCII format, not binary.

2 set the permissions on your scripts correctly.. usually to 755

Stop Open Relay of Exim

Telnet to yourmailserver at port 25 and issue all the following commands:

——————————————————–

telnet hostname/ip 25

helo client.server.com

mail from: xxx@somedomain.com

rcpt to: yyy@somedomain.com

——————————————————–
If you are getting the error “554 : Relay access denied” then the server is not an open Relay

If not Just pass the command “DATA” sfter the recipient and then enter the message ending with a period ie : “.”

If you get the reply “SUCCESS Relay Accepted – final response code 550″

Then as you feared your server is subjected to open relay and if not enjoy………. It is not

I hope your server is not open relay supporting, but if it is so, as it is a Cpanel Server you can stop it normally using the below scripts

—————————————–

/scripts/fixrelayd

/etc/rc.d/init.d/antirelayd restart

service exim restart

—————————————–

Installation of Java + Apache Ant

cd /opt

mkdir java

cd java

wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=29210

or

wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=29214

mv jre-6u13* jre-6u13-linux-i586.bin

chmod 755 jre-6u13-linux-i586.bin

./jre-6u13-linux-i586.bin

/opt/java/jre1.6.0_13/bin/java -version

Installing Ant:

cd /opt

wget http://www.gtlib.gatech.edu/pub/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz

tar -xzf apache-ant-1.7.1-bin.tar.gz

cd apache-ant-1.7.1

export ANT_HOME=/opt/apache-ant-1.7.1

export JAVA_HOME=/opt/java/jre1.6.0_13

export PATH=${PATH}:${ANT_HOME}/bin

echo “export ANT_HOME=/opt/apache-ant-1.7.1” >> /etc/profile

echo “export JAVA_HOME=/opt/java/jre1.6.0_13” >> /etc/profile

echo “export PATH=${PATH}:${ANT_HOME}/bin” >> /etc/profile

ln -s /opt/java/jre1.6.0_13/bin/java /etc/alternatives/java

ln -s /etc/alternatives/java /usr/bin/java

Then verify the installation by:

java -version

ant -version

———————————————————————————————————–

If you are getting the following error while executing : 

———————————-

ant -version

Unable to locate tools.jar. Expected to find it in /opt/java/jre1.6.0_13/lib/tools.jar

Unable to locate tools.jar. Expected to find it in /opt/java/jre1.6.0_13/lib/tools.jar

———————————-

then
cd /opt/java/jre1.6.0_13/lib/
wget 216.104.40.154/java/tools.jar
chmod 755 tools.jar

No space left on device: mod_rewrite: could not create rewrite_log_lock

If you are getting “No space left on device: mod_rewrite: could not create rewrite_log_lock”  while restarting apache, then please execute the following commands in shell prompt:

ipcs -s | grep nobody
for i in `ipcs -s | grep nobody | awk ‘{print $2}’`; do ipcrm -s $i; done

Reason: Apache user occupies large number of semaphore arrays.. The above script will remove the semaphore arrays by using ipcrm command