<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nathan Bridgewater &#187; .NET</title>
	<atom:link href="http://www.integratedwebsystems.com/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.integratedwebsystems.com</link>
	<description>My Little .NET Sandbox</description>
	<lastBuildDate>Tue, 31 Aug 2010 17:15:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing OpenSuse 11.2 with Mono 2.6.1 and Apache Using Text Mode Configuration &#8211; Porting to Mono Part 1 of 3</title>
		<link>http://www.integratedwebsystems.com/2010/01/installing-opensuse-11-2-with-mono-2-6-1-and-apache-using-text-mode-configuration-porting-to-mono-part-1-of-3/</link>
		<comments>http://www.integratedwebsystems.com/2010/01/installing-opensuse-11-2-with-mono-2-6-1-and-apache-using-text-mode-configuration-porting-to-mono-part-1-of-3/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 13:30:00 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Mono]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[installing]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_mono]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[openSuse]]></category>

		<guid isPermaLink="false">http://www.integratedwebsystems.com/?p=441</guid>
		<description><![CDATA[I’ve always kept an eye on the Mono project, mostly out of curiosity and intrigue. The last time I played around with Mono it was at version 2.0, and at the time I didn’t really spend a lot of time on it because it didn’t support some of the things I was using.&#160; Well recently, [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve always kept an eye on the Mono project, mostly out of curiosity and intrigue. The last time I played around with Mono it was at version 2.0, and at the time I didn’t really spend a lot of time on it because it didn’t support some of the things I was using.&#160; Well recently, I regained interest in Mono when I saw it now supports MVC and some of Dblinq. And since I’ve been buzzing on the whole MVC thing for awhile, I decided to check Mono out for myself and start a fun little porting project. So this is the first part of a three part series describing everything I did to get a server up and running and one of my Asp.Net MVC applications ported to Mono.</p>
<p>This first part will cover installing and configuring an OpenSuse 11.2 server with Apache/Mono and SSH. <a href="http://www.integratedwebsystems.com/2010/02/how-to-setup-and-configure-mysql-membership-provider-6-2-2-porting-to-mono-part-2-of-3/">The second part</a> will talk about how to setup a MySql Membership provider (with mono and Windows), and the third part is a walkthrough showing how to port a simple Asp.Net MVC site to mono and MySql. I’m also targeting those of you who use virtual hosting where you might only have SSH (after install) to configure your server, so I will be using text based tools: SSH, vi, and yast for all my installations and configuration after getting the base system installed.</p>
<p> <span id="more-441"></span>
<p><script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">
		google.load("jquery", "1.4.1");
		google.load("jqueryui", "1.7.2");
	</script><script type="text/javascript" src="/js/jquery.lightbox-0.5.pack.js"></script>
<link rel="stylesheet" type="text/css" href="/css/jquery.lightbox-0.5.css" media="screen" /><script type="text/javascript" src="/tools/js/p441.js"></script></p>
<p sizcache="0" sizset="0">First off, let me just say that I’m a Windows .NET programmer; not a Linux programmer. I know enough about Linux to dig my way around most of the basic stuff, so if anything seems incorrect in this post, feel free to correct me. <img src='http://www.integratedwebsystems.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> &#160; I’m extremely intrigued by Linux and its open source philosophy. I use it for a handful of useful, rock solid services like <a href="http://subversion.tigris.org/" target="_blank">Subversion</a>, <a href="http://www.postfix.org/" target="_blank">Postfix</a>, <a href="http://www.samba.org/" target="_blank">Samba</a> file servers and <a href="http://www.mysql.com/" target="_blank">MySql</a>. I also share an interest with many small web shops in finding more affordable hosting solutions for smaller Asp.Net apps. And in light of Mono being able to run MVC apps, it’s very exciting to think of what we can do with it.</p>
<h3>Index</h3>
<ul sizcache="0" sizset="4">
<li sizcache="0" sizset="4"><a href="#BeforeYouBegin">Before You Begin</a>&#160; </li>
<li sizcache="0" sizset="5"><a href="#InstallingLinuxPart1">Installing Linux Graphical (part 1)</a> </li>
<li sizcache="0" sizset="6"><a href="#InstallingLinuxPart2">Configuring Linux During Install (part 2)</a> </li>
<li sizcache="0" sizset="7"><a href="#ConfiguringLinuxAfterInstall">Configuring Linux After Install</a> </li>
<li sizcache="0" sizset="8"><a href="#UpdatingSoftware">Updating Software</a> </li>
<li sizcache="0" sizset="9"><a href="#InstallMonoAndApache">Install Mono, Apache, and MySql</a> </li>
<li sizcache="0" sizset="10"><a href="#ConfigureApache">Configure a Virtual Host &amp; Web Directory</a> </li>
<li sizcache="0" sizset="11"><a href="#RunningMVC">Running the Default Visual Studio MVC Website</a> </li>
<li sizcache="0" sizset="12"><a href="#UsefulLinks">Useful Links</a> </li>
</ul>
<p sizcache="0" sizset="11">&#160;</p>
<h3 sizcache="0" sizset="13"><a name="BeforeYouBegin">Before you Begin</a></h3>
<p sizcache="0" sizset="14">There are a few things you need to download before you get started.&#160; First of all, you’ll need an SSH client for file transfer and console access. I’m using <a href="http://filezilla-project.org/download.php" target="_blank">FileZilla</a> and <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">Putty</a> as my SSH clients. If you’ve never used it before, think of SSH like telnet and FTP wrapped into one.</p>
<p>Here’s a few tips on navigating the text mode installer screens. Use the Tab Key to cycle through fields or change focus between sections on the screen. Use the Spacebar or Enter to select an option. Esc can back out of a dropdown option. You can use the arrow keys to cycle options in a section.</p>
<p sizcache="0" sizset="16">Download one of the <a href="http://software.opensuse.org/112/en" target="_blank">installers on OpenSuse’s website.</a> Burn or mount the ISO and boot your machine from it to begin.</p>
<p><em>Note: while I was doing this on a test virtual machine, I could only get the Network install to work with Virtual PC 2007 on my hardware. All the versions worked fine when installing it to a physical machine. If you choose the network install, you may need to configure your DHCP settings before the GUI installer starts. (with Virtual PC, make sure the correct external network card is exposed to the virtual machine). </em></p>
<h3 sizcache="0" sizset="17"><a name="InstallingLinuxPart1">Installing Linux Graphical (part 1)</a></h3>
<p>In sequence, here are (most) of the screens you’ll see during the first part of installing OpenSuse 11.2.</p>
<div class="gallery" sizcache="0" sizset="18">
<table border="0" cellpadding="5" sizcache="0" sizset="18">
<tbody sizcache="0" sizset="18">
<tr sizcache="0" sizset="18">
<td width="269" sizcache="0" sizset="18"><a title="OpenSuse 11.2 boot screen" href="/resources/p441/install/1.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="OpenSuse Boot Screen" border="0" alt="OpenSuse Boot Screen" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/1.jpg" width="244" height="184" /></a></td>
<td width="375">&#160;</td>
</tr>
<tr sizcache="0" sizset="19">
<td width="269" sizcache="0" sizset="19"><a title="Language selection" href="/resources/p441/install/2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="Language selection" border="0" alt="Language selection" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/22.jpg" width="244" height="199" /></a></td>
<td width="375">
<p>Language selection</p>
</td>
</tr>
<tr sizcache="0" sizset="20">
<td width="269" sizcache="0" sizset="20"><a title="New install. Disable Auto-configuration" href="/resources/p441/install/3.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="New install. Disable auto-configuration." border="0" alt="New install. Disable auto-configuration." src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/3.jpg" width="244" height="199" /></a></td>
<td width="375">
<p>Uncheck<strong> </strong><em>Use Automatic Configuration</em></p>
</td>
</tr>
<tr sizcache="0" sizset="21">
<td width="269" sizcache="0" sizset="21"><a title="Choose your time zone" href="/resources/p441/install/4.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Choose your time zone" border="0" alt="Choose your time zone" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/41.jpg" width="244" height="199" /></a></td>
<td width="375">
<p>Choose your time zone.</p>
</td>
</tr>
<tr sizcache="0" sizset="22">
<td width="269" sizcache="0" sizset="22"><a title="Desktop selection. See options." href="/resources/p441/install/5.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Desktop selection" border="0" alt="Desktop selection" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/51.jpg" width="244" height="199" /></a></td>
<td width="375">
<p>I chose minimal server.</p>
<p><strong>Optional:</strong> You may choose a desktop if you wish to use remote VNC to remotely admin your server with a GUI.&#160; VNC is kind of like using Remote Desktop. To do that, choose your desktop here, and we’ll configure it to still boot to text mode later at the summary screen.</p>
</td>
</tr>
<tr sizcache="0" sizset="23">
<td width="269" sizcache="0" sizset="23"><a title="Partition selection. I used defaults." href="/resources/p441/install/6.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Partition selection" border="0" alt="Partition selection" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/61.jpg" width="244" height="199" /></a></td>
<td width="375">Partition selection. I used defaults.</td>
</tr>
<tr sizcache="0" sizset="24">
<td width="269" sizcache="0" sizset="24"><a title="Setting up the first user. Uncheck Automatic Login." href="/resources/p441/install/7.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Setting up the first user" border="0" alt="Setting up the first user" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/71.jpg" width="244" height="199" /></a></td>
<td width="375">
<p>Enter your username. Uncheck automatic login.</p>
<p><strong>Optional:</strong> You may choose a different password for the root user.&#160; This is good if you have a public server sitting in the cloud in case someone gets the password to your normal user account.</p>
</td>
</tr>
<tr sizcache="0" sizset="25">
<td width="269" sizcache="0" sizset="25"><a title="Summary. Enable SSH." href="/resources/p441/install/8.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Summary" border="0" alt="Summary" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/81.jpg" width="244" height="199" /></a></td>
<td width="375">
<p>Summary screen. Scroll to the bottom.<strong> Click “enable and open” for Firewall and SSH</strong>. We’ll use SSH to remotely admin the server.</p>
<p><strong>Optional: </strong>If you chose a desktop earlier, change the <em>Default Runlevel </em>to 3 (Full multiuser with network). This will cause the server to boot to normal text mode by default.</p>
</td>
</tr>
<tr sizcache="0" sizset="26">
<td width="269" sizcache="0" sizset="26"><a title="Confirm Installation" href="/resources/p441/install/9.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Confirm Installation" border="0" alt="Confirm Installation" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/91.jpg" width="244" height="199" /></a></td>
<td width="375">
<p>Click Install to continue.</p>
</td>
</tr>
<tr sizcache="0" sizset="27">
<td width="269" sizcache="0" sizset="27"><a title="Progress" href="/resources/p441/install/12.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Installation Progress" border="0" alt="Installation Progress" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/121.jpg" width="244" height="199" /></a></td>
<td width="375">&#160;</td>
</tr>
</tbody>
</table></div>
<h3 sizcache="0" sizset="28"><a name="InstallingLinuxPart2">Configuring Linux During Install (part 2)</a></h3>
<p>After the first phase, your computer will reboot and begin the manual configuration phase. As I mentioned earlier, these screens are pretty easy to navigate. Use tab to cycle through the fields or change focus to different sections. Use space or enter to make a selection. Also, the highlighted letters in words are hotkeys you can use in combination with the Alt key.&#160; Each section will continue when you select the NEXT option in the bottom right corner.</p>
<div class="gallery" sizcache="0" sizset="29">
<table border="0" cellpadding="5" sizcache="0" sizset="29">
<tbody sizcache="0" sizset="29">
<tr sizcache="0" sizset="29">
<td valign="top" width="269" sizcache="0" sizset="29"><a title="First configuration screen. Enter your hostname" href="/resources/p441/config/1.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="First configuration screen. Enter your hostname" border="0" alt="First configuration screen. Enter your hostname" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/11.jpg" width="244" height="184" /></a> </td>
<td width="375">
<p>This is the first configuration screen. Enter your new machine hostname (or leave it default).</p>
</td>
</tr>
<tr sizcache="0" sizset="30">
<td valign="top" width="269" sizcache="0" sizset="30"><a title="Progress after choosing hostname." href="/resources/p441/config/2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Progress screen" border="0" alt="Progress screen" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/21.jpg" width="244" height="184" /></a> </td>
<td width="375">
<p>Showing hostname configuration progress.</p>
</td>
</tr>
<tr sizcache="0" sizset="31">
<td valign="top" width="269" sizcache="0" sizset="31"><a title="Configuration screen. Choose Network Interfaces" href="/resources/p441/config/3.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Main configuration screen. Choose netowrk interface" border="0" alt="Main configuration screen. Choose netowrk interface" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/31.jpg" width="244" height="183" /></a> </td>
<td width="375">
<p>This is the main configuration screen. You will set your network configuration here. Tab until you see the bounding box around the gray area light up. Then down arrow to Network Interfaces. Press enter to select it.</p>
</td>
</tr>
<tr sizcache="0" sizset="32">
<td valign="top" width="269" sizcache="0" sizset="32"><a title="Network Interface screen." href="/resources/p441/config/4.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Network interfaces screen" border="0" alt="Network interfaces screen" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/4.jpg" width="244" height="183" /></a> </td>
<td width="375">
<p><strong>Overview Screen</strong></p>
<p>This is the first Network Interfaces screen. There are three focus areas. The first is the top tab area: Overview, Hostname/DNS, and Routing.</p>
<p>Tab to the interface list and select your interface card for your main Internet connection. Then press Alt-i to view its details</p>
</td>
</tr>
<tr sizcache="0" sizset="33">
<td valign="top" width="269" sizcache="0" sizset="33"><a title="Shows ethernet settings. Leave as DHCP or set to static." href="/resources/p441/config/5.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Ethernet NIC settings" border="0" alt="Ethernet NIC settings" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/5.jpg" width="244" height="184" /></a> </td>
<td width="375">
<p>Shows Ethernet details. If you choose to use static IP, this is where to set that information. Set the IP address, subnet, etc. You may leave this as DHCP if you wish.&#160; When you’re done tab and select Next.</p>
</td>
</tr>
<tr sizcache="0" sizset="34">
<td valign="top" width="269" sizcache="0" sizset="34"><a title="Set hostname/DNS" href="/resources/p441/config/7.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Set hostname and DNS" border="0" alt="Set hostname and DNS" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/7.jpg" width="244" height="184" /></a> </td>
<td width="375">
<p>From the Overview screen (bolded above), move to the Hostname/DNS section. Set your hostname and your DNS servers (if you chose static IP in the previous step).</p>
</td>
</tr>
<tr sizcache="0" sizset="35">
<td valign="top" width="269" sizcache="0" sizset="35"><a title="Routing configuration" href="/resources/p441/config/8.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Routing configuration" border="0" alt="Routing configuration" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/8.jpg" width="244" height="183" /></a> </td>
<td width="375">
<p>If you chose a static IP, tab from the Overview Screen to Routing. Set your default gateway and associate it with the correct device.</p>
</td>
</tr>
<tr sizcache="0" sizset="36">
<td valign="top" width="269" sizcache="0" sizset="36"><a title="Writing network configuration." href="/resources/p441/config/9.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Writing network configuration" border="0" alt="Writing network configuration" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/9.jpg" width="244" height="183" /></a> </td>
<td width="375">After clicking Next from the Overview Screen, the configuration changes will be written to disk. </td>
</tr>
<tr sizcache="0" sizset="37">
<td valign="top" width="269" sizcache="0" sizset="37"><a title="Test Internet Connection" href="/resources/p441/config/10.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Test Internet" border="0" alt="Test Internet" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/10.jpg" width="244" height="185" /></a> </td>
<td width="375">This step will test your Internet connection. If successful, it will check for updates. </td>
</tr>
<tr sizcache="0" sizset="38">
<td valign="top" width="269" sizcache="0" sizset="38"><a title="Successful connection" href="/resources/p441/config/11.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Successful connection" border="0" alt="Successful connection" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/111.jpg" width="244" height="184" /></a> </td>
<td width="375">Successful connection</td>
</tr>
<tr sizcache="0" sizset="39">
<td valign="top" width="269" sizcache="0" sizset="39"><a title="Updating packages" href="/resources/p441/config/12.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Updating packages" border="0" alt="Updating packages" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/12.jpg" width="244" height="184" /></a> </td>
<td width="375">Updating packages</td>
</tr>
<tr sizcache="0" sizset="40">
<td valign="top" width="269" sizcache="0" sizset="40"><a title="Updating packages" href="/resources/p441/config/13.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Updating packages" border="0" alt="Updating packages" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/13.jpg" width="244" height="183" /></a> </td>
<td width="375">&#160;</td>
</tr>
<tr sizcache="0" sizset="41">
<td valign="top" width="269" sizcache="0" sizset="41"><a title="Run updates" href="/resources/p441/config/14.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Run updates" border="0" alt="Run updates" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/14.jpg" width="244" height="184" /></a> </td>
<td width="375">Run updates</td>
</tr>
<tr sizcache="0" sizset="42">
<td valign="top" width="269" sizcache="0" sizset="42"><a title="Package updates" href="/resources/p441/config/15.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Package updates" border="0" alt="Package updates" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/15.jpg" width="244" height="184" /></a> </td>
<td width="375">&#160;</td>
</tr>
<tr sizcache="0" sizset="43">
<td valign="top" width="269" sizcache="0" sizset="43"><a title="Downloading updates" href="/resources/p441/config/16.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Downloading updates" border="0" alt="Downloading updates" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/16.jpg" width="244" height="183" /></a> </td>
<td width="375">&#160;</td>
</tr>
<tr sizcache="0" sizset="44">
<td valign="top" width="269" sizcache="0" sizset="44"><a title="Installing updates" href="/resources/p441/config/17.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Installing updates" border="0" alt="Installing updates" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/17.jpg" width="244" height="184" /></a> </td>
<td width="375">Will reboot after this step. You may need to click Next after it finishes.</td>
</tr>
<tr sizcache="0" sizset="45">
<td valign="top" width="269" sizcache="0" sizset="45"><a title="After reboot, next config screen." href="/resources/p441/config/18.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="After reboot, next config screen." border="0" alt="After reboot, next config screen." src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/18.jpg" width="244" height="183" /></a> </td>
<td width="375">&#160;</td>
</tr>
<tr sizcache="0" sizset="46">
<td valign="top" width="269" sizcache="0" sizset="46"><a href="/resources/p441/config/19.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="" border="0" alt="" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/19.jpg" width="244" height="184" /></a> </td>
<td width="375">&#160;</td>
</tr>
<tr sizcache="0" sizset="47">
<td valign="top" width="269" sizcache="0" sizset="47"><a title="Printer setup" href="/resources/p441/config/20.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Printer setup" border="0" alt="Printer setup" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/20.jpg" width="244" height="183" /></a> </td>
<td width="375">I used defaults here. </td>
</tr>
<tr sizcache="0" sizset="48">
<td valign="top" width="269" sizcache="0" sizset="48"><a title="Finally!" href="/resources/p441/config/21.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Finally!" border="0" alt="Finally!" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/211.jpg" width="244" height="184" /></a> </td>
<td width="375">Finally done! </td>
</tr>
<tr sizcache="0" sizset="49">
<td valign="top" width="269" sizcache="0" sizset="49"><a title="Console after installation" href="/resources/p441/config/22.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Console after installation" border="0" alt="Console after installation" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/221.jpg" width="244" height="183" /></a> </td>
<td width="375">The installation drops you to a console.&#160; </td>
</tr>
</tbody>
</table></div>
<p>&#160;</p>
<h3 sizcache="0" sizset="50"><a name="ConfiguringLinuxAfterInstall">Configuring Linux After Install</a></h3>
<div class="gallery" sizcache="0" sizset="51">
<p sizcache="0" sizset="51"><a title="Putty, open a connection to your new server." href="/resources/p441/post_install/1.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="Putty, open connection" border="0" alt="Putty, open connection" align="right" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/113.jpg" width="244" height="234" /></a> At this point, your operating system is installed and accessible online via SSH. (If you purchased a VM, this is where you’ll usually begin). To connect to your new server, open Putty and enter your static IP or hostname for your new server. Select SSH connection type. Then click Open. You will be prompted to trust the certificate. Click YES, and login to your new server using the account you setup during install.</p>
<p sizcache="0" sizset="47"><em>NOTE: (You may optionally save these connection settings by typing a name and clicking Save. </em></p>
</p></div>
<p><strong>Root Access      <br /></strong>You’ll need root access to perform most of the tasks we’re doing, so enter: <strong>su</strong><em>, </em>then type the root password you configured during install. The command prompt will change color to <strong><font color="#ff0000">red</font></strong>.</p>
<h3 sizcache="0" sizset="52"><a name="UpdatingSoftware">Updating Software</a></h3>
<p>One of the really cool things about most Linux distributions is their package management. It’s a one-stop-shop for installing, updating, and removing software on your system. Fedora has <em>yum</em>, Debian has <em>apt-get</em>, OpenSuse has<em> </em><em>zypper</em>. Using these utilities is very straight forward. So if you didn’t update your system during install, you can do it now by entering:</p>
<pre class="brush: bash; gutter: false; toolbar: false;">zypper update</pre>
<p>You can run this command occasionally to update your system. To see more details about how to use it. Enter: man zypper</p>
<p>&#160;</p>
<h3 sizcache="0" sizset="53"><a name="InstallMonoAndApache">Install Mono, Apache, and MySql</a></h3>
<p sizcache="0" sizset="49"><strong>Installing Mono and Apache</strong></p>
<p sizcache="0" sizset="49">With zypper, we can cheat a little to install mono, apache, and all dependencies. First we need to add the mono repositories so zypper knows how to find it.</p>
<p sizcache="0" sizset="49">Enter the following lines separately:</p>
<pre class="brush: bash; gutter: false;">zypper addrepo http://ftp.novell.com/pub/mono/download-stable/openSUSE_11.2 mono-stable
zypper refresh --repo mono-stable
zypper dist-upgrade --repo mono-stable</pre>
<p sizcache="0" sizset="49">Our cheat is going to be installing Mod_Mono, which is the mono plugin for Apache. This will force it to install apache, mono, xsp and everything we need to get started.</p>
<pre class="brush: bash; gutter: false; toolbar: false;">zypper install mod_mono</pre>
<p><strong>Autostart Apache</strong></p>
<p>To make apache start when the system reboots, enter this command:</p>
<pre class="brush: bash; gutter: false; toolbar: false;">chkconfig --add apache2</pre>
<p><strong>Installing MySql Server</strong></p>
<p>To download and install mysql server and client, enter this command:</p>
<pre class="brush: bash; gutter: false; toolbar: false;">zypper install mysql</pre>
<p>Add MySql to your startup and start it:</p>
<pre class="brush: bash; gutter: false; toolbar: false;">chkconfig --add mysql

service mysql start</pre>
<p>Then configure the server with:</p>
<pre class="brush: bash; gutter: false; toolbar: false;">mysql_secure_installation</pre>
<p>Follow the instructions and setup your server. The first question will be to enter your root password; the first time you run this, just press enter with a blank password, then choose <strong>Y</strong> to enter a new root password. You’ll also want to disable remote root access, the anonymous user, and test database.</p>
<p><strong>Optional:</strong></p>
<p>Now setup your user account so you can remotely access the server. This also requires you to expose your MySql server over the Internet if you’re running a hosted server. Users in MySql are username &amp; host based. Both parts make up a unique user.</p>
<p><strong>To add a user:</strong></p>
<p>Connect to your database server using your new root password. Enter: <strong>mysql -p</strong></p>
<p>Here is an example of a user you would typically use for a specific application running on the local machine. This statement grants all privileges on a database called test_database and all its tables to a username ‘my_new_username’ who can only connect from localhost.</p>
<pre class="brush: sql; gutter: false;">grant all privileges on test_database.* to 'my_new_username'@'localhost' identified by 'new_password' with grant option;</pre>
<p>An admin user with access to everything from any location would have a statement similar to this:</p>
<pre class="brush: sql; gutter: false;">grant all privileges on *.* to 'super_user'@'%' identified by 'super_secret_pw' with grant option;</pre>
<p>Enter <strong>quit</strong> to exit the MySql client.</p>
<p><strong>Firewall </strong></p>
<p>This is actually much simpler than it looks. I’m showing all these screens just for reference. Basically, just use yast as the tool configure the firewall. It has a nice little interface similar to the post-install configuration. For what we’re doing, add your network device to the External Zone, then add Secure Shell Server and HTTP Web Server to the allowed services. Then just enable and turn on your firewall (if it isn’t already on)</p>
<div class="gallery" sizcache="0" sizset="54">
<table border="0" cellpadding="5" sizcache="0" sizset="54">
<tbody sizcache="0" sizset="54">
<tr sizcache="0" sizset="54">
<td valign="top" width="269" sizcache="0" sizset="54"><a title="Start yast." href="/resources/p441/post_install/6.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Start Yast" border="0" alt="Start Yast" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/6.jpg" width="244" height="154" /></a> </td>
<td width="375">Enter: <strong>yast</strong></td>
</tr>
<tr sizcache="0" sizset="55">
<td valign="top" width="269" sizcache="0" sizset="55"><a title="Go to interface configuration" href="/resources/p441/post_install/7.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Interface configuration" border="0" alt="Interface configuration" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/72.jpg" width="244" height="154" /></a> </td>
<td width="375">Navigate to Interfaces, set your network device to be in the External Zone. </td>
</tr>
<tr sizcache="0" sizset="56">
<td valign="top" width="269" sizcache="0" sizset="56"><a title="Add allowed sevices" href="/resources/p441/post_install/8.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Allowed Services" border="0" alt="Allowed Services" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/82.jpg" width="244" height="155" /></a> </td>
<td width="375">Navigate to Allowed Services, select External Zone, then select Secure Shell Server. </td>
</tr>
<tr sizcache="0" sizset="57">
<td valign="top" width="269" sizcache="0" sizset="57"><a title="Add each service individually" href="/resources/p441/post_install/9.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Add each service individually" border="0" alt="Add each service individually" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/92.jpg" width="244" height="155" /></a> </td>
<td width="375">
<p>Use the Add link to add the selected service to the list.</p>
<p><strong>Repeat this for HTTP server</strong>.</p>
<p><strong>Optional:</strong> Add MySql server if you want to expose it to the Internet and access it remotely with your tools.</p>
</td>
</tr>
<tr sizcache="0" sizset="58">
<td valign="top" width="269" sizcache="0" sizset="58"><a title="Enable and start the firewall" href="/resources/p441/post_install/10.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Enable and start the firewall" border="0" alt="Enable and start the firewall" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/101.jpg" width="244" height="155" /></a> </td>
<td width="375">Enable and Start your firewall from the Start Up screen. </td>
</tr>
<tr sizcache="0" sizset="59">
<td valign="top" width="269" sizcache="0" sizset="59"><a title="Finish" href="/resources/p441/post_install/11.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Finish" border="0" alt="Finish" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/114.jpg" width="244" height="155" /></a> </td>
<td width="375">Finish</td>
</tr>
</tbody>
</table>
</div>
<p><strong></strong></p>
<p>&#160;</p>
<h3 sizcache="0" sizset="60"><a name="ConfigureApache">Configure a Virtual Host &amp; Web Directory</a></h3>
<p sizcache="0" sizset="61">I used the <a href="http://go-mono.com/config-mod-mono/" target="_blank">Mod_Mono configuration tool</a> on the Mono website, which built the following configuration file. It looks big, but most of it’s comments. The key notes here are that it runs .Net 2.0, it’s root directory and that it handles all requests through Mono (good for MVC). It also does some nice things like compress the output on certain files as well as the Mono output.</p>
<div class="gallery" sizcache="0" sizset="62">
<p sizcache="0" sizset="62"><a title="Using the Mod_Mono configuration tool." href="/resources/p441/post_install/14.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="Using the Mod_Mono configuration tool" border="0" alt="Using the Mod_Mono configuration tool" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/141.jpg" width="216" height="244" /></a></p>
</div>
<p sizcache="0" sizset="61">&#160;</p>
<pre class="brush: xml; gutter: false; toolbar: false;">&lt;VirtualHost *:80&gt;
  ServerName odin.integratedwebsystems.int
  ServerAdmin web-admin@odin.integratedwebsystems.int
  DocumentRoot /srv/www/odin.integratedwebsystems.int
  # MonoServerPath can be changed to specify which version of ASP.NET is hosted
  # mod-mono-server1 = ASP.NET 1.1 / mod-mono-server2 = ASP.NET 2.0
  # For SUSE Linux Enterprise Mono Extension, uncomment the line below:
  # MonoServerPath odin.integratedwebsystems.int &quot;/opt/novell/mono/bin/mod-mono-server2&quot;
  # For Mono on openSUSE, uncomment the line below instead:
  MonoServerPath odin.integratedwebsystems.int &quot;/usr/bin/mod-mono-server2&quot;

  # To obtain line numbers in stack traces you need to do two things:
  # 1) Enable Debug code generation in your page by using the Debug=&quot;true&quot;
  #    page directive, or by setting &lt;compilation debug=&quot;true&quot; /&gt; in the
  #    application's Web.config
  # 2) Uncomment the MonoDebug true directive below to enable mod_mono debugging
  MonoDebug odin.integratedwebsystems.int true

  # The MONO_IOMAP environment variable can be configured to provide platform abstraction
  # for file access in Linux.  Valid values for MONO_IOMAP are:
  #    case
  #    drive
  #    all
  # Uncomment the line below to alter file access behavior for the configured application
  MonoSetEnv odin.integratedwebsystems.int MONO_IOMAP=all
  #
  # Additional environtment variables can be set for this server instance using
  # the MonoSetEnv directive.  MonoSetEnv takes a string of 'name=value' pairs
  # separated by semicolons.  For instance, to enable platform abstraction *and*
  # use Mono's old regular expression interpreter (which is slower, but has a
  # shorter setup time), uncomment the line below instead:
  # MonoSetEnv odin.integratedwebsystems.int MONO_IOMAP=all;MONO_OLD_RX=1

  MonoApplications odin.integratedwebsystems.int &quot;/:/srv/www/odin.integratedwebsystems.int&quot;
  &lt;Location &quot;/&quot;&gt;
    Allow from all
    Order allow,deny
    MonoSetServerAlias odin.integratedwebsystems.int
    SetHandler mono
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI &quot;\.(?:gif|jpe?g|png)$&quot; no-gzip dont-vary
  &lt;/Location&gt;
  &lt;IfModule mod_deflate.c&gt;
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
  &lt;/IfModule&gt;
&lt;/VirtualHost&gt;</pre>
<p sizcache="0" sizset="63">Edit the information above (or use the <a href="http://go-mono.com/config-mod-mono/" target="_blank">configuration tool</a>) and replace my hostname with yours. Then save this file with the extension “.conf” and copy it to your /etc/apache2/conf.d directory using <a href="http://filezilla-project.org" target="_blank">FileZilla</a> SFTP connection as the root user.</p>
<p>Create a new directory at the location you specified in the DocumentRoot command. This is the root folder you’ll use to deploy your website.</p>
<pre class="brush: bash; gutter: false; toolbar: false;">cd /srv/www

mkdir my_web_hostname</pre>
<p>After setting all this up, you’ll need to restart your Apache server. To do that, just enter:</p>
<pre class="brush: bash; gutter: false; toolbar: false;">service apache2 restart</pre>
<p>You can restart any of your services this way. You might also reboot your server just to get a fresh run after installing and configuring all our software. Use the shutdown command to restart your system. Again, you can use <em>shutdown &#8211;help</em> or <em>man shutdown</em> to learn more about that command.</p>
<pre class="brush: bash; gutter: false; toolbar: false;">shutdown -r now</pre>
<h3 sizcache="0" sizset="65"><a name="RunningMVC">Running the Default Visual Studio MVC Website</a></h3>
<div class="gallery" sizcache="0" sizset="66">
<p sizcache="0" sizset="66"><a title="Running default MVC website on Apache/Mono 2.6.1" href="/resources/p441/post_install/13.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="It works! " border="0" alt="It works! " align="right" src="http://www.integratedwebsystems.com/wp-content/uploads/2010/01/131.jpg" width="244" height="120" /></a> Open Visual Studio 2008 and build a brand new ASP.NET MVC Web Application.&#160; Publish it to a folder and copy all the published contents to your Linux server at <em>/srv/www/my_web_hostname</em> using FileZilla. Using a web browser, browse to your server and it should show that the new web application works right out the box (with the exception of Membership).</p>
</div>
<p sizcache="0" sizset="67">This is cool! It’s a great start knowing that routing, controllers and views all work. Feel free to play with it a bit more. Mono has some great tools like <a href="http://www.mono-project.com/MoMA" target="_blank">MoMa</a> that will tell you if your existing assemblies are compatible with Mono. You can also start toying around with Dblinq and alternative membership providers.</p>
<p>&#160;</p>
<p sizcache="0" sizset="68">There’s more to come. The <a href="http://www.integratedwebsystems.com/2010/02/how-to-setup-and-configure-mysql-membership-provider-6-2-2-porting-to-mono-part-2-of-3/">next post</a> will show you how to use the <a href="http://dev.mysql.com/downloads/connector/net/#downloads" target="_blank">MySql Membership</a> provider with both Windows and Mono.</p>
<p>&#160;</p>
<h3 sizcache="0" sizset="69"><a name="UsefulLinks">Useful Links</a></h3>
<ul sizcache="0" sizset="70">
<li sizcache="0" sizset="70">Mono Website – <a title="http://www.mono-project.com" href="http://www.mono-project.com">http://www.mono-project.com</a>&#160; </li>
<li sizcache="0" sizset="71">Mod_Mono Configuration Tool &#8211; <a href="http://go-mono.com/config-mod-mono/">http://go-mono.com/config-mod-mono/</a> </li>
<li sizcache="0" sizset="72">MoMa&#160; Mono Compatibility Checker &#8211; <a title="http://www.mono-project.com/MoMA" href="http://www.mono-project.com/MoMA">http://www.mono-project.com/MoMA</a> </li>
<li sizcache="0" sizset="73">OpenSuse 11.2 Download Page (scroll down) &#8211; <a href="http://software.opensuse.org/112/en">http://software.opensuse.org/112/en</a> </li>
<li sizcache="0" sizset="74">OpenSuse Documentation (loaded with great how to documents) &#8211; <a href="http://en.opensuse.org/Documentation">http://en.opensuse.org/Documentation</a> </li>
<li sizcache="0" sizset="75">Putty Download Page &#8211; <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html</a> </li>
<li sizcache="0" sizset="76">FileZilla Download Page &#8211; <a href="http://filezilla-project.org/download.php">http://filezilla-project.org/download.php</a> </li>
<li sizcache="0" sizset="77">MySql Connector .NET Download &#8211; <a title="http://dev.mysql.com/downloads/connector/net/#downloads" href="http://dev.mysql.com/downloads/connector/net/#downloads">http://dev.mysql.com/downloads/connector/net/#downloads</a> </li>
<li sizcache="0" sizset="78">MySql Workbench (MySql Administration and Development tools) &#8211; <a title="http://dev.mysql.com/downloads/workbench/5.2.html" href="http://dev.mysql.com/downloads/workbench/5.2.html">http://dev.mysql.com/downloads/workbench/5.2.html</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.integratedwebsystems.com/2010/01/installing-opensuse-11-2-with-mono-2-6-1-and-apache-using-text-mode-configuration-porting-to-mono-part-1-of-3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Regex Groups and Find/Replace Tagged Expressions</title>
		<link>http://www.integratedwebsystems.com/2009/05/regex-groups-for-tagged-expressions/</link>
		<comments>http://www.integratedwebsystems.com/2009/05/regex-groups-for-tagged-expressions/#comments</comments>
		<pubDate>Wed, 13 May 2009 18:25:39 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Group]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[tagged expression]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.integratedwebsystems.com/?p=228</guid>
		<description><![CDATA[Every once in awhile I have a need to use regular expressions in code. I love using them in Visual Studio find/replace. And one of my favorite features in the find/replace dialog is tagged expressions. This allows me to make a regular expression match and at the same time extract pieces of it for use [...]]]></description>
			<content:encoded><![CDATA[<p>Every once in awhile I have a need to use regular expressions in code. I love using them in Visual Studio find/replace. And one of my favorite features in the find/replace dialog is tagged expressions. This allows me to make a regular expression match and at the same time extract pieces of it for use in my replace with expression.</p>
<p>So today, I&#8217;m toying around with Regex and find a need to have the same behavior in code. The difference is, tagged expressions in code are referred to as matching groups. Normally you would use braces for your tagged expressions in a find/replace dialog; but in code, you would use parentheses instead.<span id="more-228"></span></p>
<p>(BTW, These are very simplified and by no means an end-all match expression for this scenario).</p>
<p>For today&#8217;s search, I need an expression that would give me a table name from an insert or update t-sql statement. Simple enough right?  With this expression: &#8220;<em>insert into [a-zA-Z0-9_]+|update [a-zA-Z0-9_]+ </em>&#8221; I can validate either of the two statements. But I really want the table name used in this match.  In a tagged expression, I would&#8217;ve used &#8220;<em>insert into {[a-zA-Z0-9_]+}|update {[a-zA-Z0-9_]+}</em> &#8221; so I could use \1 and \2 for my table name in the replace expression. But in code, we&#8217;ll need to use groups. So the regex will look like this, &#8220;<em>insert into ([a-zA-Z0-9_]+)|update ([a-zA-Z0-9_]+)</em> &#8220;.</p>
<p>Fortunately in our search text, it can be only insert or update, not both. So in code, I could match a statement like this:</p>
<pre class="brush: csharp; gutter: false; toolbar: false;">Regex regex = new Regex("insert into ([a-zA-Z0-9_]+)|update ([a-zA-Z0-9_]+) ", RegexOptions.IgnoreCase);

if (regex.IsMatch(sql_command))
{
    string table_name = regex.Match(sql_command).Groups[1].Value;
}</pre>
<p>The Groups collection contains the sub matches starting with the second element.  This is handy; so you don&#8217;t have to re-search your match with a second expression. In our scenario, only one group match will ever exist, so using Groups[1] gets me the table name.</p>
<p>You can get more info from <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.groupcollection.aspx" target="_blank">the MSDN docs.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.integratedwebsystems.com/2009/05/regex-groups-for-tagged-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to Find Valid Certificate Path for Google Checkout Notification on IIS6</title>
		<link>http://www.integratedwebsystems.com/2009/05/unable-to-find-valid-certificate-path-for-google-checkout-notification-on-iis6/</link>
		<comments>http://www.integratedwebsystems.com/2009/05/unable-to-find-valid-certificate-path-for-google-checkout-notification-on-iis6/#comments</comments>
		<pubDate>Mon, 04 May 2009 20:01:11 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Google Checkout]]></category>
		<category><![CDATA[Certificate Path]]></category>
		<category><![CDATA[Notification]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://www.integratedwebsystems.com/?p=217</guid>
		<description><![CDATA[Well this was a fun one. For onelittlebow.com, we&#8217;re using Google Checkout as one of our checkout methods. Recently we just switched to using a virtual dedicated server rather than the normal shared hosting environment at GoDaddy. Their shared hosting never really supported Google Checkout notifications because their shared IIS servers were configured to use [...]]]></description>
			<content:encoded><![CDATA[<p>Well this was a fun one. For <a href="http://www.onelittlebow.com" target="_blank">onelittlebow.com</a>, we&#8217;re using <a href="http://checkout.google.com/sell" target="_blank">Google Checkout</a> as one of our checkout methods. Recently we just switched to using a virtual dedicated server rather than the normal shared hosting environment at <a href="http://www.godaddy.com" target="_blank">GoDaddy</a>. Their shared hosting never really supported Google Checkout notifications because their shared IIS servers were configured to use Basic Authentication with Windows and always pre-authenticated the request. Since the merchantID and key wasn&#8217;t a valid NT account on the server IIS would always kick back a 401 response and ASP.NET wouldn&#8217;t even touch the request.</p>
<p>Now with the virtual dedicated environment, we are finally able to use these callbacks and handle the authentication header ourselves in code (or by setting up an account on the server).  But in production, we must use fully trusted SSL. That&#8217;s not a huge deal; we just purchased one of their SSL certs and installed in on our server. Easy peasy right?  Well if you&#8217;re like me and you&#8217;re not super familiar with the nitty gritty details of SSL and certificate validation, then you might be getting this error in the Integration Console on Google Checkout&#8217;s admin page.</p>
<blockquote><p>We encountered an error trying to access your server at https://somewhere.com/callback_endpoint &#8212; the error we got is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target</p></blockquote>
<p><span id="more-217"></span>When you pull it up in a browser, everything &#8216;seems&#8217; fine, but I did notice Google Chrome didn&#8217;t like it too much with the big red warning page about its invalid certificate. Not really understanding why, I started asking questions on the forums and to Google Checkout&#8217;s support. They came back instructing me to fully install the certificate path. Soon after, I found this <a href="http://help.godaddy.com/topic/236/article/4875" target="_blank">useful article on GoDaddy’s support website</a>.  You can find links for <a href="http://help.godaddy.com/topic/236" target="_blank">IIS 5 and IIS 7 here</a>.</p>
<p>Basically, this article walks through the process of setting it up on your IIS6 server. The issue I had was related to not installing the intermediate certificates along with my IIS certificate. I also had to disable a previously installed root certificate.</p>
<p>After that, all was well. Our Google notifications started working the second we re-enabled them, and my browsers fully trusted our certificate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.integratedwebsystems.com/2009/05/unable-to-find-valid-certificate-path-for-google-checkout-notification-on-iis6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight, WCF, and Streaming My Personal Music Repository from IIS</title>
		<link>http://www.integratedwebsystems.com/2009/04/silverlight-wcf-and-streaming-my-personal-music-repository-on-the-go/</link>
		<comments>http://www.integratedwebsystems.com/2009/04/silverlight-wcf-and-streaming-my-personal-music-repository-on-the-go/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 04:34:25 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[streaming]]></category>

		<guid isPermaLink="false">http://www.integratedwebsystems.com/?p=161</guid>
		<description><![CDATA[Updates I&#8217;ve recently posted a new article continuing this topic:  Silverlight, WCF REST and Streaming My Personal Music Repository from a Standalone EXE , which as an updated client with regex search and random play functionality. A buddy of mine recently had mentioned he wanted a web based program he could use to listen to [...]]]></description>
			<content:encoded><![CDATA[<h3>Updates</h3>
<p>I&#8217;ve recently posted a new article continuing this topic:  <a rel="bookmark" href="http://www.integratedwebsystems.com/2010/04/part-2-silverlight-wcf-rest-and-streaming-my-personal-music-repository-from-a-standalone-exe/">Silverlight, WCF REST and Streaming My Personal Music Repository from a Standalone EXE</a> , which as an updated client with regex search and random play functionality.</p>
<p><img style="display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;" title="image" src="http://www.integratedwebsystems.com/wp-content/upload/image-thumb.png" border="0" alt="image" width="406" height="484" align="right" /></p>
<p>A buddy of mine recently had mentioned he wanted a web based program he could use to listen to his music from home.  As a contractor, we move around a lot. At some locations, we can’t install any software; others, we have firewall issues. Our mobile devices couldn’t hold every song we stored at home, and copying our music around everywhere just didn’t seem like a great idea.  So we thought… wouldn’t it be cool if we could have just a simple website that could stream our music from anywhere? It’s an easy install…</p>
<p>So I started digesting the idea and thought yeah, we could do that.  At first we’ll have to just use something simple like streaming the files directly from IIS in a silverlight music player of sorts.  But eventually, we can really take advantage of some cool WCF hosting features in windows and not require IIS at all, which would be great for most of us since everyone doesn’t have a windows server sitting around at home. After a tiny bit of research, I realize we could also take advantage of the Media Services component built into windows server and IIS, which from the sound of it are pretty comprehensive. But with our end goal in mind, we’ll want to find a way to stream it right out of a simple windows app available to any edition of Windows.</p>
<p>Having said all that, I decided to start writing about this little toy project.  To begin, we have a simple Silverlight application with a music player, list manager, and an IIS server hosting a virtual directly to our mp3 repository.</p>
<h3><span id="more-161"></span></h3>
<h3>Getting Started</h3>
<p>Of course you’ll need all the links and references to some handy Silverlight information.</p>
<p><a title="http://silverlight.net/GetStarted/" href="http://silverlight.net/GetStarted/">http://silverlight.net/GetStarted/</a> is an excellent starting point.</p>
<p>You may need the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&amp;displaylang=en" target="_blank">Silverlight Tools for Visual Studio 2008 SP1</a>.</p>
<p>I’m using Expression Blend 2, and for my project templates to be correct, I needed <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=EB9B5C48-BA2B-4C39-A1C3-135C60BBBE66&amp;displaylang=en" target="_blank">Expression Blend 2 SP1</a>.</p>
<p><a title="Sample files for streaming mp3 to silverlight from IIS" href="http://www.integratedwebsystems.com/wp-content/upload/musiccenter.zip">Download the Sample</a></p>
<p>So here we have our simple player. It has a stop and play button and a list box.  It’s very, very, very simple.  The idea is to load the music list on startup, then as we choose an item in the list, it plays.  It also will auto-play the next song in the list when the current song ends, and it will recycle the whole list when the last song in the list ends. There are a TON of cool things we can do with this, but for now, we’re starting simple.</p>
<p>I started out by creating a new Silverlight Application in Expression Blend.  If you don’t have Expression Blend, you can create a new Silverlight Application using Visual Studio with Silverlight Tools. This creates a class library containing the Silverlight controls along with a website project containing sample run pages to load and test your Silverlight application. In this case, our project name is MusicPlayer and the auto-generated web project name is MusicPlayer.Web.</p>
<h3>The Player</h3>
<p>Add a new Silveright User Control to the MusicPlayer project called Player. Here’s the XAML for our new control.</p>
<pre class="brush: xml;">&lt;UserControl x:Class="MusicPlayer.Player"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="513" Height="613" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Name="ContentPanel"&gt;
    &lt;Grid x:Name="LayoutRoot" Background="#343434"&gt;
        &lt;MediaElement x:Name="MediaElement1" Margin="0,0,103,0" Height="26" VerticalAlignment="Top" Width="109" HorizontalAlignment="Right" AutoPlay="True" /&gt;
        &lt;Button HorizontalAlignment="Left" Width="95" Content="Stop" x:Name="uxStop" VerticalAlignment="Top" Height="26" /&gt;
        &lt;Button Content="Play" x:Name="uxPlay"  Height="26" VerticalAlignment="Top" Width="99" HorizontalAlignment="Right" MinHeight="0" UseLayoutRounding="True"/&gt;
        &lt;ListBox Margin="0,30,0,0" x:Name="uxPlayList" Background="#FF000000" BorderBrush="#FF345CA4" Foreground="#FF8FC0FF" Opacity="0.41"/&gt;
        &lt;TextBlock Margin="99,0,103,0" VerticalAlignment="Top" Text="" TextWrapping="Wrap" Foreground="#FFAEAEAE" x:Name="uxStatus" Height="30"/&gt;
    &lt;/Grid&gt;
&lt;/UserControl&gt;</pre>
<p>This should give you something similar to the control shown above. Start wiring up events for the simple things like the buttons and such. For their click event, you can control the MediaElement by asking it to Play(), Stop(), Pause(), etc.    I included a text block that just shows the current state of the media element.  Use the CurrentStateChanged event on the MediaElement to update its value.</p>
<h3><img class="alignright size-full wp-image-139" title="image.png" src="http://www.integratedwebsystems.com/wp-content/upload/image3.png" alt="image.png" width="259" height="181" align="right" /></h3>
<h3>Getting the Playlist</h3>
<p>Before we get into loading the list control, we’ll need to define its WCF services. I designed a very simple structure to handle the information we need for our Music in this exercise. For now, it contains only a list of filenames and their relative path to the root of the mp3 repository. It also contains the public web path configured on the server.</p>
<p>MusicManagerService will have one function for now: GetFiles(), which will return a FileBrowser filled with the information from the MP3 repository. Simple enough…</p>
<p>Within the FileBrowser we have our implementation of the LoadFiles() function where it actually seeks the local repository and collects its information.</p>
<p><strong> </strong></p>
<p><strong>//FileBrowser.cs</strong></p>
<pre class="brush: csharp;">public void LoadFiles()
{
    if (!string.IsNullOrEmpty(LocalMusicRoot) &amp;&amp; Directory.Exists(LocalMusicRoot))
    {
        if (this.Files == null)
            this.Files = new List&lt;string&gt;();

        this.Files.Clear();

        this.Files.AddRange(Directory.GetFiles(this.LocalMusicRoot, "*.mp3", SearchOption.AllDirectories));
        this.Files.AddRange(Directory.GetFiles(this.LocalMusicRoot, "*.wma", SearchOption.AllDirectories));

        //trim off the full path; leave only the relative one.
        List&lt;string&gt; newFiles = new List&lt;string&gt;();
        foreach (string file in this.Files)
        {
            newFiles.Add(file.Replace(LocalMusicRoot, string.Empty).Replace('\\','/'));
        }
        this.Files = newFiles;
    }
    else
        throw new ApplicationException("Cannot continue. No directory specified or the directory does not exist.");
}</pre>
<h3>WCF Setup</h3>
<p>The easiest way to do this is to add a new Silverlight-enabled WCF Service to your web project.  Change its service contract to resemble the following snippet.  This will also automatically configure your web.config as well. The funny thing about the Silverlight enabled web service is that it mixes the contract interface with the class implementation. You can optionally separate this out into a WCF library in a more traditional approach using the interface and class implementation separated. We’ve done this in our downloadable sample code.</p>
<pre class="brush: csharp;">[ServiceContract()]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MusicManager
{
    [OperationContract]
    public FileBrowser GetFiles()
    {
        FileBrowser fb = new FileBrowser();
        fb.LocalMusicRoot = Properties.Settings.Default.LocalRootPath;
        fb.WebMusicRoot = Properties.Settings.Default.WebRootUrl;
        fb.LoadFiles();

        fb.LocalMusicRoot = null; //clearing unnecessary local path from return value
        return fb;
    }
}</pre>
<p>You should be able to browse MusicManager.svc and see the service page. You can also reference the service in the MusicPlayer silverlight project. In the ContentPanel Loaded event, we will call out to the service.</p>
<pre class="brush: csharp;">private void ContentPanel_Loaded(object sender, RoutedEventArgs e)
{
    //load up the music files.
    MusicManagerService.MusicManagerServiceClient client = new MusicManagerService.MusicManagerServiceClient();
    client.GetFilesCompleted += new EventHandler&lt;MusicPlayer.MusicManagerService.GetFilesCompletedEventArgs&gt;(client_GetFilesCompleted);
    client.GetFilesAsync();
}</pre>
<p>Our async callback function for the service call will populate the list control.</p>
<pre class="brush: csharp;">void client_GetFilesCompleted(object sender, MusicPlayer.MusicManagerService.GetFilesCompletedEventArgs e)
{
    this.uxPlayList.Items.Clear();
    _Browser = e.Result;

    foreach (string file in _Browser.Filesk__BackingField)
    {
        this.uxPlayList.Items.Add(file);
    }
}</pre>
<p>To finish up, add implementation for the selected index changed on the list control to change the MediaElement’s Source to the selected file with its web path. For convenience, we AutoPlay to true on our MediaElement to autoplay its media. Anytime the Source property changes values, it will begin streaming and playing the audio.</p>
<pre class="brush: csharp;">private void uxPlayList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    //start streaming the file.
    MediaElement1.Source = new Uri(_Browser.WebMusicRootk__BackingField + uxPlayList.SelectedItem.ToString());
}</pre>
<p>When the media ends, we need to increment the playlist selection.</p>
<pre class="brush: csharp;">private void MediaElement1_MediaEnded(object sender, RoutedEventArgs e)
{
    //move to the next item
    int ix = uxPlayList.SelectedIndex;
    ix++;

    if (ix &gt;= uxPlayList.Items.Count)
        ix = 0;

    uxPlayList.SelectedIndex = ix;
}</pre>
<h3>Wrap Up</h3>
<p>So the end result will be our player initializing by pre-loading a playlist. Once the first song is played, the rest will auto-play as they increment through the list. With my MP3’s on a cable connection I’ve noticed it’s uploading around around 60KB/s.  So as long as the location you’re at can tolerate a little bit of bandwidth, it’s a pretty good start to a little remote music player. You might even be able to throttle IIS down so it doesn’t saturate the wire.</p>
<h3>Next Time</h3>
<p>The next round will be using a restful http request via WCF 3.5 to stream audio files rather than straight up IIS.  You can read more about that here:</p>
<p><a rel="bookmark" href="http://www.integratedwebsystems.com/2010/04/part-2-silverlight-wcf-rest-and-streaming-my-personal-music-repository-from-a-standalone-exe/">Part 2 – Silverlight, WCF REST and Streaming My Personal Music Repository from a Standalone EXE</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.integratedwebsystems.com/2009/04/silverlight-wcf-and-streaming-my-personal-music-repository-on-the-go/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iSeries ADO.Net Provider and Common FAQ Links</title>
		<link>http://www.integratedwebsystems.com/2009/03/iseries-adonet-provider-and-common-faq-links/</link>
		<comments>http://www.integratedwebsystems.com/2009/03/iseries-adonet-provider-and-common-faq-links/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 13:57:14 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[ADO.Net]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[iSeries]]></category>

		<guid isPermaLink="false">http://www.integratedwebsystems.com/?p=89</guid>
		<description><![CDATA[These links might come in handy.  It&#8217;s the ADO.NET provider for iseries dB2 and has links to the VS Add Ins.   I think you need a login to download some of them.  And it says that they&#8217;re looking at a LINQ to iSeries provider via Entity Framework. IBM .Net downloads IBM .NET FAQ To get [...]]]></description>
			<content:encoded><![CDATA[<p>These links might come in handy.  It&#8217;s the ADO.NET provider for iseries dB2 and has links to the VS Add Ins.   I think you need a login to download some of them.  And it says that they&#8217;re looking at a LINQ to iSeries provider via Entity Framework.</p>
<p><a href="http://www-01.ibm.com/software/data/db2/ad/dotnet.html" target="_blank">IBM .Net downloads</a></p>
<p><a href="http://www.ibm.com/developerworks/wikis/display/DB2/DB2+and+.NET+FAQs" target="_blank">IBM .NET FAQ</a></p>
<p>To get a description of files, schemas, columns, you can use the views under QSYS2. I noticed some nice views that bring together the physical files and logical files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.integratedwebsystems.com/2009/03/iseries-adonet-provider-and-common-faq-links/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
