The Temple of Fu

code, systems and games

Archive for February 2010

Apache mod_proxy

leave a comment »

So if you want to proxy say an IIS server behind your Apache box, and hey lets be honest who wouldn’t want to, you can do it using mod_proxy and name based virtual hosting. Mod_proxy simply redirects requests for certain URLs to another web server.

Create a vhost definition.

<Virtualhost *>
  ProxyPreserveHost On
  ProxyPass /
  ProxyPassReverse /
  SetEnv force-proxy-request-1.0 1
  SetEnv proxy-nokeepalive 1

Have Apache re read it’s configuration and whammo!

Now you can have multiple flavors of web servers sitting behind a single IP! Sweet huh.


Written by lordfu

February 25, 2010 at 2:36 am

Posted in Apache, Linux, RedHats, Slackware

Install VMWare Server 2.0.1 on CentOS 5.3

leave a comment »

Install VMware Server on CentoS 5.3

First find out what kernel you have installed.

uname -r

On my new install I have 2.6.18-128.e15.

On this server I will be using a GUI, so for the following package installations I used the package manager to install the software.

Dependency Installation

Go to Applications > Add/Remove Software:

The Package Manager opens. Go to the Browse tab and select:

  * Development > Development Libraries

  * Development > Development Tools

Then click apply

Then go to the Search tab and search for xinetd. Select the xinetd package for installation:

Do the same for the kernel-devel package. Please make sure you select the kernel-devel package that corresponds to your current kernel

At this point I rebooted, not a necessity but I did.

VMWare Server Installation

To download VMware Server, go to and click on Download Now:

Download the VMware Server for Linux .tar.gz file to your place in which you will build it. I will be building under /usr/src/vmware

Change to the directory where you have the file and un-tar it change directory and start the install.

tar xvfz VMware-server-*.tar.gz
cd vmware-server-distrib
The installer will ask you a lot of questions. You can always accept the default values simply by hitting  enter when it asks you

In which directory do you want to keep your virtual machine files?

[/var/lib/vmware/Virtual Machines]

Accept default unless you have other reasons.

It will then attempt after a few more steps to build and load a vm monitor module ‘vmmon’, if this step fails it is becase most likely you have the wrong kernel-dev packages installed at the begining.

Then comes networking. I set up bridged networking. This allows my guests to have there own unique IP address assigned to them. I also assigned eth1 as the bridged interface.

I say no to NAT networking.

I say no to host-only networking.

Accept the default port assigned for remote connection.(902)

Accept the default port assigned for standard http connections (8222).

Accept the default port assigned for secure http connections (8333).

I installed as root so the VMWare server administrator is root(8222).

At the end of the installation, you will be asked to enter a serial number:

Please enter your 20-character serial number.

Type XXXXX-XXXXX-XXXXX-XXXXX or ‘Enter’ to cancel:

Fill in your serial number for VMware Server.

For those that are used to using the old remote management interface, VMWare now offers a web absed management infrastructure and I must say it is very nice!

If you try to connect with the old management server you will get the following.

"Unable to connect to the remote host: 501 Global command GLOBAL server-vmdb to non-host agent targets not supported."

Open a web browser and point it to your server and with the port 8222. localhost:8222 if ran on your local machine, otherwise enter the ip address of the server.

This is where you can configure and add your guest machines as well as connect to the console of the guest.(see below).

vmware web interface

There ya go!

I have upgraded my server since this post was originally written, let it be known that when doing kernel upgrades, you MUST rebuild vmware by running the following and answering the questions all_over_again; however this time your previous answers(configuration) are the default answers so just saying yes works in most cases.

I have noticed that the Web Management tool is a bit flaky and does not like SSL3 so make sure you do not allow your browser to use SSL3. It also randomly does not work, just plain old does nothing, I guess thats expected for FREE. However I give the web interface a 2 out of 10 stars for its flakyness.

Written by lordfu

February 25, 2010 at 2:32 am

Posted in Linux, RedHats

Ajax ModalPopupExtender Postback and Web User Controls

with 12 comments

First off yes, there are a ton of blog posts regarding how to cause a button click inside the ModalPopupExtender to execute server side code and almost all of them tell you correctly to remove the following two attributes, OkControlID and OnOkScript from the ModalPopupExtender declaration.

Where my blog entry differs is by scenario; What if we are dynamically loading user controls into the target panel for the ModalPopupExtender, what about a panel inside a ContentTemplate in a master pages scenario or what if we have an UpdatePanel? Luckily it all is pretty much the same, as long as  there is no OkControlID, OnOkScript or Cancel attributes defined the event will make it back to the server to try and find a delegate with the correct signature.

When you are loading user controls dynamically through the LoadControl() method you need to recreate that control and reload it during the OnInit or PreRender events in order for an event to be registered this also includes modal windows that have user controls within them that trigger events. 

Given the example markup below there is a modal window modalPop that uses panel pnlModalPopUp for it’s PopUpControlID. What you can also see is the TargetControlID is set to the hidden button btnHiddenForModal, this allows the modal window to remain hidden until an event occurs that signals a modal window display.


        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>

        <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="100">

        <asp:UpdatePanel ID="upPnlContent" runat="server" UpdateMode="Conditional">


                <asp:PlaceHolder runat="server" ID="plContent">

                <asp:Panel ID="pnlModalPopup" runat="server"  Style="display:none">


                <asp:Button ID="btnHiddenForModal" runat="server" Style="display:none" />




Now we load a control into the  panel pnlModalPopup using code behind.


// Control to be used inside the panel for the modal window

UserControl modalContent;

modalContent = new UserControl();

modalContent = (UserControl)LoadControl("PathToControl");

modalContent.ID = "modalControlID"




HttpContext.Current.Session["CurrentModalControl"] = “yes”;


Imagine that the control modalContent contains buttons whose click event you want to catch server side to execute some sort of business logic. In order for this to happen you need to do reload the modal window into the panel again in order for the buttons event to make it to the server to be processed.


 protected override void OnInit(EventArgs e)


  if (HttpContext.Current.Session["CurrentModalControl"] == "yes")  {

// Control to be used inside the panel for the modal window

UserControl modalContent;

modalContent = new UserControl();

modalContent = (UserControl)LoadControl("PathToControl");

modalContent.ID = "modalControlID"






And then within the user control that you are loading into the panel.

protected void btnOK_Click(object sender, EventArgs e)


  // Execute your server side code now that the buttons event signature can be found




Hope this helps someone!

Written by lordfu

February 23, 2010 at 12:27 am

Unable to start debugging on the web server. The web server is not configured correctly

leave a comment »

I was migrating a website at work from .Net 1.1 to a .Net 2.0 WAP (Web Application Project). All was going great until I started to debug the application to find the source of an error our users were experiencing. That is when I got the dreaded ‘Unable to start debugging on the web server’ error.

Now this site is set up within IIS on my local development box (XP) like the rest of my sites so I know it wasn’t a configuration error in IIS. I probably spent a good half hour to an hour trying to figure out why the heck I was getting this message and then it hit me, DUH! The webconfig has a compilation tag that has a debug attribute and since I had copied production ready code to my development machine I needed to set this to true. Once I did this I could happily debug away!

compilation defaultLanguage="vb" debug="true"

Remember to mark this as false when putting your application into production!!

I have encountered this error again and this time the solution was to make sure that the proper ASP.NET version was chosen for the website. In my case it was set to run under the 2.0* framework when it actuality it was a 1.1 app. Once I set it to run under the 1.1 framework debugging worked as expected.

Update x2:
Well I encountered this error again today, this time the solution for me was to make sure Anonymous Authentication was unchecked within IIS.

I hope this helps someone who has a lack of mental power without the proper amount of caffeine!

Written by lordfu

February 22, 2010 at 7:19 pm

Posted in ASP.Net, Development

Asus P5Q-E – Intel Core 2 Duo E8440 Black Screen

with 2 comments

I have a Asus P5Q-E motherboard in my main workstation at home. I recently just bought a Intel Core 2 Duo E8440 as an upgrade cpu. When I installed it and upon the first boot with the new CPU in place, I got a black screen and a completely unresponsive workstation (even pressing power had no effect).

I went to Asus’ website and downloaded the latest BIOS release P5Q-E-ASUS-2101.ROM for my motherboard. I slapped this new ROM file onto a usb stick and installed it. Voila! I can boot with the new CPU!

Hope this helps!


Prior BIOS version was 1.01 I think, not the factory default.

Booting with old cpu in place worked after my first failed attempt at booting with the new one.

Written by lordfu

February 20, 2010 at 3:48 pm

Posted in Hardware

Is an ambiguous reference between namespace X and namespace Y

leave a comment »

I received this error while trying to build my web application project in Visual Studio: is an ambiguous reference between namespace X and namespace Y

What had happened was that I was using the class designer within Visual Studio to rename a class, I saved and then changed my mind and renamed it back. I do not know where this went wrong but the designer.cs partial class had changed its’ class name to a class name within the namespace X. Changing the class name back to what it was supposed to be fixed it.

To find the offending file simply open ‘Class View’ within Visual Studio and expand the namespace where you know the class should not exist and double click it. This will take you to the offending file where you can make your adjustments.

Hope this helps someone!

Written by lordfu

February 18, 2010 at 2:52 am

Posted in ASP.Net, Development

ClearType font rendering in XP for Firefox or any other application

leave a comment »

So I was comparing the output of a web application I am working on in Internet Explorer and Firefox when I noticed that the fonts looked bad in Firefox (fonts just look way better in IE).

Unfortunately this adjustment will do nothing for the end users of my application that use another web browser other than Internet Explorer or even if then run another operating system (since this is a Windows display feature) but this will help you my faithful blog reader.

If you want ClearType font rendering on any font that Windows XP displays (so all applications), all you have to do is enable ClearType through the display properties.

  • Right click on the desktop and choose Properties.
  • Click on the Appearance tab and then choose the Effects… button.
  • In the ‘Use the following method to smooth edges of screen fonts:’ choose ClearType.
  • Click OK
  • Click Apply
  • Check out your results!

I had Firefox open the entire time and noticed the results as soon as I clicked apply.

Hope that helps someone!

Written by lordfu

February 17, 2010 at 6:54 pm

Posted in Windows