Friday, October 30, 2009

Force ASP.NET page to load using https

Today a customer reported that a site they made was hosted with GoDaddy and they had obtained a certificate.  Now the question was, how to make certain pages load only as secure.

Godaddy's suggestion involved a 301 redirect - thanks but no thanks.

We stumbled onto this page that simply answered the question.
If Not Request.IsSecureConnection Then
Response.Redirect("https://www.domain.com/yourpage.aspx")
End If

For a noob that would be - in every .aspx page you want to load using your new SSL Cert add the above line right after:

<script runat="server">

Sub Page_load()

Thursday, October 15, 2009

Oracle Enterprise Manager site on Server 2008 and Internet Explorer 8

After a successful install of Oracle 11g we proceeded to the Oracle Enterprise Management site hosted locally on the server.  Typically the site is https://FQDN:1158/em

Server 2008 comes with IE8 which throws two fits (1) about security (2) about certificate. Now for the fix:
Security
  1. Click on the link "Database Control" in the Oracle Program folder
  2. You are presented with "Click here" /  "Continue" options.
  3. Click "Continue to this website".
  4. You are presented with a blank page.
  5. Double-click Internet (globe in the bottom right).
  6. Click "Trusted Sites" / Sites / Add / Close / OK.
  7. Copy the URL at the top then close IE.
Certificate
    1. Right-Click on an IE Shortcut & click "Run as administrator"
    2. click in the address bar & paste the URL from above
    3. You are again presented with "Click here" /  "Continue" options
    4. Click "Continue to this website".
    5. Find the Red alert at the top and click on "Certificate Error"
    6. Click View Certificates
    7. Click the "Certification Path" tab
    8. Here you should see two certificates (one good & one with a red (x)).  Click on the top one.
    9. Click "View Certificate"
    10. Click "Install Certificate" / Next /
    11. Click  (X) Place all certificates / Browse / Trusted Root Certification Authorities / OK /
    12. Next / Finish / Yes / OK / OK / OK / Close the browser.
    13. Click on the link "Database Control" in the Oracle Program folder

    Google IMAP Outlook 2007 Send As

    Today our customer came to us with an interesting problem.  Google Hosted Apps and Gmail for that matter,  have the ability to "send as" another user.  When you use GOOGLE Mail as your center for all other email accounts, you may want to reply with the email they addressed.

    The solution is to set up an additional account in Outlook.

    Tuesday, October 13, 2009

    Windows Load Balancing Server 2003 and Server 2008

    1) Server 2003 - suggests two network adapaters one to listen and one to speak.

    2) Server 2008 - says you really only need one network adapater.  If you need two, you'll need to enable IP Forwarding (see below).

    from http://www.numtopia.com/terry/blog/archives/2008/10/windows_2008_nlb_with_2_nics.cfm

    I worked with our networking team, and they figured out (from this post: http://social.technet.microsoft.com/Forums/en-US/winserverClustering/thread/0afdb0fc-2adf-4864-b164-87e24451f875/ ) that if you added a gateway to the cluster NIC, it would work. This is counter to the way NLB has worked before, and generally not best practice. So we opened a support case with Microsoft. After a few tries, I finally got an engineer that was an expert on NLB in 2008, he had the exact cause and solution for this problem: by default IP Forwarding is not enable in Windows 2008. This is the feature of Windows networking that, in the context of NLB, allows responses to requests sent to one NIC to be routed out the other. It's fixed by using one specific command line option.

    (Make sure you are using a command prompt with administrative privlidges)

    netsh interface ipv4 set int "[name of the NIC]" forwarding=enabled

    3) Another option would be ISA or ARR appears to be able to load balance traffic for you.  when making a rule (with the newest service pack) it asks for a list of servers in a farm (as opposed to the single virtual IP).

    Accidentally removed a VMware server from inventory

    Issue:  In the every-day use of VMware and the vCenter a user accidentally clicked to "remove from inventory".

    Solution: After the panic subsided we discovered you can:
    1. Browse the datastore
    2. Open the folder for that server
    3. Right-click on the vmx file & select import into inventory

    Sunday, October 11, 2009

    ReBlog Beta 2.0 Unknown class passed as parameter

    One of our customers uses reBlog to filter through some RSS Feeds & then provide their own output.

    The version Godaddy Provides through their installable applications is one of the older ones & they wanted to try the beta 2.0.

    When they tried to view their RSS feed they saw:
    • unknown class passed as parameter ClientController.class.php line 740
    • Warning: Unknown class passed as parameter in /library/RF/ClientController.class.php on line 740
    We tried some different things with the .htaccess file but the easiest fix was to go to GoDaddy's Hosting Control Center, click Add-on Languages and change it from PHP 5.x to PHP 4.x.  They say it can take 24 hours but it took less than 5 minutes and the page refreshed without the error.

    Saturday, October 10, 2009

    SQL Server 2005 Mirroring Failover

    One of our customers uses SQL Server 2005 and mirrors a database between two locations.

    Twice now our customer has performed a manual failover using the following commands (run at the secondary/mirror location):

    • ALTER DATABASE (NAME) SET PARTNER OFF (breaks the mirror but still says recovering...)

    • RESTORE DATABASE (NAME) WITH RECOVERY (returns the DB to a usable state & removes the recovering... status)


    This evening we discovered a magical button that up to now had gone overlooked, FAILOVER.  Using this button you can immediately swap the roles between the mirror and the principal databases.

    SQL Server 2005 Failover Button

    Manage Linksys Wireless Access Point WAP54g

    It supposedly has an IP of 192.168.1.254 but I could never get it to play right.

    I reset it to factory & it changed the SSID back to Linksys.

    I reviewed the DHCP logs and even went so far as to perform a ping scan across they entire /24 to which it was attach & could not find an IP for it.

    Then I discovered you need the setup wizard to manage it, found on the CD.  Like 99% of other americans that cd is long gone.  I couldn't find the wizard on the Linksys support site until I just started clicking around.  This device is Version 3.1 (which isn't even an option on the support site).  I reviewed version 3.0 but only the firmware is available.

    Linksys Support Version 1

    Then I just thought to click on Version 1.0 - and saw the Linksys Setup Wizard right there for the taking! Unbelievable!

    Wednesday, October 7, 2009

    Install an Assembly into the GAC on Server 2008

    We all know that to add a file to the GAC on server 2003, you have to have two windows open.  You have to drag from one window containing the .dll into a second window at c:\windows\assembly.

    In 2008 it is a little more complicated but the same process.

    1.  Open a Command Prompt as Administrator (right click, Run As Administrator).
    2.  Run "explorer C:\windows\assembly".
    3.  Open a new explorer window from the window which just opened (Right click -> Open whilst holding Ctrl). I did this by hopping back up to C:\windows and the navigating to my assembly in the second (new) window.
    4.  Navigate in the first windows back to C:\windows\assembly.
    5.  Drag and drop between the two windows.

    Thank you MSDN SOCIAL