Mono 2.8 released: C #4.0 and better performance, we know that Mono 2.8 is against ASP. net mvc 2 is fully supported. Next we will test the deployment of ASP on Mono 2.8. net mvc 2 application. My environment is Opensuse 11.3. The following command is used to deploy the Mono 2.8 development environment. The reason is that the development environment updates MonoDevelop and supports Mono2.8 program development:
- zypper addrepo http://ftp.novell.com/pub/mono/download-stable/openSUSE_11.3 mono-stable
- zypper refresh --repo mono-stable
- zypper dist-upgrade --repo mono-stable
Then start MonoDevelop to generate an ASP. net mvc 2 Application tew.vc2.
We use Apache2 + mod_mono for deployment and set a Virtual Host:
- <VirtualHost *:80>
- ServerAdmin webmaster@dotnetting.com
- ServerName www.dotnetting.com
- # DocumentRoot: The directory out of which you will serve your
- # documents. By default, all requests are taken from this directory, but
- # symbolic links and aliases may be used to point to other locations.
- DocumentRoot /srv/www/vhosts/dotnetting/public_html
- # if not specified, the global error log is used
- ErrorLog /srv/www/vhosts/dotnetting/logs/error.log
- CustomLog /srv/www/vhosts/dotnetting/logs/access_log combined
- # don't loose time with IP address lookups
- HostnameLookups Off
- # needed for named virtual hosts
- UseCanonicalName Off
- # configures the footer on server-generated documents
- ServerSignature On
- # Optionally, include *.conf files from /etc/apache2/conf.d/
- #
- # For example, to allow execution of PHP scripts:
- #
- Include /etc/apache2/conf.d/mod_mono.conf
- MonoServerPath www.dotnetting.com "/usr/bin/mod-mono-server4"
- MonoDebug www.dotnetting.com true
- MonoSetEnv www.dotnetting.com MONO_IOMAP=all
- MonoApplications www.dotnetting.com "/:/srv/www/vhosts/dotnetting/public_html"
- <Location "/">
- Allow from all
- Order allow,deny
- MonoSetServerAlias www.dotnetting.com
- SetHandler mono
- SetOutputFilter DEFLATE
- SetEnvIfNoCase Request_URI "\.(?:gif|jpg?g|png)$" no-gzip dont-vary
- </Location>
- <IfModule mod_deflate.c>
- AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
- </IfModule>
- </VirtualHost>
This is a common ASP. NET virtual host configuration, the only line of difference is the Mvc1 or mvc2 set on MonoServerPath, we set to mod-mono-server4 here, if you do not modify this place, will receive an error is web. the targetFramework of config is incorrect. Then copy the generated test program to/srv/www/vhosts/dotnetting/public_html.
Note: Mono2.8 has removed support for. NET 1.1, so it cannot be set as a mod-mono-server1
Restart Apache2
Service apache2 restart
Visit www.dotnetting.com through a browser. Remember to configure domain name resolution in the host file before accessing. You can see the following page:
Appendix:List of commonly used VIM commands
Http://dev.csdn.net/htmls/76/76253.html
Original article title: deploying ASP. net mvc 2 on Mono 2.8
Link: http://www.cnblogs.com/shanyou/archive/2010/10/08/1846171.html