Using Microsoft’s Free Visual Web Developer to create LAMA ready sites

 

This is part of the LAMA – Best of all worlds tutorial
LAMA Tutorial Home Page

Microsoft Visual Web Developer 2005

Visual Web Developer is a free version of Visual Studio, that just does web projects.  For this tutorial we will be using VWD 2005, because it is .net 2.0 based, and Mono’s 2.0 base is very extensive – so most projects will work ‘out of the box’.

Using VWD along with your LAMA server is a great way to create and host websites for free!

Download from Microsoft’s Website.

http://www.microsoft.com/express/2005/download/default.aspx

Create a sample Asp.Net Project

Partial Class _Default

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As ObjectByValAs System.EventArgs) HandlesMe.Load

Response.Write(“My LAMA Server is Working!”)

End Sub

End Class

3.) Run the project in VWD.  You should see My LAMA Server is Working!

C# or VB.net & Precompiling the Project

It seems that Mono has extensive support for C#.  So anything you write in C# should compile and run right in Mono.

VB is a different story.  It seems that the VB compiler for Mono is a bit behing the C# counterpart.  There is a way around this though, By pre-compiling your VB.net site.

Visual Web Developer does not include a precompilation tool for it’s web sites, but you can use the DoTheWeb.net Asp.net Precompilation tool. 
This tool is a simple GUI interface for the .net asp.net precompilation command line utility.

Note for VB.net users!!
You must precompile your website project for it to work successfully in your LAMA server. 

Click here to run the DoTheWeb.net Asp.net Precompiler

 

 

Copy your website into your LAMA shared folder

Once you have a simple Asp.net project ready.  Copy it into the asp_net share on your LAMA server.

If you used the DoTheWeb.net precompiler,  you can enter your LAMA server as the destintion path, and your compiled project will be copied right into your LAMA server.

1.) Open your network places and type: \\{your LAMA IP address}
You should see the asp_net folder

2.) Copy your project folder (\testsite) over to the asp_net folder

Now we will have to setup Apache on our LAMA server to see our site.

Next .. Configure Apache for Asp.net Site

 

Configuring Samba on your Ubuntu LAMA Server

 

This is part of the LAMA – Best of all worlds tutorial
LAMA Tutorial Home Page

Samba File Server

During your install of Ubuntu 8.04 server, one of the install options was Samba File server.  This allows you to setup “shares” on your Ubuntu LAMA server for easy file transfer from your Windows machine.

To setup Samba, we will be making changes to the smb.conf file, samba’s configuration file.

To get started:
Use Putty to connect to your LAMA server.

First lets make a directory that we can share, and set the group and permissions

sudo mkdir /asp_net
sudo chgrp admin /asp_net
sudo chmod g+w /asp_net

Now onto our smb.conf file:

1.) It is always best to make a copy of your existing smb.conf file – just in case.

cd /etc/samba/

 

sudo cp smb.conf old_smb.conf

2.)Open the smb.conf in your favorite text editor.  We will use pico.

sudo pico smb.conf

3.)Put the following lines at the end of the smb.conf file,  This will setup simple permissions for the admin group of Ubuntu server.  For more information on Samba configuration, see Samba’s web site.

            
    [asp_net]
           comment = Asp.net app folder
           path = /asp_net/
           read only = no
           valid users = @admin
           write list = @admin
           browseable = yes

4.) CTRL-X to close, Y to save the file

5.) Restart Samba

sudo /etc/init.d/samba restart

Setting up the User for Samba

Samba needs to know the password for your username.  This is the username that you setup during installation, by default Ubuntu puts your username in the admin group.

sudo smbpasswd {your username}

then it will ask you for your current password.

Then Samba should be ready.  To test, open up your network places and put \\{your-ubuntu-ip-address} in the address bar.

You should see asp_net folder.  Double click, and try to make a new folder in asp_net.
If you can, then you completed samaba configuration successfully.

If not check the smb.conf file for any mistakes, and restart samba. (sudo /etc/init.d/samba restart)

Next .. Setting up your Web Developer Studio for LAMA Sites

 

Installing Mono on your Ubuntu 8.04 LAMA Server

 

This is part of the LAMA – Best of all worlds tutorial
LAMA Tutorial Home Page

The Script

DoTheWeb.net has put together a script for you to help with your Mono source install.  With help fromSean’s Mental Walkabout Mono Script and some changes to make it Ubuntu specific.  This script will download all necessary software required to compile and install mono.

It will also download and install the mod_mono apache module, and setup your apache to recognize Asp.net websites.

This script is specific to Ubuntu 8.04LTS. It may work on other Ubuntu verisions but has not been tested.

To get started:
Use Putty to connect to your LAMA server.

Run the following commands from the Ubuntu command line:

1.)Download the script from DoTheWeb.net

sudo wget http://www.dotheweb.net/lama/monoinstall.sh

2.) Run the script

sudo sh monoinstall.sh

This will start alot of commands.  You will have to watch it for the first few minutes to tell the package manager to download needed packages.

When it is done downloading packages, it will go out to the internet and download the source files and compile.  This will take some time.  

At the end of the script, you should have a complete working LAMA server.

 

Next in tutorial: .. Setting up Samba File sharing to copy your windows files to your LAMA server

 

Getting your Ubuntu Server Hardy Heron installation Asp.net Ready

 

This is part of the LAMA – Best of all worlds tutorial
LAMA Tutorial Home Page

Ubuntu Server 8.04 LTS

Ubuntu just released thier newest version,  8.04 LTS.  This is what we are going to use for our LAMA server.
Download Ubuntu Server from Ubuntu’s Web Site

It will be an ISO image.  Burn this ISO to a CD.

If you dont have a spare computer around, but still want to test out your LAMA server,  download 
VMware Server, free edition from VMware Server Site and install Ubuntu 8.04 server in a virtual server. 

Please see Ubuntu’s site for System requirements for your hardware.

Install Options
During your install of Ubuntu,  you will be asked many questions.  Most of them are self-explanitory.  When it asks about what features you want with your server install choose:
-Lamp Server (Installs Apache, Mysql, and PHP)
-OpenSSH Server (For connecting remotely to your server via Putty)
-Samba File Server (To copy files easily from Windows to your Server)

 

Setting up Mono and Apache for Asp.net

To get to the latest version of Mono, we are going to install Mono from source and compile.  Scary?  No.  Not with these simple steps. Just follow the steps, it does take some time to compile, but you will get thru it.

Once you have your install of Ubuntu 8.04 server ready, click to the next page to get started with the Mono Installation.

Next .. Installing Mono onto your LAMA Server

 

Building a Setup Package for your Windows Service

 

If you want to install your Service on other PC’s.  The you want to make an Installer Package.

 

Build the Setup Package for Your Windows Service:

Prerequisites:  You will need to have .net 3.5 on the target pc.

Choose File> Add> New Project.

serviceblank

At the Add New Project window, Choose:

 

servicesetup1

 

Right click on Setup1 in Solution Explorer and choose:servicesetup2

At Add Project Output Group,  It will select NewService as the Primary Output.  Just hit OK.

Then you need to tell Setup to Install the Service.  Do this by right clicking Setup1. Choose View > Custom Actions.

Then right click Custom Actions, and choose Add Custom Action.  In Select Item in Project, double click Application Folder:

servicesetup3

 

And choose OK.  It will add one item for each custom Action:
servicesetup4

 

Next, Right click Setup1 and Build.  It will create the Setup Executable in your Projects bin\release folder.

Thats It!.  Run the Setup on the Target computer, and reboot.  It will install and run the Service on reboot.

 




Programmers – Use your talents to make some money online.  Click Here to Read More