Monday, 28 April 2014

How to Fix Plesk Horde Webmail

Sometimes you may see horde webmain in Plesk windows showing page not found errors or not working properly during sending email via Webmail.  Here is the general fix for all the problems.

"%plesk_bin%websrvmng.exe" --reconfigure-webmail
"%plesk_bin%defpackagemng.exe" --fix --type=webmail.horde

Wednesday, 23 April 2014

Usefull cPanel / WHM hidden Commands

Ever locked yourself out of your Server while making some iptables changes?  What about when you change your SSH port and then forget what you set it to?
These are common support tickets we receive at RSHosting. In many cases this is something our customer’s can fix on their own if they are using cPanel on thier VPS/Server.



cPanel comes with a number of “hidden” autofix commands that allow for administrators to fix common problems simply be logging into WHM and going to a special URL. Two of the most useful ones I’ve seen are flushing iptables and restarting SSH in “safe mode” (basically the default settings and port).

Flushing iptables rules




https://yourdomain.com:2087/scripts2/doautofixer?autofix=iptablesflush




Restart SSH in safe mode




https://yourdomain.com:2087/scripts2/doautofixer?autofix=safesshrestart




Once you hit the URL you will be prompted to log in. Simply enter your root password and cPanel will do the rest. These have definitely saved me on more than one occasion when my attempt to ’secure’ my server worked a little too well.  Remember that if you happen to also lock yourself out of WHM through iptables, you will not be able to hit the URL’s I mentioned.  In that case, contact support.
Other useful commands as well:



Reset the Firewall Settings


https://yourdomain.com:2087/scripts2/doautofixer?autofix=iptablesflush




Reset the SSH Settings




https://yourdomain.com:2087/scripts2/doautofixer?autofix=safesshrestart




bsdbindfix




https://yourdomain.com:2087/scripts2/doautofixer?autofix=bsdbindfix




Autorepair




https://yourdomain.com:2087/scripts2/doautofixer?autofix=autorepair




Compress Zlib  




https://yourdomain.com:2087/scripts2/doautofixer?autofix=Compress-Zlib-1.42.tar.gz




Compresszlibfix




https://yourdomain.com:2087/scripts2/doautofixer?autofix=compresszlibfix




dbdmysql




https://yourdomain.com:2087/scripts2/doautofixer?autofix=dbdmysql




Cooldiagnose_apache_conf




https://yourdomain.com:2087/scripts2/doautofixer?autofix=diagnose_apache_conf




fpindexfile




https://yourdomain.com:2087/scripts2/doautofixer?autofix=fpindexfile




libxml2-2.6.28.tar.gz




https://yourdomain.com:2087/scripts2/doautofixer?autofix=libxml2-2.6.28.tar.gz




libxml64fix




https://yourdomain.com:2087/scripts2/doautofixer?autofix=libxml64fix




pro*




https://yourdomain.com:2087/scripts2/doautofixer?autofix=pro*




spamd_dbm_fix




https://yourdomain.com:2087/scripts2/doautofixer?autofix=spamd_dbm_fix




test




https://yourdomain.com:2087/scripts2/doautofixer?autofix=test




vfilterfix




https://yourdomain.com:2087/scripts2/doautofixer?autofix=vfilterfix




yumduprpmfix




https://yourdomain.com:2087/scripts2/doautofixer?autofix=yumduprpmfix




resellerresourceacctounts




https://yourdomain.com:2087/scripts2/doautofixer?autofix=resellerresourceacctounts




horde_sqmail_current_fix




https://yourdomain.com:2087/scripts2/doautofixer?autofix=horde_sqmail_current_fix


Tuesday, 15 April 2014


  • Download all emails under the account to be migrated using a mail client like outlook express




  • Download files backup & database backup of addon domain(or subdomain or main domain) with the help of a developer




  • Delete addon domain(or subdomain or main domain) from Cpanel or Reseller WHM




  • Recreate the domain as main domain(or addon domain or subdomain)




  • Recreate all email accounts in new addon domain(or subdomain or main domain). Please note that emails cannot be migrated to new account & it will remain in mail clients like outlook express




  • Upload all files to new main domain(or addon domain or subdomain) using FTP




  • Recreate databases in new main domain(or addon domain or subdomain)




  • Restore databases either using phpMyAdmin




  • Modify configuration files in the website to reflect new database names & user names




  • Check websites & ensure that it is working fine under new main domain(or addon domain or subdomain)



 

Friday, 4 April 2014

DNS Troubleshooting

 Safe to say that a majority of problems in any virtual hosting system will be related to DNS, because DNS requires cooperation of numerous systems, rather than single one, and DNS problems can cause trouble to nearly every service on a hosting system.



For DNS to work, must have correct glue records at your registrar, as well as correct records on your Virtualmin system (or whatever system you choose to use for DNS, if not the Virtualmin server). Also, any slaves must also have correct records, or you will experience intermittent resolution failures.



Glue Records



Checking your glue records can be done using the whois command.




whois example.com




Look for the "domain servers" or "name servers" section of the output. The resulting names must resolve to your DNS servers.



Glue records must be configured at your name service registrar. Virtualmin and Webmin have no control over records at your registrar, so problems must be corrected using whatever interface your registrar provides.



NS Records



The NS records on your Virtualmin server should match those found in the glue records discussed previously, or intermittent problems may result.



You can find the NS records for a given zone using the host command on your server:




host -t NS example.com




A Records Address records, or A records, are the basic building block of DNS zones. They map names to IP addresses. To check an A record, use the host command:




host example.com




You can also specify the name server used to resolve queries by adding the name or IP of the server you wish to query to the end of the command:




host example.com ns1.example.com




Or, if you aren't sure about the nameserver IP address resolving correctly, you can use an IP:




host example.com 192.168.10.10




MX Records



Mail exchanger records, or MX records, provide mail servers the information they need to know how to deliver mail for a particular domain.



You can check an MX record with the host command:




host -t MX example.com


Friday, 28 March 2014

symlink security issue - cPanel

cPanel symlink exploit



There is a serious security hole in the way that Apache handles symlinks on servers.

This allows an exploited account on a server to view .php files owned by other accounts, thus a single-account potentially exploits many accounts on the server.

The exploit, in general terms, is to create a symbolic link file (eg public_html/fred.txt) pointing to a wp-config.php file (eg /home/otheracct/public_html/wp-config.php) which contains database user and password which will occasionally be the cpanel username/password. The file is then readable via a web browser. If the user has been unwise enough to use their cpanel username/password for the database.

This script will find if there is any symlinks in the users home directory and save the output to /root/symlinks.txt

root@server1 [~]# find /home//public_html -type l >> /root/symlinks.txt

Solution :-

Rack911 has published an easyapache patch which adds the file /scripts/before-apache-make to force SymLinksIfOwnerMatch to be always on.

root@server1 [~]# wget http://layer1.rack911.com/before_apache_make -O /scripts/before_apache_make
root@server1 [~]# chmod 700 /scripts/before_apache_make


Rebuild apache after.
root@server1 [~]# /scripts/easyapache

Enable Symlink Race Condition Protection from Exhaustive Options list during the EasyApache build process.

Wednesday, 26 March 2014

Error unable to activate deactivate domain - Plesk

Error unable to activate deactivate domain


ERROR: Internal Plesk error occurred: Unable to activate/deactivate domain: Domain Mgmt backend failed: domainmng: /usr/lib/plesk-9.0/mailmng_domain_toggle execution failed: ERROR: Unable to remove record from virtualdomains file System error 2: No such file or directory domainmng: Error while turn off mail service on domain domain.com

OR

Error: Unable to activate/deactivate domain: Execute usermng access off failed: Change access failed of user (bsb): (2221) The user name could not be found.

Solution is need to disable the user account
Follow these steps:

1) You can disable the Plesk domain user by login to your Windows server.
2) Login to the server through RDP
3) Go to Computer management - users
4) Right Click on the user which is to be disabled.
5) Click on properties.
6) Tick the Box Account is disabled.
7) After that you activate or deactivate the domain.
8) If your process is success then again go to user and uncheck the box Account is disabled.


The topic on Whm-cpanel - Error unable to activate deactivate domain is posted by - Math

Hope you have enjoyed, Whm-cpanel - Error unable to activate deactivate domainThanks for your time

Tuesday, 25 March 2014

How to monitor and Deal with Spamming



It is difficult to track nobody spammers from exim_mainlog file. You can’t get exactly that who is using your server to send spams. If you check php.ini file you will see that the mail service is set to /usr/sbin/sendmail and almost all mail scripts are in use the built in mail(); function for PHP.It means that everything is going through /usr/sbin/sendmail.

We will try to get these users in your Linux Servers.

1. Login to server as root.

2. For safe side turn off exim.

[root@server~]#/etc/init.d/exim stop

3. Backup /usr/sbin/sendmail file. [Your server is using Exim as MTA (Mail Transfer Agent), Exim will use sendfile for just a pointer actually].

[root@server~]#mv /usr/sbin/sendmail /usr/sbin/sendmail.hidden

4. Now we will create a spam monitoring script for the new sendmail programme.

[root@server~]#pico /usr/sbin/sendmail

Paste in the following:

#!/usr/local/bin/perl
# use strict;
use Env;
my $date = `date`;
chomp $date;
open (INFO, “>>/var/log/spam_log”) || die “Failed to open file ::$!”;
my $uid = $>;
my @info = getpwuid($uid);
if($REMOTE_ADDR) {
print INFO “$date – $REMOTE_ADDR ran $SCRIPT_NAME at $SERVER_NAME n”;
}
else {
print INFO “$date – $PWD – @infon”;
}
my $mailprog = ‘/usr/sbin/sendmail.hidden’;
foreach (@ARGV) {
$arg=”$arg” . ” $_”;
}
open (MAIL,”|$mailprog $arg”) || die “cannot open $mailprog: $!n”;
while (<STDIN> ) {
print MAIL;
}
close (INFO);
close (MAIL);

5. Change the permissions new sendmail.

[root@server~]#chmod +x /usr/sbin/sendmail

6. New log file to save history which using web mail scripts.

[root@server~]#touch /var/log/spam_log

[root@server~]#chmod 0777 /var/log/spam_log

7. Start Exim.

[root@server~]#/etc/init.d/exim start

8. Now try any formmail script or any mail script which uses mail function and monitor new log file (spam_log)

[root@server~]#tail – f /var/log/spam_log

It should give us output like this:

Mon Nov 15 11:00:00 EST 2008 – /home/username/public_html/directory/subdirectory/subsubdirectory – nobody x 99 99 Nobody / /sbin/nologin

9. Log Rotation: This file is not set to be rotated file so there is a possibility that the file comes very large soon in size. So do this,

[root@server~]#pico /etc/logrotate.conf

Find >>

# no packages own wtmp — we’ll rotate them here

/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}

Add >>

# SPAM LOG rotation

/var/log/spam_log {
monthly
create 0777 root root
rotate 1
}

10. We will set attributes for new sendmail programme file so it will not get overwritten.

[root@server~]#chattr + i /usr/sbin/sendmail

Now we can get nobody spam users, Goodluck.