Migration from Windows Server/IIS/SQL/ASP.NET to LMono (not LAMP and not LAMMono)
For those loyal readers of my blog, I'd like to announce a personal change of direction back to lighter, more open tools in the form of Linux, Mac OS, and Windows and Mono.
Background
It wasn't many years ago that I was enjoying burning my time by
presenting .NET tech talks at Michigan State University. While I was
on this .NET journey, I grew far away from my roots in linux and open
source. And now, as we get closer to 2008, I'm taking a slightly
different direction from the relative ease of Microsoft software to
supporting Linux and Mac OS.
I'm
building on Mono now, and look forward to writing software that will
run cross-platform (so now my friends will all be able to play with my
stuff on their macs). I've been playing with lighttpd on CentOS since
I'm already very familiar with Apache. I've installed CentOS 5.1, Ubuntu 7.10, and have an UltraVNC connection to a local G4 so I'm pretty set with regards to testing.
The migration path from Windows Server /IIS/SQL/ASP.NET to Linux/Mono and will be slow, but satisfying. I'll be describing my experiences with the migration here.
Step 1: Install alternate OS's
Download Virtual PC
Install Ubuntu 7.10 w/ GUI - Virtual PC has a problem with the default Ubuntu mouse and video resolution settings, but 1 hour of tinkering will solve it.
Install CentOS 5.1 - I decided to install CentOS because I wanted to be able to support lighttpd with FastCGI Mono plugin installed.
Get a Mac - Install VineServer for VNC connectivity.
Install UltraVNC on your Windows machine
Depending on what you want and need, install Apache or Lighttpd. Since
I'll be developing desktop software first, I'm not interested in
the web server setup until I'm ready to migrate from IIS. I've played with the FastCGI mod, but will not be going over that yet.
Step 2: Install Visual Studio Express Versions on your Windows machine
They're simpler, lighter, faster, free-er, and easier than Visual Studio Standard or Pro. While you'll be forced to seperate your Web and C# projects into Web Express and C# Express, this was a welcome forced seperation for me.
Step 3: Install Mono on alternate OS's (official site: http://www.mono-project.com/Downloads)
Ubuntu 7.10
sudo apt-get update
sudo apt-get install mono
sudo apt-get install mono-gmcs
CentOS 5.1
The built-in installer for CentOS 5.1 is called yum. If you run into any dependency issues, you can issue a command such as yum install XXX to install the XXX libraries and executables.
wget http://go-mono.com/sources/mono/mono-1.2.6.tar.bz2
tar -xjf mono-1.2.6.tar.bz2
cd mono-1.2.6
./configure
make
make install
Mac OS
Download and run the installer from http://www.mono-project.com/Downloads
Step 4: Share projects between computers and create build scripts
You can mount a windows share from Mac OS by exploring your 'Servers' tab in the Finder.
On Ubuntu, create a directory under /mnt and type: sudo mount -t cifs //192.168.1.102/SharedDirectory /mnt/SharedDirectory -o username=John,password=mySecretPassword
On CentOS, create a directory under /mnt and type: mount -t cifs //192.168.1.102/SharedDirectory /mnt/SharedDirectory -o username=John,password=mySecretPassword
The compiler for Mono (.NET 2.0) is called gmcs. I like to build a
project on Windows, then copy the project over to a shared folder
that's mounted between all the computers and execute the build command
on each of the separate computers to do unit testing.
Since I'm starting very simple, my build script is a simple gmcs command that compiles 2 projects, 1 library and 1 executable.
/mnt/SharedDirectory/build.sh
rm -r -f ./bin
mkdir ./bin
gmcs ./Directory1/SourceFile1.cs ./Directory1/Directory2/SourceFile2.cs ./Directory1/Directory2/SourceFile3.cs /d:TRACE /t:library -out:./bin/MyLibrary.dll
gmcs ./Directory1.UnitTest/Program.cs /d:TRACE /t:exe -out:./bin/MyProgram.UnitTest.exe -r:./bin/MyLibrary.dll
To run the compiled program, I then type:
mono ./bin/MyProgram.UnitTest.exe
This is the start. I'll be adding things as I go deeper down the rabbit hole. Nice to be back in the more open arena everyone.