Helm's Technology Blog

Cpanel

Webmail not working in Cpanel

by admin on May.10, 2010, under Cpanel

Had a problem earlier this week, webmail couldn’t always send e-mail.  It was coming back with the following error:

SMTP Error: SMTP error: Connection failed: Failed to connect socket: Connection timed out.

After reading a few things  I turned on the SMTP tweak..  things appeared to work for a few hours, then it started failing again.

Searching online said to trying telnet on the command line – so did that, connected to port 25 – all fine… hmm odd – tried webmail again – failed…..

After a more indepth search I found a forum which gave me a hint – apparently other people have had the same problem when using the firewall for cpanel – CSF.  CSF is definately one of the best firewalls around for linux and works really well with Cpanel – however every now and again the amount of options can cause you to miss out something obvious:

# If SMTP_BLOCK is enabled but you want to allow local connections to port 25
# on the server (e.g. for webmail or web scripts) then enable this option to
# allow outgoing SMTP connections to 127.0.0.1
SMTP_ALLOWLOCAL = 0

The SMTP_ALLOWLOCAL set to 0 stops webmail etc… not sure when this appeared (the server has been working fine for about 4 months) but change it to 1 – restart CSF and there we go it’s working fine :)

Leave a Comment :, , , , , more...

Migrating Cpanel accounts to new Cpanel Server – by command line.

by admin on Mar.20, 2010, under Cpanel, Server

Cpanel is a good system for administrating a server with many sites on it, i’ve used ensim, webmin and a couple of others in years gone by (Plesk and parallels were disasters for me!).  However occasionally something that you think should work just doesn’t and for no obvious reason.

The Cpanel system has a feature to migrate accounts from another server – be it Cpanel or another webhosting panel – this often works, recently though I’ve had a problem with using it for Cpanel to Cpanel where it would connect but fail to transfer the backup file.

Fortunately it’s really easy to use the commandline with cpanel and you can do it manually (actually it’s easier than the wizard!)

On the server you are migrating from just type (while logged in as root!)

/scripts/pkgacct username

This will create a tar.gz in the /home directory on the server – just copy this to the new server (it could take a while – it has everything from the account you are copying).

On the destination server just type in

/scripts/restorepkg username

This creates (or overwrites the account!) on the server – and your done!.  But what if you have a dedicated IP (due to SSL?)

Easy just use this instead

/scripts/restorepkg –ip=y username

This gives it the next free dedicated IP address (make sure you have one free!)

And that’s it – it is honestly easier than the wizard which requires you to add more info to establish the transfer link.

One thing to note is that you should ensure that the versions of cpanel are as near as you can get – otherwise it might fail or do things a little weird.

2 Comments :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!