Deploy ASP. net mvc 2 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:

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:

   1: <VirtualHost *:80>

   2:     ServerAdmin webmaster@dotnetting.com

   3:     ServerName www.dotnetting.com

   4:  

   5:     # DocumentRoot: The directory out of which you will serve your

   6:     # documents. By default, all requests are taken from this directory, but

   7:     # symbolic links and aliases may be used to point to other locations.

   8:     DocumentRoot /srv/www/vhosts/dotnetting/public_html

   9:  

  10:     # if not specified, the global error log is used

  11:     ErrorLog /srv/www/vhosts/dotnetting/logs/error.log

  12:     CustomLog /srv/www/vhosts/dotnetting/logs/access_log combined

  13:  

  14:     # don't loose time with IP address lookups

  15:     HostnameLookups Off

  16:  

  17:     # needed for named virtual hosts

  18:     UseCanonicalName Off

  19:  

  20:     # configures the footer on server-generated documents

  21:     ServerSignature On

  22:  

  23:  

  24:     # Optionally, include *.conf files from /etc/apache2/conf.d/

  25:     #

  26:     # For example, to allow execution of PHP scripts:

  27:     #

  28:     Include /etc/apache2/conf.d/mod_mono.conf

  29:  

  30:     MonoServerPath www.dotnetting.com "/usr/bin/mod-mono-server4"

  31:     MonoDebug www.dotnetting.com true

  32:     MonoSetEnv www.dotnetting.com MONO_IOMAP=all

  33:     MonoApplications www.dotnetting.com "/:/srv/www/vhosts/dotnetting/public_html"

  34:     <Location "/">

  35:       Allow from all

  36:       Order allow,deny

  37:       MonoSetServerAlias www.dotnetting.com

  38:       SetHandler mono

  39:       SetOutputFilter DEFLATE

  40:       SetEnvIfNoCase Request_URI "\.(?:gif|jpg?g|png)$" no-gzip dont-vary

  41:     </Location>

  42:     <IfModule mod_deflate.c>

  43:       AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript

  44:     </IfModule>

  45:  

  46: </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

Related Article

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.