PLESK – IMAP connection closed by remote host

January 25th, 2012 by admin No comments »

Had an odd issue where several computers, all macs, where located behind a router with a common IP. One of the systems could connect to the imap server, but none of the others could. After checking all the settings, and finding they where the same we proceeded to test from outside their network. All attempts to telnet worked.

After a bit of research i found the following:

  1. Mac Mail is like thunderbird, 1 imap connection uses several connections per machine.
  2. By Default, on plesk courier-imap max connections per IP is set to 4
  3. Looks like 1 mac mail client uses 4 or more connections

So to resolve the issue the following had to be done:

Edit the /etc/courier-imap/imapd file and modify the following values

MAXPERIP to 50)

Next, to enable multiple systems and connections at the same time, and not just from a single IP i also increased (in the same file)

MAXDAEMONS to 300

This would enable up to 300 concurrent connections to imap, with up to 50 from a single IP source. (you can use any values you wish for both)

Once complete i then restarted imap

/etc/init.d/courier-imap stop
/etc/init.d/courier-imap start

PHP/HTTP max upload error

November 18th, 2011 by admin No comments »

There are several reasons that you cannot upload a file with a script. The following are 2 possible reasons.

The first, simple enough, is the file size is too large. To fix this just modify the “upload_max_filesize” modifier in php.ini. To determine the location of the php.ini being used by that domain quickly create a phpinfo() page. (simple page with ) this will display the information.

note: remove this file afterwards as it gives information on your server and can be considered a security risk

The other possible reason, and you need to look at your error logs to verify this is if you are getting a similar error message to this:

 mod_fcgid: HTTP request length 138361 (so far) exceeds MaxRequestLen (131072), referer:

or something similar.

This indicates that the apache configuration needs a little tweaking.

do a quick search for the file: fcgid.conf
modify it by adding the following line

FcgidMaxRequestLen 200000000

This sets the limit to 200MB.
Example file would look like:

<IfModule mod_fcgid.c>

<IfModule !mod_fastcgi.c>
    AddHandler fcgid-script fcg fcgi fpl
</IfModule>

  FcgidIPCDir /var/run/mod_fcgid/sock
  FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm

  FcgidIdleTimeout 40
  FcgidProcessLifeTime 30
  FcgidMaxProcesses 20
  FcgidMaxProcessesPerClass 8
  FcgidMinProcessesPerClass 0
  FcgidMaxRequestLen 200000000
  FcgidConnectTimeout 30
  FcgidIOTimeout 45
  FcgidInitialEnv RAILS_ENV production
  FcgidIdleScanInterval 10

</IfModule>

Colorbox Modal – Not working with IE

October 13th, 2011 by admin No comments »

I was trying to get colorbox jquery modal working with IE and was running into an issue where the inline modal acted as a float:top. The solution was to add the following at the top of your document.

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Once added the colorbox add-on worked beautifully and was able to work with it from there.

Search for music with google

September 26th, 2011 by admin No comments »

Sometime you want to find a new source of music, but can’t use for various reasons one of the popular torrent sites.

Here is a search string for google that will help you find new music:

 intitle:"index of" +"last modified" +"parent directory"
 +description +size +(wma|mp3) SongAuthor "name of song"

Replace SongAuthor with the name of the band/Artist and replace “name of song” with the song you are searching for. Also works for albums.

Fortigate – command line reset and quick setup guide

September 22nd, 2011 by admin No comments »

How to reset a fortigate to factory default. These instructions are for the fortigate 60,but should work for most models.

Attach the fortigate by serial cable to your computer and then restart it. When the login screen re-appears type the following:

Login: maintainer
password: bcpbFGT-XXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXX is the serial number of the fortigate. Ie if the serial was 603902365245 the password would be bcpbFGT-603902365245.

Once logged in, to reset the firewall type

execute factoryreset

Once complete and rebooted the fortigate will be reset to factory defaults. For further instructions use this quick guide:

http://www.andovercg.com/datasheets/fortinet-fortigate-60.pdf