Pages

Saturday, September 17, 2016

cPanel performance tweaks, Memory Consumption

Every cpanel server should be need to optimize according to your server usages, I hope the following articles will help to improve your cpanel server performance.

Run your cron jobs at off peak hours.

Stopping SpamAssassin

Go to WHM > Server Configuration > Tweak Settings > Disable Spamd

And:

Go to WHM > Service Manager > Disable Spamd

Disable Anonymous FTP

Remove virtfs and Disable for users

VirtFS provides a jailed shell environment for users who connect to a server via SSH. The jailed shell acts as a container for the user, and does not allow the user to access other users’ home directories on the server. Unlike a normal shell environment, a jailed shell environment prevents access to data outside of the user’s home directory.

Consuming lot of disk space ?

Most of server got large disk space due to this virtfs. You can Disable VirtFS,Remove VirtFS and Unmount the bind mounts. CPanel provides a script to remove the virtfs mounts. Remove virtfs and Disable for users in your cpanel server

Do not delete /home/virtfs/username folder directly because its hard link with user account.

cPanel FTP Connection issues

Here we have few steps to verify cpanel FTP connection related issues in your server. Most of problems will happen in your IPTABLES or CSF firewall settings. Any way first you should check your FTP is running fine.

Use the following command in your cpanel server to check FTP is listen.

root@server1 [~]# ftp localhost

If the response is as follows, the issue may be related to configuration of your Firewall.

Trying ::1...

How to Replace MySQL with MariaDB

 Backup existing MySQL data

Make sure to save all existing data just in case there are any issues.

    cp -Rf /var/lib/mysql /var/lib/mysql-old
    mv /etc/my.cnf /etc/my.cnf-old

Disable the targets so cPanel no longer handles MySQL updates

The following will mark the versions of MySQL we distribute as uninstalled so they are no longer maintained by cPanel/WHM

    /scripts/update_local_rpm_versions –edit target_settings.MySQL50 uninstalled
    /scripts/update_local_rpm_versions –edit target_settings.MySQL51 uninstalled
    /scripts/update_local_rpm_versions –edit target_settings.MySQL55 uninstalled

Remove existing MySQL RPM’s so theres a clean slate for MariaDB

The below command will uninstall the MySQL RPM’s!

Tuesday, March 22, 2016

Setting up emails to forward and delete automatically

The developers at cPanel removed the aging option in the latest version. However, you actually don’t need to have the email address setup in Mail > Add/Remove/Manage Accounts.

For example, let’s say you want any emails that goes to sales@yourdomain.com to forward to you@gmail.com. You don’t have to set up sales@yourdomain.com in Mail > Add/Remove/Manage Accounts.

Just go into cPanel > Mail > Forwarders > Add Forwarder.

In the first box you would enter ‘sales’ and then you would select the correct domain (if you have more than one domain set up). In the second box you enter you@gmail.com.

Now, when someone emails sales@yourdomain.com, the email will be forwarded to you@gmail.com. This way, nothing will be sitting on the server taking up space and you won’t have to worry about cleaning up old emails.

Sunday, January 3, 2016

unable to check htaccess file

Permission denied: /home/USERNAME/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

for fix, follow the procedure below:

cd ~USERNAME

chmod a+rx public_html
 
Enjoy!

cPanel force remove an ip address

If you want to remove an ip address in cPanel, and sometimes the remove button is not there, just edit the file /etc/ips, remove the ip address in question, and then do a restart of the system aliases.

/etc/rc.d/init.d/ipaliases restart

This will work on cPanel / linux/centos

Should save you some headaches.

Enjoy!

Previous value removed by cPanel transfer auto-merge

So i have been doing a hardware upgrade, and during the migration of the accounts, the target server named zone files got polluted with stuff like this:

( ; Previous value removed by cPanel restore auto-merge on 20151223145307 GMT
; 2015112200 ;Serial Number ; Previous value removed by cPanel restore auto-merge on 20151223145307 GMT
; 43200 ;refresh ; Previous value removed by cPanel restore auto-merge on 20151223145307 GMT
; 7200 ;retry ; Previous value removed by cPanel restore auto-merge on 20151223145307 GMT
; 2419200 ;expire ; Previous value removed by cPanel restore auto-merge on 20151223145307 GMT
; 86400 ;minimum ; Previous value removed by cPanel restore auto-merge on 20151223145307 GMT
; ) ; Previous value removed by cPanel restore auto-merge on 20151223145307 GMT



In order to clean things up, you can do something like this:

1 –  backup your named folder : cd /var;tar czf named.tgz named

2 – cd /var/named

perl -i.bak -ne ‘next if (/^; .+ ; Previous value removed by cPanel transfer auto-merge on/); print;’ /var/named/*.db

/scripts/restartsrv_named

/scripts/restartsrv_named