How to deploy ASP. net mvc 2 Framework on Mono 2.8

Source: Internet
Author: User

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:

 
 
  1. zypper addrepo http://ftp.novell.com/pub/mono/download-stable/openSUSE_11.3 mono-stable   
  2. zypper refresh --repo mono-stable   
  3. 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:

 
 
  1. <VirtualHost *:80>     
  2. ServerAdmin webmaster@dotnetting.com    
  3.  ServerName www.dotnetting.com    
  4.  # DocumentRoot: The directory out of which you will serve your    
  5.  # documents. By default, all requests are taken from this directory, but   
  6.  # symbolic links and aliases may be used to point to other locations.    
  7.  DocumentRoot /srv/www/vhosts/dotnetting/public_html    
  8.  # if not specified, the global error log is used    
  9.  ErrorLog /srv/www/vhosts/dotnetting/logs/error.log    
  10.    CustomLog /srv/www/vhosts/dotnetting/logs/access_log combined   
  11.   # don't loose time with IP address lookups  
  12.   HostnameLookups Off    
  13.    # needed for named virtual hosts    
  14.   UseCanonicalName Off   
  15.    # configures the footer on server-generated documents    
  16.   ServerSignature On    
  17.   # Optionally, include *.conf files from /etc/apache2/conf.d/   
  18.   #   
  19.   # For example, to allow execution of PHP scripts:   
  20.   #   
  21.   Include /etc/apache2/conf.d/mod_mono.conf    
  22.      MonoServerPath www.dotnetting.com "/usr/bin/mod-mono-server4"  
  23.      MonoDebug www.dotnetting.com true   
  24.    MonoSetEnv www.dotnetting.com MONO_IOMAP=all    
  25.    MonoApplications www.dotnetting.com "/:/srv/www/vhosts/dotnetting/public_html"   
  26.    <Location "/">   
  27.     Allow from all  
  28.   Order allow,deny    
  29.    MonoSetServerAlias www.dotnetting.com    
  30.   SetHandler mono   
  31.    SetOutputFilter DEFLATE   
  32.   SetEnvIfNoCase Request_URI "\.(?:gif|jpg?g|png)$" no-gzip dont-vary    
  33.   </Location>   
  34.   <IfModule mod_deflate.c>    
  35.   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript   
  36.    </IfModule>   
  37. </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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.