# Getting mod_mono working...

## cshepherd

Hi all,

I'm not doing too well getting mod_mono working on apache2.

I have searched all the related threads and all those problems seem to be after the step that I'm stuck at.

Going by the Got Mono Docs I am getting stuck at  *Quote:*   

> If everything goes well, you will have the following library:
> 
> /home/user/mono/mod_mono/src/.libs/libmod_mono.so

  which is in Step 1.

I used all ebuilds.  Apache2 is already installed and running.

I then emerged mono 1.0.4 and mod_mono 1.0.4 and xsp 1.0.4

I searched for the libmod_mono.so file and can't find it.

Can someone help me out here, as in all the other threads it seems no-one has been stuck this early on yet.  Maybe it's just me   :Sad: 

----------

## thesnowman

The Mono Handbook docs refer to building xsp and mod_mono by hand.  If you are using the ebuilds from portage then that documentation will not apply.  I have a library called mod_mono.so in /usr/lib/apache2-extramodules/.

After emerging mod_mono you should just have to edit  /etc/conf.d/apache2 and add " -D MONO" to the APACHE2_OPTS line like so: 

```
APACHE2_OPTS="-D SSL -D PHP4 -D MONO"
```

Then restart apache.

----------

## pjp

Moved from Other Things Gentoo.

----------

## lisa

How I got mod_mono working:

Step 1.

emerge mono mod_mono

Step 2. Add the following to APACHE2_OPTS in /etc/conf.d/apache2

-D MONO

Step 3. Add the following to commonapache2.conf or modules.d/70_mod_mono.conf

```

<IfDefine MONO>

  <IfModule mod_mono.c>

    ProxyPass /mono/ http://your.web.server:8079/

    ProxyPassReverse /mono/ http://your.web.server:8079/

    Alias /usr/share/doc/xsp/test/ /mono/

  </IfModule>

</IfDefine>

```

Step 4.

rc-update add xsp default

/etc/init.d/xsp start

/etc/init.d/apache2 restart

----------

## cshepherd

Step 1, Done

Step 2, Done

Step 3, I changed my 70mod_mono.conf

Step 4, Was successful

I now get Service Temporarily Unavailable.

Are there any config changes I need to make to XSP maybe?

----------

## lisa

 *cshepherd wrote:*   

> Step 1, Done
> 
> Step 2, Done
> 
> Step 3, I changed my 70mod_mono.conf
> ...

 

What do the apache logs (apache_error) say ?

----------

## cshepherd

After refreshing repeatedly to see what comes up this one line is repeated;

```
[Thu Dec 16 09:33:43 2004] [error] Unknown command: 1347703880

```

EDIT: I'm also getting '500 Internal Server Error' now when trying to view test.aspx which is a basic Hello World page.

----------

## lisa

 *cshepherd wrote:*   

> After refreshing repeatedly to see what comes up this one line is repeated;
> 
> ```
> [Thu Dec 16 09:33:43 2004] [error] Unknown command: 1347703880
> 
> ...

 

try accessing the xsp server directly.

then

try putting the three lines in commonapache2.conf.

----------

## cshepherd

Sorry for my n00bness.  How would I access the xsp server directly?

----------

## lisa

 *cshepherd wrote:*   

> Sorry for my n00bness.  How would I access the xsp server directly?

 

http://ip.of.server:xspport/   <-- check xsp conf.d file for port

----------

## cshepherd

Page returns the following;

```
Server error in '/' application

Description: Error processing request.

Error Message: HTTP 500.

Stack Trace:

System.InvalidOperationException: Process has not been started.

in <0x0003b> System.Diagnostics.Process:get_ExitCode ()

in <0x00050> (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ExitCode ()

in <0x002bd> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[])

in <0x0044a> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromDomBatch (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[])

in <0x00050> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromDom (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit)

in <0x00171> System.Web.Compilation.CachingCompiler:Compile (System.Web.Compilation.BaseCompiler)

in <0x002ea> System.Web.Compilation.BaseCompiler:GetCompiledType ()

in <0x00251> System.Web.Compilation.AspGenerator:GetCompiledType ()

in <0x00070> System.Web.UI.ApplicationFileParser:GetCompiledApplicationType (string,System.Web.HttpContext)

in <0x00047> System.Web.HttpApplicationFactory:CompileApp (System.Web.HttpContext)

in <0x00032> System.Web.HttpApplicationFactory:InitializeFactory (System.Web.HttpContext)

in <0x0007a> System.Web.HttpApplicationFactory:GetInstance (System.Web.HttpContext)

in <0x0010a> System.Web.HttpRuntime:InternalExecuteRequest (System.Web.HttpWorkerRequest)

```

The address that I'm using is http://192.168.0.7:8001/test.aspx

and the contents of test.aspx are;

```
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

  <title>ASP.NET Hello World</title>

<head>

<body>

  <p><asp:Label id="label1" runat="server" text="Hello World"></asp:Label></p>

</body>

</html>

```

----------

## lisa

 *cshepherd wrote:*   

> Page returns the following;
> 
> ```
> Server error in '/' application
> 
> ...

 

dunno then.  Ask the dotnet folks.

----------

## cshepherd

Any ideas dotnet folks?

----------

## guzik

```
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
```

wouldn't your problem be in the language you are using for your asp.net?  i think you might have to stick with c#, considering mono is a port of c# not vb.  just a thought.  your error seems to mention this as well.

eitherway check it out.

----------

## cshepherd

Ahh, ok.  I wasn't aware of that.

Is there anyway to get VB working.

I've got a bunch of ASP.NET pages in VB that I want to move to my gentoo box.

----------

