Archive for the tag 'cpanel'

SBDavid

Cpanel failurls File

Cpanel failurls File

The failurls file, located at /var/cpanel/failurls, allows you to specify where resellers can redirect users who fail to authenticate with cPanel.

Enter the URLs to which resellers can redirect users, one per line, in the file.

Entries in this file must meet the following requirements:

Entries must be an exact match. Dynamic URLs are not acceptable.

Example:

http://example.com/index.php?failed=1

Dynamic content on the login page must be passed via hidden POST variables. Using the GET query string will fail because it will not match any entry in the failurls file exactly. When you are finished creating entries in the failurls file, you must restart cPanel. To restart cPanel, run the following command as the root user:

/usr/local/cpanel/startup

Reference : http://cpanel.net/

SBDavid

Installing cPanel DNS ONLY

Installing cPanel DNS ONLY

To begin your installation, use the following commands:

Open the /home directory by typing the command cd /home

Fetch the latest installation file from the cPanel servers by typing the command

wget -N http://httpupdate.cpanel.net/latest-dnsonly

Open and run the installation files by typing the command sh latest-dnsonly

SBDavid

How to fix Cpanel Account Permissions

How to fix Cpanel Account Permissions

Fixing file and directory permission.

find /home/*/public_html/* -type f -exec chmod 644 {} \;
find /home/*/public_html/* -type d -exec chmod 755 {} \;

we can specify user by replace * with usename

To fix the permission for all the websites.

for i in `ls /var/cpanel/users` ; do chown -R $i.$i /home/$i/public_html/* ; done

Transferring all your cpanel accounts using shell.

First we need to create all accounts backup on your current server, execute following command

cat /var/cpanel/users | while read line; do
/scripts/pkgacct $line
done

All accounts are backuped up under /home, now transfer all accounts backup to your new server using SCP command line.

scp cpmove-* root@new-server-ip:/home

Now to resoter the accounts.

To restore all accounts, put all the users in the file named users on the new server /home

cat /home/users | while read line; do
/scripts/restorepkg $line
done
SBDavid

cPanel XML and JSON APIs

cPanel XML and JSON APIs

cPanel XML API allows you to issue commands to cPanel and WHM using the XML language, while JSON API allows you to submit requests to the system and receive a JSON response. By including these commands in your custom scripts, you can perform functions remotely, without having to access the cPanel or WHM user interface.

There are several possible applications of the XML and JSON APIs. For example, they can make managing a data center easy by allowing you to issue a single command across multiple servers.

The JSON API is much less resource-intensive than the XML API. cPanel highly recommend using the JSON API, especially if performance is important, since it provides much faster results.

Reference: http://cpanel.net

« Prev - Next »