cPanel – Remove FrontPage for All Accounts

FrontPage Extension in cPanel is consider deprecated and there are many security holes reported in this. Microsoft has discontinued FrontPage extension support for the Unix platform since end of 2006. It is good thing to remove this extension which sometimes being installed without your acknowledgement.

You can use many way to remove FrontPage extension, since cPanel already have built-in scripts to remove FrontPage extension which is /scripts/unsetupfp4. Following BASH script has been tested in cPanel 11.28.93 running on CentOS 5.5. It will detect users from /var/cpanel/users directory and try to search for vti directory, if found, the cPanel’s FrontPage uninstaller will execute the domain name found in .htaccess.

Lets do this. Firstly, create a new file by using text editor which, I will use nano:

[[email protected] ~]# nano /root/removefp

2. Copy and paste following scripts:

#!/bin/bash
# Remove Frontpage Extension for all accounts in cPanel server
 
USERDIR='/var/cpanel/users'
 
read -p "Are you sure you remove FP extension for all domains? <y/N> " prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
then
 
u=`ls -l $USERDIR | egrep '^-' | wc -l`
 
for (( i=1; i<=$u; i++ ))
do
        user=`ls -l $USERDIR | egrep '^-' | awk {'print $9'} | head -$i | tail -1`
        echo "Checking user $user FrontPage status.."
        homedir=`cat $USERDIR/$user | grep HOMEDIRPATHS | sed 's/HOMEDIRPATHS=//'`
 
        if [ -d $homedir/public_html/_vti_pvt ]; then
                domain=`cat $homedir/public_html/.htaccess | grep AuthName | awk {'print $2'}`
                echo "FrontPage found. Removing FrontPage for $domain.."
                /scripts/unsetupfp4 $domain
        else
                echo "FrontPage not found for $user"
        fi
done
echo "Process completed"
 
else
  exit 0
fi

(Press ‘Ctrl-X’ then ‘Y’ then ‘Enter’ to save and exit from editor)

Continue reading “cPanel – Remove FrontPage for All Accounts” »