.net 2.0 + mono + ubuntu

technical

assumes apache2 installed via apt-get

apt-get install mono-apache-server2
apt-get install libapache2-mod-mono
a2enmod mod_mono
/etc/init.d/apache2 restart

edit the virtualhost file or httpd.conf file and add this to the end. In the case of virtualhost, for some reason this must reside outside of the tags.

        MonoPath default "/usr/lib/mono/2.0"
        MonoServerPath default /usr/bin/mod-mono-server2
        AddMonoApplications default "/:/var/www"
        <location>
                MonoSetServerAlias default
                SetHandler mono
        </location>

create a file called NumberService.asmx and place the following code:

<%@ WebService Language="C#" Class="MathService.MathService" %>

using System;
using System.Web.Services;

namespace MathService
{
	[WebService (Namespace = "http://mono.local/NumberService")]
	public class MathService : WebService
	{
		[WebMethod]
		public int AddNumbers (int number1, int number2)
		{
			return number1 + number2;
		}

		[WebMethod]
		public int SubtractNumbers (int number1, int number2)
		{
			return number1 - number2;
		}
	}
}
No Comments

Mac Server 10.5 + Postgres + PHP

technical

install postgres from binary distribution (enterprisedb packaged)
install apache2
install php5

tar -xvf php-5.2.6.tar.gz
cd php-5.2.6
./configure –with-pgsql=/Library/PostgreSQL/8.3 –with-apxs2
make
cp libs/libphp5.so /usr/libexec/apache2
cd /usr/sbin
cp httpd httpd.original
lipo httpd -thin i386 -output
apachectl configtest
apachectl graceful

No Comments
Newer Posts »