[Mono-list] virtual host

LC listmono at gmail.com
Fri Dec 23 22:47:53 EST 2005

> See if this tutorial helps you
> http://www.joeaudette.com/settingupapachevirtualhostswithmod_mono


1) I had followed the instructions and edited monoprod.conf  to
testing.com.conf in /etc/httpd/conf.d/ as follows:-

<VirtualHost *:80>
    ServerAdmin postmaster at testing.com
    ServerName aspx.testing.com
    DocumentRoot "/home/www/test1/html/aspx"
    HostnameLookups Off
    UseCanonicalName On
    MonoApplications aspx "aspx.testing.com:/:/home/www/test1/html/aspx"
    MonoExecutablePath mojoprod /usr/bin/mono
    # This uses ASP.NET 1.1 mod-mono-server
    MonoServerPath mojoprod /usr/lib/xsp/1.0/mod-mono-server.exe
    # This uses ASP.NET 2.0 mod-mono-server
    # MonoServerPath mojoprod /usr/lib/xsp/2.0/mod-mono-server2.exe
    <Directory "/home/www/test1/html/aspx">
        MonoSetServerAlias aspx
        SetHandler mono
        <FilesMatch "\.(gif|jp?g|png|css|ico|xsl|wmv|zip)$">
                SetHandler None
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all

2) I downloaded a helloworld.aspx to test. Script as follows:-

<%@ Page Language="VB" %>
<script language="VB" runat="server">
' There are a lot of different ways to do this so I'm going
' to show you a couple of them all in this one sample.
' That way you can choose whichever method works best for
' your particular situation.
Sub Page_Load(sender as Object, e as EventArgs)
Dim I As Integer

' Method 2 coding
Dim strText
For I = 1 To 5
strText = strText & "<font size=""" & I & """>Hello World</font><br />" &
Next I
lblHelloWorld2.Text = strText

' Method 3 coding
Dim myStringBuilder As New StringBuilder
For I = 1 To 5
myStringBuilder.Append("<font size=""" & I & """>Hello World</font><br />" &
Next I
lblHelloWorld3.Text = myStringBuilder.ToString

' Method 4 coding
Dim lblMessage as Label
For I = 1 To 5
lblMessage = New Label()
lblMessage.Text = "<font size=""" & I & """>Hello World</font><br />" &
' Conflicts with method 1 - remove inline <% %>
' coding and then uncomment this line.
Next I
End Sub
<title>ASP.NET Hello World Sample</title>
<h2>Method 1 - just like &quot;classic ASP&quot;</h2>
' Loop from 1 to 5 incrementing font size.
Dim I
For I = 1 To 5
Response.Write("<font size=""" & I & """>Hello World</font><br />" & vbCrLf)
Next I
<hr />
<h2>Method 2 - String Concatenation</h2>
<asp:Label id="lblHelloWorld2" runat="server" />
<hr />
<h2>Method 3 - StringBuilder</h2>
<asp:Label id="lblHelloWorld3" runat="server" />
<hr />
<h2>Method 4 - Dynamic Server Controls</h2>
Conflicts with method 1 - remove inline &lt;% %&gt;
coding and then uncomment the indicated line in the
Page_Load sub to play with this method.

3) Browse to aspx.testing.com and got the error as follows:-

Description: Error processing request.
Error Message: HTTP 500.
Stack Trace: System.InvalidOperationException: Process has not been started.
in <0x0005c> System.Diagnostics.Process:get_ExitCode ()
in (wrapper remoting-invoke-with-check)
System.Diagnostics.Process:get_ExitCode ()
in <0x001b7> Microsoft.VisualBasic.VBCodeCompiler:CompileFromFileBatch
(System.CodeDom.Compiler.CompilerParameters options, System.String[]
in <0x00022>
(System.CodeDom.Compiler.CompilerParameters options, System.String[]
in <0x002f5> Microsoft.VisualBasic.VBCodeCompiler:CompileFromDomBatch
(System.CodeDom.Compiler.CompilerParameters options,
System.CodeDom.CodeCompileUnit[] ea)
in <0x00022>
(System.CodeDom.Compiler.CompilerParameters options,
System.CodeDom.CodeCompileUnit[] ea)
in <0x0003c> Microsoft.VisualBasic.VBCodeCompiler:CompileAssemblyFromDom
(System.CodeDom.Compiler.CompilerParameters options,
System.CodeDom.CodeCompileUnit e)
in <0x00121> System.Web.Compilation.CachingCompiler:Compile
(System.Web.Compilation.BaseCompiler compiler)
in <0x00259> System.Web.Compilation.BaseCompiler:GetCompiledType ()
in <0x000fa> System.Web.Compilation.AspGenerator:GetCompiledType ()
in <0x00029> System.Web.UI.PageParser:CompileIntoType ()
in <0x00011> System.Web.UI.TemplateControlParser:GetCompiledInstance ()
in <0x00035> System.Web.UI.PageParser:GetCompiledPageInstance (System.String
virtualPath, System.String inputFile, System.Web.HttpContext context)
in <0x00010> System.Web.UI.PageHandlerFactory:GetHandler
(System.Web.HttpContext context, System.String requestType, System.String
url, System.String path)
in <0x001e3> System.Web.HttpApplication:GetHandler (System.Web.HttpContext
in <0x0085d> System.Web.HttpApplication+<Pipeline>__1:MoveNext ()

Is this script not compatible with  mono or my mono is broken?


More information about the Mono-list mailing list