Monday, May 26, 2014

Email accounts are not showing after migration in cPanel

1. Login destination server, verify the permissions of mail related folders

2. Permission of /home/user/mail  751 and ownership is user.user

You can correct the permission using the command
sudo chown -R user.user /home/user/mail
sudo chmod 751 /home/user/mail/

3. Check the permission of /home/user/etc where it contains passwords of email accounts.
 Permission of /home/user/etc  750 and ownership is user.mail
You can correct the permission using the command
sudo chown -R user.mail /home/user/etc
sudo chmod 750 /home/user/etc

4. You can also correct the mail permission using sudo /scripts/mailperm --verbose username
If the email accounts are still not showing in Cpanel

Check the size of passwd file under /home/user/etc , If it is zero size file, try to copy the files from source server.
If the size of passwd file is zero in source server, then we need to create the mail account with a password manually. Then the password entry will appear under /home/user/etc .

Create mail account with Cpanel script
sudo /scripts/addpop emailaccount passowrd size
sudo /scripts/addpop  test@test.com qwedsa@123 1024

This time, Mail accounts will show in Cpanel for sure. :-)

Sunday, March 2, 2014

MySQL databases not showing in cPanel

When I checked Cpanel to check the database details after I created a database via shell, It was shown only a message "No databases found" .

The issue is the database is not mapped to Cpanel.

It was resolved by rebuilding the DB map using the command  

/usr/local/cpanel/bin/setupdbmap

 The Output of the command :

root@abc [~]# /usr/local/cpanel/bin/setupdbmap
info [setupdbmap] Begin setupdbmap
info [setupdbmap] Updating MySQL users
info [setupdbmap] Processing MySQL databases and database users ...
Adding database testabc_database ownership to testabc
Saving MySQL DB mapping for testabc
info [setupdbmap] Finished with MySQL users
info [setupdbmap] Failed to determine PostgreSQL version from server.
info [setupdbmap] End setupdbmap
info [setupdbmap] Storing Database Index
info [setupdbmap] Database Index Complete

Then the database testabc_database has showed in Cpanel > Mysql Datbases.

 Thus the issue resolved :) !!

Saturday, November 19, 2011

Error: no secure shell available plesk 10

Issue caused because psa got corrupted, so try repair the psa.

Repair the psa by following command.
"/usr/local/psa/bootstrapper/pp10.10.1-bootstrapper/bootstrapper.sh repair".

Change the location of MySQL , vhosts , qmail to /home in plesk

1) Stop Plesk and all services.

2) Change HTTPD_VHOSTS_D in psa.conf, for example /var/www/vhosts -> /home/httpd/vhosts.

3) Move vhosts to new location, for example /var/www/vhosts to /home/httpd/vhosts.

4) Create symlink:
ln -s /home/httpd/vhosts /var/www/vhosts

5. start httpd

6. Reconfigure Apache configuration with new path:

~# /usr/local/psa/admin/sbin/websrvmng -a -v
==================================================
How to change location of mail maildirs

Friday, November 11, 2011

how to disable php safe mode

how to disable php safe mode

Solution: turn off safe mode by modifying your httpd.conf file:
1. find your vhost entry
2. add to that vhost entry: php_admin_flag safe_mode Off

How to Disable Statistics for a Certain User via WHM

You can disable a stats program for a specific user by following the steps below via your WHM:

1. Login to WHM then go to Main >> Server Configuration >> Statistics Software Configuration

2. Under User Permissions click "Choose Users."

3. On the next page that loads, after "Choose Specific Stats Programs for" enter the desired username then click "Configure."

4. The following page will allow you to select the stats programs that the user may use; to finalize and submit changes click "Save."

Monday, November 7, 2011

Add SPF records to all domains in Plesk

To add SPF records to every domain in Plesk, you can use this huge one-liner:

mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "select dns_zone_id,displayHost from dns_recs GROUP BY dns_zone_id ORDER BY dns_zone_id ASC;" | awk '{print "INSERT INTO dns_recs (type,host,val,time_stamp,dns_zone_id,displayHost,displayVal) VALUES ('\''TXT'\'','\''"$2"'\'','\''v=spf1 a mx ~all'\'',NOW(),"$1",'\''"$2"'\'','\''v=spf1 a mx ~all'\'');"}' | mysql -u admin -p`cat /etc/psa/.psa.shadow` psa

Then you'll need to make Plesk write these changes to the zone files:

# mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e 'select name from domains' | awk '{print "/usr/local/psa/admin/sbin/dnsmng update " $1 }' | sh

You can check your work by viewing the new entries you made:

mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "SELECT * FROM dns_recs WHERE type='TXT';"