Last updated: October 20, 2003

INSTALLING mod_mono
--------------------

  The following are instructions on getting mod_mono working with
  Apache, either 1.3 or 2. Once you set it up, Apache will be able to
  serve ASP.NET pages.

  You will need:
    * mono (http://www.go-mono.com)
    * apache 1.3 or 2 and its development package. Usually called
    apache2-dev, apache-dev... If you want to install this from source
    see Appendix A.
    * Latest xsp and mod_mono tarballs (http://go-mono.com/download.html)

  Then follow these steps to install everything in /usr:

    1. Install xsp.
    
       tar -xzvf xsp-X.X.tar.gz
       ./configure --prefix=/usr
       make
       make install

    2. Install mod_mono.

       tar xvfz mod_mono*.tgz
       cd mod_mono*
   (*) ./configure --prefix=/usr
       make
       make install

       (*) If it complains about not finding apxs because you installed
       apache in a non-common directory, use the --with-apxs argument.
       Example:

         ./configure --prefix=/usr --with-apxs=/home/user/httpd/bin/apxs

       (Apache 2 only) If the you get errors while compiling due to
       apr.h header not found, you'll need to use the --with-apr-config
       option and provide the full path to 'apr-config':

         ./configure --prefix=/usr --with-apr-config=/usr/bin/apr-config

    3. Configure apache.

       Edit your httpd.conf adding these lines:

AddType application/x-asp-net .aspx .ashx .asmx .ascx .asax .config .ascx
LoadModule mono_module /home/gpanjav/apache2/modules/mod_mono.so
MonoUnixSocket /tmp/mod_mono_server

       If you want to test the xsp samples (and you *want* :), add:

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

    so that apache redirects requests from, for example, /mono to /mono/ .
    
    The parameter of MonoUnixSocket is the unix socket filename that will
    be set up by mod-mono-server. You can use any valid file name here.  Just
    use the same file in httpd.conf and in mod-mono-server.exe (--file argument
    or UnixSocketFileName in mod-mono-server.exe.config <appSettings>).

    Additionally, if you want to make apache listen on port 8080, which
    is also used as default port by xsp, add this line:

           Listen 8080

    to your httpd.conf.
    
    
    IMPORTANT:
    
	Make sure that both apache and mod-mono-server have write
	permission to that file.
	
	You can achieve this by running mod-mono-server under the same
	user as apache or changing the permissions of the socket file
	(/tmp/mod_mono_server by default) to 666, ie., run "chmod 666
	/tmp/mod_mono_server", *after* mod-mono-server is started.


    4. Run mod-mono-server.
    
       We're gonna test now the set of samples included in xsp. They
       should be, after step 1, in /usr/share/doc/xsp/test.

        cd /usr/share/doc/xsp/test
	mono /usr/bin/mod-mono-server.exe --root . --applications /mono:.

       The --root argument tells mod-mono-server to change the directory
       to this one before anything else.

       The --applications argument makes mod-mono-server set up an
       application that will be seen from apache as if it was in
       /mono/ virtual directory.

     5. Restart apache.
     6. Point your browser to http://127.0.0.1:8080/mono/index.aspx (if
     you used the Listen 8080 directive) or just
     http://127.0.0.1/mono/index.aspx.
     
   And that's all.

       
APPENDIX A: installing Apache from source
------------------------------------------

    Go to http://www.apache.org and download Apache 2, the filename will
    be something like httpd-2.0.43.tar.gz

    Unpack it:

      tar xvfz httpd-2.0.43.tar.gz
      cd httpd-2.0.43
      ./configure --prefix=/home/username/apache2 --enable-so
      make 
      make install

CREDITS
--------

  Daniel Lopez Ridruejo <daniel @ rawbyte.com> 
  http://www.apacheworld.org

  Gonzalo Paniagua Javier <gonzalo @ ximian.com>

