Set the max pop3 connections simutaneously for one ip

If you have more than 4 email accounts on a single domain, it’s very common you won’t be able to retrieve email from all of your accounts. By default, many servers have a MAXPERIP=4 setting in the pop3d file on the server. If you are having this problem, go to the /etc/courier-imap/ directory and vi the pop3d file. Find the line that reads MAXPERIP=4 and edit that line to read MAXPERIP=40. Escape out and :wq the edit.

Next restart the service with: /etc/init.d/courier-imap restart

Problem of too many simulataneous email connections should now be solved.

How To Get A Random Image On Your Page Using CSS or PHP

We have some websites where we would like to have a different, random header image on various pages and maybe even various random images in different areas of the website.

We found this bit of code that worked great, although it doesn’t use CSS, but a simple bit of PHP code. Here it is:

<img src=”http://www.yoursite.com/directory-for-your-header-images/header_<?php echo(rand(1,5)); ?>.jpg”

width=”1024″ height=”300″ alt=”automotive tools and power tools” />

Of course, you’re going to enter all your own data and variables, but surely you get the picture.

It’s that simple, place that code wherever you want your random image and there you go.

Change File / Folder Owner With SSH

After doing a transfer of files for a website using SSH, if you’ve transferred from one domain to another, you’ll probably run into a file or folder ownership problem. Using SSH, this is actually easy to fix.

Log in to your server using SSH

Change to the directory you need to change permissions or ownership.

chown -R correctuser *

correctuser is the name of the owner of this website

That’s it. You’ve now changed the owner of files and folders in that directory using SSH.

Another Way to Move Website Via SSH

Very recently, we published an article about moving entire website from one server to another via SSH. Sometimes those commands give us problems with the resulting transfer, so we found this alternate method that seems to work perfectly.

Keep in mind, you MUST perform separate actions for copying or moving databases as well as adding email addresses.

1. First log in to your old server via SSH. If necessary, you may need to login as a “super user”.

2. Change directories to the directory where your website resides.

3. Type in the following code:

4. tar -cpzf backup.tar.gz *

6. This creates a tar file of all files in that directory.

7. Login to your new server.

8. Navigate to the directory where you want to place the website you are moving.

7. Type in:

8. wget yourdomain.com/backup.tar.gz

9. (Of course, yourdomain.com is replaced with your actual domain name). This transfers the tar file from the old server to the new server.

10. Once the file is transfered, type:

10. tar -xzf backup.tar.gz

11. This will unpack the tar file onto the new server in the directory that you placed it.

That’s it, another way to move websites using SSH.