Installing PostgreSQL on Your cPanel/WHM Server
cPanel requires PostgreSQL 7.3.x or later.
First step is to update cpanel using /scripts/upcp from command line while logged in as root. If you have PostgreSQL 7.2.x installed, back up your databases using pg_dumpall.
Move your existing PostgreSQL data directory somewhere else by, for example, typing the following command:
mv /var/lib/pgsql /var/lib/pgsql.old
Type the following command:
From WHM now select Postgres Config in the SQL Services section of WHM. Type a new PostgreSQL password in the text box and click Change Password.
Tags: Cpanel/WHM, installing, PostgreSQL, server
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
Tags: Account, cpanel, fix, permissions
Using SED command line to delete line from a file.
d Delete pattern space. Start next cycle.
You can use the following one liner to remove one line (line 3) from a file.
$ sed -i 3d ~/.ssh/known_hosts
This will remove line 3 form the file ~/.ssh/known_hosts
Tags: command, line, sed.
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
Tags: Accounts, cpanel, shell, Transferring
Cant see the Statistics module icon in the regular account editor.
For Parallels Plesk Sitebuilder for Linux/Unix
All modules icons are there except the statistics. What should I do to be able to access it?
Login to Sitebuilder Control Panel as admin and go to the Modules -> Statistics page.
To activate statistics reporting select check box Enable statistics located in the bottom left corner of the Statistics module screen.
Also, this module is available only for regular sites. It should be accessible in the left column at the Extra step. We need to add this module into an appropriate plan in the Plan Management section.
Reference: http://parallels.com/
Tags: Account, editor, icon, module, statistics