View Single Post
  #1  
Old 10th October 2007, 20:29
rusvdw rusvdw is offline
Junior Member
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile ISPConfig and Mono

Been struggling with getting asp.net working with mono in ISPConfig on my Ubuntu Edgy box for a couple of days now. Just got it working, so thought i'd best post the configs here for others in need (and probably myself again when I screw everything up).

Let me also state that I'm no expert at this, this is just what happens to have worked for me.

Firstly, make sure you've got mod_mono installed and working with apache2 before trying this. See http://timanisblog.com/2007/07/22/in...ons-in-ubuntu/ for instructions on doing so.

Next, get into your ISPConfig administrators panel, click on the site you wish to enable mono for and enter the following in the "Apache Directives
(Optional)" field:

Code:
MonoAutoApplication enabled
MonoDocumentRootDir "/var/www/web1/web/"
MonoServerPath example "/usr/bin/mod-mono-server2"
MonoApplications example "/:/var/www/web1/web/"
Alias /mono "/var/www/web1/web/"
<Directory /var/www/web1/web/>
SetHandler mono
MonoSetServerAlias example
AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx
</Directory>
Of course you should make sure that you change "example" to a string that's relevant for you. Do not put the full hostname in there (e.g. example.com). Doing so was what kept me busy with this for 2 days You should also of course make sure that the "/var/www/web1/web/" part reflects the correct path for the website you're enabling mono for.

Be aware that if the stuff you entered has errors, ISPConfig won't tell you about it. You may want to check the /etc/apache2/vhosts/Vhosts_ispconfig.conf file to make sure that what you entered is indeed being saved in the hosts file.

As a final example, your Vhosts_ispconfig.conf should look something like this after completing the steps above:

Code:
###################################
#
# ISPConfig vHost Configuration File
#         Version 1.0
#
###################################
#
NameVirtualHost 123.123.123.123:80
<VirtualHost 123.123.123.123:80>
  ServerName localhost
  ServerAdmin root@localhost
  DocumentRoot /var/www/sharedip
</VirtualHost>
#
#
######################################
# Vhost: www.example.co.za:80
######################################
#
#
<VirtualHost 123.123.123.123:80>
MonoAutoApplication enabled
MonoDocumentRootDir "/var/www/web1/web/"
MonoServerPath example "/usr/bin/mod-mono-server2"
MonoApplications example "/:/var/www/web1/web/"
Alias /mono "/var/www/web1/web/"
<Directory /var/www/web1/web/>
SetHandler mono
MonoSetServerAlias example
AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx
</Directory>
ServerName www.example.co.za:80
ServerAdmin webmaster@example.co.za
DocumentRoot /var/www/web1/web
ServerAlias example.co.za m.example.co.za
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm default.aspx Default.aspx
ScriptAlias  /cgi-bin/ /var/www/web1/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web1/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
</Files>
<Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
</Files>
<Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
</Files>
<Files *.php5>
    SetOutputFilter PHP
    SetInputFilter PHP
</Files>
php_admin_flag safe_mode Off
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/web1/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
</VirtualHost>
#
Reply With Quote
Sponsored Links