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

Building and Installing Windows Service Visual Studio 2008

 

You cannot just hit Run and debug your Windows Service.  That would be really cool, but it is not that hard to get it running.

Build and Install service on your pc:

Choose Build in the Menubar above and choose Build NewService.

serviceblank

This will build your executable in the bin\release folder of your project.  If you try to run the program by itself, it will not run and give you an error.  Instead you have to load the service into your computer by using InstallUtil.exe.

You can run InstallUtil.exe from the VisualStudio Command Prompt.

servicecmd

Installing:

InstallUtil “PATH_TO_YOUR_EXE.exe”

Uninstalling:

InstallUtil “PATH_TO_YOUR_EXE.exe” /U

When you run in the command window, you will see alot of text, and at the bottom it should read:

The Commit phase completed successfully. 
The transacted install has completed.

Now we have to start the service in Service Manager. –  Right click on My Computer on the Desktop, and choose Manage.

 

servicemanage

Choose Services and Applications, Services, and New Service:
servicemanager

Right click and Choose Start.

Then Go to EventViewer, Application and you should see a log for service starting, and after 10 seconds you should see your ‘Service Running” log entry
servicelog

Now you have a running Service.  Don’t forget to stop it.  You dont want to fill your Event log up!  We set the service to Automatic in Part 2, so you may want to uninstall using InstallUtil.exe to remove from your system.

Next we will build a Setup package so you can install easily on computers that are not running Visual Studio.

Services Part 4:>  Build Setup Package for your Windows Service

 

 

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

Creating Needed Installers for Windows Services

 

This is not the Actual “Installer”. This is code needed for the Service to operate correctly.

We will get to Installing and Deploying Later…

 

Add the Installer Code:

From Service1 designer, right click in the gray area and choose Add Installer.

serviceblank

Another file will be added to your Solution Explorer, called ProjectInstaller.  On this class will be to components in the designer, ServiceProcessInstaller1, and ServiceInstaller1.

Lets configure the Installer:  Click on the listed component and alter the following properties:

ServiceProcessInstaller1:

  • Account = LocalSystem   (will cause service to run under local service account)
  • serviceProperties1

    ServiceInstaller1

  • ServiceName = NewService
  • StartType = Automatic     (Whether your service will auto start after reboot)
  • DisplayName =  NewService
  • serviceProperties2

    Now we will Build and Install the service to test it out.

    Services Part 3:>  Build and Install your Windows Service

     

     

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