Ubuntu (Linux) + mono + xsp4 + nginx +asp.net MVC3 deployment

Source: Internet
Author: User

Toss a bit, try to deploy MVC3 with Linux.

Using CentOS and Ubuntu, respectively, is easier to deploy with Ubuntu.

The procedure is as follows:

First, the terminal is operated as follows

sudo su--  Enter your password
apt-Get
apt-Get
apt-get Install Mono-fastcgi-server4

There are some problems with missing packages during the installation process. Depends on the actual installation

Pcre g++ zlib have a dependence on

sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev g++

Second, nginx configuration

Default

sudo vim/etc/nginx/sites-available/default

Change into

 server {listen  80  Span style= "Color:rgb (0, 0, 0);    >;    server_name localhost;    Root // {root /var      /www/ .aspx;      Fastcgi_index /site; Fastcgi_pass  0.1 : 8000  ;    Include /etc/nginx/

The boot path is changed to Var/www, so a www folder should be created

sudo mkdir/var/www

It is recommended to change permissions because this folder needs to be shared and deployed remotely

777 /var/www
Fastcgi_params
sudo vim/etc/nginx/fastcgi_params

Finally insert the following two lines

Fastcgi_param  path_info          ""; fastcgi_param  script_filename    $document _root$fastcgi_ Script_name;

Third, start the service

Deploy the MVC3 site to www by sharing, and then start the service

sudo/etc/init.d/nginx startsudo fastcgi-mono-server4/applications=/:/var/www//socket=tcp:  127.0. 0.1:8000

Following the above, the deployment should already be completed.

However, there are some deployment issues that need to import MVC DLL support and import into the site Bin folder

System.Data.dllSystem.Web.ApplicationServices.dllSystem.Web.DynamicData.dllSystem.Web.Helpers.dllSystem.Web.Mvc.dllSystem . Web.Routing.dllSystem.Web.WebPages.Deployment.dllSystem.Web.WebPages.dllSystem.Web.WebPages.Razor.dll

Also, the database read problem, using MySQL, need to import

MySql.Data.dll

Enter Web. config, insert under <system.web>

<globalization culture="en-US" enableclientbasedculture="false "/>

All right, all done. Share your own deployment experience, hope to help you, I wish you all the smooth deployment O (∩_∩) o

 

Shenzhen Yuan Chong

Technical Manager: Five plus multiply

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.