Archive for the ‘ Web ’ Category

Nagios CHECK_HTTP Error HTTP WARNING: HTTP/1.1 403 Forbidden

So, I was deploying a new server and added the default CHECK_HTTP Nagios plug-in as follows:

define service{
use <Preset Service Type>
host_name <Server Name>
service_description HTTP
check_command check_http
}

However, the check would come back as an 403 Forbidden error. I know we have some restrictions set on our http.conf to allow only internal IP addresses to the Apache server, but the Nagios server is in the internal network. Poked around the settings and configurations for awhile and could not see any issues as I was able to browse the default Apache page.

Looked a bit more and found that the CHECK_HTTP is actually looking for an index page in the root html location. So I ended up creating a dummy page for Nagios and the checks came back fine! I’m sure you could make something nicer but this is all I did in the /var/www/html directory:

echo "This is a dummy page for <Server Name>." >> index.html

Works like a charm!

CDONTS on Windows Server 2008 R2

As old as it may be, we still use a sendmail API from way back to NT4! Having said that, there was a slight blip when we migrated to a new Server 2008 R2 server, the dll file was missing! I had to copy the file from the old server and move it to the new server.

  1. Copy CDONTS.dll from another server to C:\Windows\SysWOW64 and C:\Windows\System32
  2. Run regsvr32 c:\windows\SysWOW64\cdonts.dll
  3. Run regsvr32 c:\windows\System32\cdonts.dll
  4. Grant the appropriate permissions on C:\inetpub\mailroot\pickup (I granted USERS group Modify permissions). You could get permission denied if the folder security isn’t adjusted.

You don’t need to restart the server at all, just hit your site and again it will work!

Google Chrome’s automatic site searching

Here’s a fun tip! I just found out today by chance that Google’s Chrome browser will do automatic site searching! If the site you are viewing has a search functionality, all you have to do is type the domain.com follow it by a space and the item you want to search! It will automatically direct you to the search function with your search in the query string! Neat!

For example:

shopbot.ca core i5

pointed me directly to:

http://www.shopbot.ca/m/?m=core+i5

Neat little trick… once again, hope this helps and have fun!

Google Apps and Microsoft Outlook 2010

With the need to save money, I finally decided to take the plunge and try out Google Apps after a strong recommendation from a friend. Getting everything converted was simple enough, I just had to sign up for a Google Apps account, add my domain and away I go.

For those interested, when you search for Google Apps, Google will always bring you by default to their Google Apps for Business edition first. It is a bit of a maze to find the standard Google Apps, but it is there.

The main difference between the two is that you get 7GB of space instead of 25GB. Other minor stuff include Google Video, forced SSL and 99.9% uptime SLA. For that, you have to pay $50 per user per year. This is as opposed to getting 50 free users for your domain, not including any aliases you would like to use (known as nicknames in Google Apps). Another stated difference is that you are unable to sync with Microsoft Outlook and Blackberry Phones etc. This, however, I have been able to prove to be incorrect.

I have been able to sync up my Outlook and Blackberry through IMAP. True, it is not exactly like Exchange and you lose certain functionality – such as notes and journal. However, I would like to argue that overall, for someone or a company with less than 50 users, Google Apps is more than enough.

One thing to note though, the setup instructions that are available on Google’s site is incorrect. The following IMAP settings worked for me:

Username: user@yourdomain.com
Password: your password
IMAP: imap.googlemail.com
IMAP Port: 993
Encryption: SSL
SMTP: smtp.googlemail.com
SMTP Port: 587
Encryption: TLS

One other thing that I did do was to Unlock Captcha. Not sure if it is related, but I did this before I found the above settings so I can not comment if it was either due to the settings or both changes were required.

I will give this a go for a week or two before I fully terminate my old Exchange account. As always… hope this helps and remember to have fun!

New theme

Haven’t posted in awhile, but I needed to find a new theme which will allow for posting code. If anyone knows of any, feel free to let me know. I’ll just test around here.

<?
function slotnumber()
{
  srand(time());
    for ($i=0; $i < 3; $i++)
    {
      $random = (rand()%3);
      $slot[] = $random;
    }
  print("<td width="33%"><center>$slot[0]</td>");
  print("<td width="33%"><center>$slot[1]</td>");
  print("<td width="33%"><center>$slot[2]</td>");
    if($slot[0] == $slot[1] && $slot[0] == $slot[2])
    {
      print("</td></tr>Winner! -- Hit refresh on your browser to play again");
      exit;
    }
}
?>

<div align="center"><center>
<table border="1" width="50%">
<tr>

<?
slotnumber();
?>

</td></tr><tr>
<td width="100%" colspan="3" bgcolor="#008080">
<form method="POST" action="example13.php3">
<div align="center"><center><p><input type="submit" value="Spin!">
</p></center></div>
</form>
</td></tr>
</table></center></div>