Saturday, August 28, 2010

Apache reverse proxying for port 80 and SSL

Here is a sample working configuration I setup for one of our sites, you want to use Apache Reverse proxying or some type of reverse proxying anytime you are using multiple types of technology since it prevents you from having to use sub domains. Using this technique is better also because you can use cookies to pass to other applications for things such as single signon, plus you give the users a better experience as everything appears to come from one website. Performance is also another benefit you get since the reverse proxying does provide some level of caching for you.

Another big benefit is SEO (Search Engine Optimization) since you will have more pages indexed under this configuration than if you used subdomains.

The only downside of course, is increased complexity, but if you are running multiple web applications for your company, you are increasing complexity away, so you might as well do it properly.

Here is a sample config, with some descriptions. We have an e-Commerce server (Tradepoint) but will also be using Dotnetnuke and wordpress as well, with the configuration below we end up dealing with SSL Reverse proxying (You do need to put the SSL Cert on the apache box and then use SSLProxyEngine On) to forward the SSL proxy requests to the servers in the back. As well the servers in the back already have SSL turned on.

I also setup a static hosts file on the Proxy server so that you can point back to the back e-commerce. So in this examples the dns entry for every other machine will be 00040.ooolalashop.com that might point to 192.168.100.2 (apache) but on the proxy server, I point ooo40.ooolalashp.com to 192.168.100.3 (ecommerce).





<VirtualHost *:80>
ServerAdmin support@cometcomputing.com
ServerName ooo40.ooolalashop.com
DocumentRoot /var/www/ooo
ErrorLog /var/log/apache2/ooolalashop-error.log
CustomLog /var/log/apache2/ooolalashop-access.log combined
RewriteEngine On
ProxyTimeout 3600
ProxyRequests off
ProxyPreserveHost off
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
#Allow from .example.com
</Proxy>

ProxyPass /dnn http://ooo40dnn.ooolalashop.com/dnn
ProxyPassReverse /dnn http://ooo40dnn.ooolalashop.com/dnn

ProxyPass /blogs http://ooo40wp.ooolalashop.com:83/
ProxyPassReverse /blogs http://ooo40wp.ooolalashop.com:83/

ProxyPass /forums http://ooo40wp.ooolalashop.com:83/
ProxyPassReverse /forums http://ooo40wp.ooolalashop.com:83/

ProxyPass /affiliates http://ooo40wp.ooolalashop.com:83/
ProxyPassReverse /affiliates http://ooo40wp.ooolalashop.com:83/

ProxyPass / http://ooo40.ooolalashop.com/
ProxyPassReverse / http://ooo40.ooolalashop.com/

RequestHeader unset Accept-Encoding


RewriteRule /blogs$ /blogs/ [R]

ProxyHTMLURLMap http://ooo40wp.ooolalashop.com:83 /blogs
<Location /blogs>
SetOutputFilter proxy-html
ProxyPassReverse /
ProxyHTMLURLMap / /blogs/
RequestHeader unset Accept-Encoding
</Location>
<Location /blogs/>
SetOutputFilter proxy-html
ProxyPassReverse /
ProxyHTMLURLMap / /blogs/
RequestHeader unset Accept-Encoding
</Location>

ProxyHTMLURLMap http://ooo40dnn.ooolalashop.com/dnn /dnn
<Location /dnn/>
SetOutputFilter proxy-html
ProxyPassReverse /dnn
ProxyHTMLURLMap /dnn /dnn/
RequestHeader unset Accept-Encoding
</Location>
<Location /dnn>
SetOutputFilter proxy-html
ProxyPassReverse /dnn
ProxyHTMLURLMap /dnn /dnn/
RequestHeader unset Accept-Encoding
</Location>

</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key

SSLProxyEngine on
ProxyPass / https://ooo40.ooolalashop.com/
ProxyPassReverse / https://ooo40.ooolalashop.com/
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
#Allow from .example.com
</Proxy>
</VirtualHost>







Sunday, January 17, 2010

Windows 7 - Microsoft Redeemed welcome back!

I've been meaning to write this post for about 6 months going through my old Blog Topics I see this is one I haven't written about.

So the great thing I can say about Windows 7, is that it's not Windows Vista or Windows XP. I have been using the OS for close to a year now since the Beta and have been very happy with it.

It is definitely more stable than Vista or XP, and performance wise it is definitely 100x better. Mind you, I have been running 64bit for the last 5 years and as a developer, it was extremely frustrating because I went from Windows XP 32 bit to Windows XP 64Bit to Windows Vista 64Bit - BACK to Windows XP 32 bit.

The main reason? Drivers and compatibility of applications. It was during this time I bought my first Mac (2008) and since then, I have only been running XP in a virtual machine environment. Needless to say, I started working on more open source projects at this time, and it really wasn't till early 2009 that I started looking at Windows 7. (We even ditched our Microsoft Gold Partner status because Vista was so bad and things weren't looking that great).

A few factors with Vista that were extremely frustrating, the user interface and that f**cken UAC pop up drive you crazy. Also there was there was the issue where you Vista and the pre-fetch would peg your CPU - at the time I had the fastest computer and it still ran slow.


However, Windows 7 has really saved Microsoft I believe, because now everything I want my computer to do I can do. I am almost tempted (but I probably won't) to turn my Mac Pro into a Windows 7 machine. Also the processors and equipment are also much faster now so I am sure it helps, I haven't tried running Windows 7 on anything that slow but I would be curious to see if it does run well on older equipment.

Windows 7 was so good in fact I got my first Dell R5400 Rack mount workstation with PC over IP (which I use everyday and using to write this post - PC over IP rocks! Check out Teradici and EVGA that sells their product). My workstation is a Dual Quad Xeon 5405 2.0 GHz with 16 Gigs of Ram and it is very delightful to program and develop on this. Can't wait to test out my Teraflop GPU from Nvidia, the Tesla C1060. We will be using this to do computational intensive operations. (Tip btw, you can't remote desktop to windows and use the Telsa the drivers don't load WTF!! - Used Ultra Vnc to get around this, you can't RDP)

So in closing, thank you Microsoft, for bringing Windows 7 to us, it's a success. I have sold more PC's running Windows 7 in the last 4 months than we have the last 3 years!


Visual Studio Team Foundation Server 2008 - Pain in the Ass install

Wow, on my 20th try I finally go it, but not without wasting about 2 days worth of time. This install ranks up there in terms of difficulty and frustration and the only reason it's worth it probably because it's better than VSS. If I couldn't get it today I would have went to CVS or Subversion (maybe I still will).

So what to look out for? Well here are my specs:

SQL Server 2008
Windows Server 2003 with SP2, .NET Framework 3.5 SP1, IIS

I also use vSphere 4.0, so my visual studio team foundation server with WSS is inside a virtual machine. So here is the first step

1) Install SQL Server 2008 Enterprise with Reporting Services and SP1
2) Take a Snapshot of the VM so you can roll back to this point
3) Configure your SQL Server Reporting Services with the Database server. In the documentation it tells you not to, but if I don't do it the install fails.


Right off the bat, make sure you prepare and get the slipstream install for SP1. If you don't you'll get tons of errors (you do even if you do this).

So the first step in creating the slip stream install is to download the service pack and then download the documentation. After you download this documentation, go to the section "How to: Integrate the Installation of Team Foundation Server and Service Pack 1" and follow those steps.

If you get the stupid errors "the source file doesn't exist" for the

\{source}\AT\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Services\bin\Plugins
\{source}\AT\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\VersionControl
\{source}\AT\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Warehouse

Just copy them to the directory where you are slipstreaming the install and then click ignore on the files. I think the problem is because the file names are TOO long, which causes the slip stream process to not be able to recognize the file locations.

After the slip stream files have been copied over, make sure you don't install off of a network drive, as you WILL run into the problem where the file names are too long. Instead, copy the install files to the local computer or make an ISO so the path name is not too long. In my case, I just made a directory c:\v and copied the slip stream files over.

After this, I ran and the install was complete. I ran all of the other parts and there were no problems. Sharepoint gets installed automatically which was nice, but was a pain in the Ass for an install. Microsoft should definitely document this better it like getting my teeth pulled.

Tuesday, January 12, 2010

Must haves for any Computer User - Dropbox and Xobni

So it's been a while since I have blogged, I will definitely be doing it more this year, but I've been using twitter quite a bit so i've kind of neglected my tech blog. SORRY!

So some new additions to my arsenal of must haves. Very rarely do I come across software that is like "crackware" which means once you use it, you gotta have it.

The two software pieces I am talking about are Dropbox and Xobni. Coincidentally, both the founders are MIT guys, and conicidentally they are good friends and coincidentally both of their products kick ass. I mean REALLY kick ass. And of course coincidentally or not both of these guys are super smart so they have great backing from some of the best VC firms in Silicon Valley.

So first let's talk about Dropbox www.dropbox.com

This application allows you to synchronize all your files on different platforms. Mac, Linux, iPhone, Windows etc. What I couldn't believe was how quickly I got attach 2 ed to this service, never in my life have I ever used a product that made our company more efficient than every before. This product is like a "mapped network drive" for you and anyone else! Completely changed the way we do business, and yes we recommend this to everyone!

Also, you get 2 Gigs free to try and if you upgrade for $200 / year, you get 100 Gigs of transfer + another $39.00 for the "rat pack" gives you version control, which means if you overwrote a file, you can get the previous one back! Great for backups too, we use this is a whole range of scenarios, from document management, developer file sharing etc.

The problem is I can't buy enough space! But I am sure this is coming!

Xobni - Inbox Spelled backwards www.xobni.com

I ditched Outlook for 2 years (YAY!) since I switched to Google Apps. I considered using Outlook after Google Apps Outlook Sync came into the picture, and I really started using it again with Xobni since I can actually find my shit now in Outlook. The best search for your email, period. Great Analytics too which we use to view our customer service information as well I get to see all the relationships on my social networks and how they are related to email!

Free to install but you will want to upgrade to the full functionality. Worth the $30.00 and there is a enterprise version which works great!

So my first post of this year, download this stuff and use it!

Saturday, March 21, 2009

The WORST FLU I have ever had (or that I can remember)

The flu that I had over the last week is by far the most painful and longest flu I have ever had. I am happy that I am even able to write about it today, being hopeful that the worst is over. I am not sure where I caught it exactly, initially I thought it was from other family members or maybe even at the office. (I ruled out China, since I was there over a month ago, SARS anyone? :p)

So about a week and a half ago, I start getting this light cough. You know how light coughs are, they come and go, same thing with a cold. Since I am pretty healthy, don't drink, smoke and work out regularly, I figure just to play it safe, let's go see the new family doctor that my other family members recommended. BIG Mistake, all I can say was this guy is in Richmond, and he is the WORST doctor I have ever been too. It's one thing for a doctor to be good at his diagnosis. It's another thing for them to get you out of the door quickly by not offering you any helpful solutions. This doctor in particular, said this to me once before since I had other family members who were sick at one point.

"It's not bacterial, I can't prescribe you anything because it's viral". Thanks genius, for the diagnosis, but I am starting to be in pain so give me something for the pain. So I ask for something and get nothing. So I figure, ok, this is the type of doctor that doesn't like to prescribe anything unless you are dying. He clearly doesn't understand that the whole point of me going to see him what to either give me something to distract my body from the nuisance of being sick viral or non-viral so I can function in my daily life. If he had even told me, take some Advil it would make you feel better, that would have been better. Instead, just go about your day, "BLAH BLAH BLAH" what a shit doctor I am thinking in my head. Since I know myself pretty well, I figured I should get a doctor's note for work just in case.

So with his pen and little doctor pad, he writes a note, but instead of giving it to me (which I thought was strange), he gives it to the receptionist (who by the way is just a pig headed as the doctor). I figured, "hmm, they must need to stamp it or something to make sure it's verified". That seemed quite professional until the receptionist said "That will be $15.00 please
". I started laughing and said "that's a good one HAHAHHAHAH, I'll have to remember that one". Then I paused, "you aren't serious are you?". She says "yes we charge for doctor's notes". So then I said "Since when do people start charging for doctor's notes???". The pig headed receptionist replies " oh we've always charged for them, we only charge $15.00 other places charge $30.00" like I was asking for a price match on a computer or dvd. Of course, I said "see you later" and she replies " oh but he already wrote the note". Which of course confirmed that this place was clearly just out to make and squeeze every penny out of every person (idiot) that comes through that door. (I probably can't name this place on the internet but I would gladly tell anyone, here I'll divulge some hints. It's in Richmond, the doctor's last name starts with a G, he's Caucasian and they are between 3 road and 4 road and Granville and Westminster). The worst part of all this, My brother and his wife go there and I go the speech "OH they aren't taking any new patients". Thank God I GOT SUCKERED, like they are so special and there aren't anymore family doctors on the planet.

So to my prediction, the next week I got sick, starting on Monday night of the week of the 15th of March. So the cough started getting REALLY bad when I was working late at the office, and by the time Tuesday came around, I felt like shit in the morning and went to work. I figured exercise usually helps, so I do my workouts and start my day. By lunch time, it felt like an invisible force beat the living shit out of me and I had to go home by 1:00 PM. Needless to say I knew this had turned into the flu. Because I had already gone to the genius doctor last week (hahah G for Genius, no that is not his last name nor is he one) who told me there was NOTHING I could do, I stupidly listened to him and decide to try to rough it out. Since all the stomach flu fevers I have had before in the past lasted 24 hours, I figured this would be the same. BIG Mistake, this was not the stomach flu, this was some sick demented fever coughing flu.

So by the time Friday rolled around, my family doctor prescribed me "Tamiflu" from Roche, which was great. Except for the fact it tricks your body into thinkind the flu is gone when it is not! Great if you need to get through 12 hours, but very painful since you know the flue is coming back!

So the medicine I took throughout this ordeal? Here they are

Tamiflu - Flu Masking
General Clarithromycin - Bacterial infection in lungs
Salbutamol Sulphate - Congestion
Pseudoephedrine-Triprolidine - For congenstion
+ All this stuff my mom gave me that didn't work (sorry mom!)

Bottom line if you are sick go see the doctor and don't wait till your flu gets better. And get a doctor that will help you with the situation not make it worse!

Sunday, February 22, 2009

Street Fighter IV Released!

Probably one of the only games I really place next to Grand Theft Auto, Street Fighter was definitely the game I played the most in high school and university. That being said, I had no idea that this week, Street Fighter IV was out and all my friends from high school and university went out in mass to buy this game. Unbelievably it was sold out every where in the lower mainland. Fortunately I had to make my way down to the US on the weekend, and I guess Street Fighter isn't as big in Bellingham so I lucked out and picked up a few copies.

My review of the game is an A. The graphics and gameplay are vastly improved, the version I purchased was the PS3 version. The great thing about the Street Fighter series is that they are different in terms of graphics and console, but the moves and gameplay are very similar if not the same as the original with the addition of new moves. That being said, if you were good at Street Fighter before, you will be good at this version, however there is the multiplayer online, which I will definitely try out at some point. Shoryuken!

Macs Lose AD Binding on Mac OS X 10.5.6 Update

I am going through the painful exercise of figuring out why my Mac is not authenticating to my AD Domain. Apparently the Mac OS 10.5.6 update kills something with Kerberos. Click here to view a possible solution.

Monday, February 16, 2009

My New $750 Toilet Seat - http://www.tinyurl.com/750Toilet

Although it is not as expensive as the $19 million dollar toilet Nasa bought, (the most expensive toilet in the world), the Lotus Smart Toilet ATS-1000 could be one of the most expensive toilet seats you have ever seen, certainly I thought it was outrageous when I first saw it at the local Chinese Shopping Mall, Aberdeen Centre in Richmond, B.C., Canada.

However, after using a similar device on my recent trip back from China, I must say, once you use this device, you will wonder how you ever lived without one or got by all these years just using toilet paper. My first exposure to this device was hearing about it from my family when they were in the Executive Lounge in the Shanghai Airport. They made is sound like such a great device that it was worth just visiting the lounge multiple times just to use it.

Not being a big fan of public restrooms, I just so happened to need to go when I was at the Shanghai Airport and in the Executive lounge and noticed that I was using one of these devices. I must say I was pleasantly surprised, considering there was a heated seat feature, massage feature, wash feature and a dryer feature.

Needless to say, I just returned home and went to Aberdeen to buy one. The store and brand name is Lotus, service at the store was great and they gave me the $60.00 off special for Chinese New Year. It took about a 1/2 hour to install and you need an AC output. For those of you who have ever been to Asia and have seen plugs behind the toilet, now I know why. I had to create a bit of a hack with extension cords but once I was up and running, the seat is amazing and nothing short of spectacular. Just your annual toilet paper bills will go down with this device, I highly recommend you stop by Lotus at Aberdeen and try it. Although $750.00 may seem like a steep price, after you use it and consider how many people in your family will use it (not to mention some people will think you are crazy) it is definitely worth buying.

I remember when people used to think I was crazy for paying $600 to $800 for a piece of Tumi Luggage for my computer. I am pretty sure these seats will go down in price over the next few years and probably then they will become mainstream but in Japan and Korea these seats are the norm!

Usually my blog is about computer software and devices but I believe any type of new and innovative technology is worth talking about. Oh yes, this is much better than a bidet!

Tuesday, February 03, 2009

Gears - Google's Web API Framework for Rich Functionality

First Google Apps, then Google Chrome. Finally Google Gears! With Google Gears, I can now see the whole big picture about how this will go head to head with Microsoft on the productivity side, specifically Microsoft Office.

In one to two years, I am pretty confident that Microsoft will have to start giving away Office. Google Gears has overcome one of the major hurdles of web applications, which is allowing web applications to be run offline. So I will tell you how I came across Gears. The first time I heard about it was today when I was searching for a way for Gmail to be run offline.

Actually, what I was searching for was hoping that Google was going to make an appliance or some software that would allow the Google Apps Gmail service to replicate to an onsite server for paid customers, since Gmail still requires you to connect to the Google Apps Service which means it is very slow to send email to your colleagues if you are in the same office. (Maybe this will be a new product for Google? Have a server sit at the office that knows if you are sending email to the same domain to route it locally instead of having to send it to Google's servers) We have this problem because we send very large attachments frequently.

However, instead of finding this, I came across Google's blog that offline support for their Gmail service and Calendar was coming.  

http://googlesystem.blogspot.com/2008/07/gmail-and-google-calendar-to-add.html

As our organization uses email very heavily, I decided to try this offline service and was pleasantly surprised. You can now take your entire Gmail Account offline literally. Gears allows you to take your entire web browser offline by providing a set of API's that allow the browser application to work as though you are online. No other email provider has done this. For our company it is amazing because it also allows us to have the Gmail Search Offline which up until this point required us to be online.

Once you see how this works, you will be able to appreciate what you can do with this. When Google makes this available for their docs and spreadsheets, you will no longer need excel or word, because those applications can run offline on your computer! On top of that, when you save it, it automatically synchronizes with your Google Docs! Heck I think they will just make Google Docs offline instead. I can't wait till this happens because this will really change the landscape of how applications works.

Gears is probably the biggest contribution to the web community in a long time. Google show be praised for this because it is an open source framework and I for one will be looking heavily at how Gears can be integrated into our web based applications.

Mark my words, Gears is the future of web development!

You can view more about Gears at http://code.google.com/apis/gears/

Apparently the feature for Google Docs offline already exists, now I just have to figure out how to use it! It seems that it is only available right now for the regular Gmail service and not Google Apps Premier Edition. More on this, probably just a setting!

http://googleblog.blogspot.com/2008/03/offline-access-to-google-docs.html


Google Chrome - Google's new browser

Since the advent of Google Apps which includes the Spreadsheets, word processing and Email access to these applications have only been available through Internet Explorer, Safari or Firefox. It's ironic since only four years back, the browser wars were officially over when Microsoft killed Netscape with Internet explorer. Netscape's code through Mozilla became Firefox. It seems that history truly does repeat it self because now not only does Microsoft compete with IE, they compete with Safari, Firefox and now Google Chrome. The competition now is definitely more fierce than ever since Google is the biggest competitor to Microsoft in every way. From search to productivity and now the browser.

Google Chrome is in every way better faster and more lean than Internet Explorer. Just install it and you will see how much faster it loads pages than IE. I believe in the 6 months that Chrome has been out, everyone that has used it has pretty much done away with IE except for sites that actually require IE. 

Chrome is by far the fastest browser on the market. I can't wait till it come out on Mac. On the windows platform, I actually use Chrome about 90% of the time and IE only 10% of the time and it works the best with Gmail and Google Apps, which is what we use now. I am happy to say we have officially tossed our Exchange Server. I have a post about that later as well, no longer is Email a headache for our organization. (Try having 1 terabyte of email on Exchange and backing that up.)

I highly recommend Google Chrome as the browser of choice on Windows and with the advent of Gears which is very exciting, you can expect Chrome to be at the centerpiece of your web application experience.