Deploy ASP.NET MVC4 and WebApi using the Jexus installation on CentOS6.5

  • 2020-05-15 02:52:30
  • OfStack

Jexus, Jexus Web Server, JWS for short, is an ASP. NET WEB server on Linux platform. It is the core program for ASP. NET WEB server installed by Linux, Unix, FreeBSD and other non-Windows systems, and is an optional scheme for enterprise ASP. NET cross-platform deployment. Compared with other WEB servers, Jexus not only features cross-platform ASP.NET servers, but also features kernel-level security monitoring, intrusion detection, URL rewriting, and file-free routing.

1. Use Jexus 5.8.1 standalone

Url http: / / www. linuxdot. net/ps: the "independent" version supports 64 - bit CentOS above 6.5, Ubuntu 12.04 version of the operating system, can run WebForm, Mvc3-5, WebService and WebApi, support PHP, support OWIN, support the reverse proxy, that is to say, do not need to install mono version "independence" and the need to install mono version "universal" are identical in function.

Download cd/tmp wget http: / / www linuxdot. net down/jexus - 5.8.1 - x64. tar. gz

Unzip tar-zxvf jexus-5.8.1-x64.tar.gz

Move mv jexus /usr/local

Test at /var/www/default/ create a new simple index.apsx with vim < %@Page Language="c#" % > < %=DateTime.Now.ToString()% >

2. Jexsus common commands

Start. / jws start

Restart. / jws restart

Stop `. / jws stop `

Launch a website start name

Restart the restart name of a website

Shut down a website stop

3. Use vs2013 to build a new basic mvc4 project

Modify the reference Microsoft.Web.Infrastructure copy to False locally

New HomeController and View/Home/Index chstml (important, there is no exception: the default page without creating System. Web. HttpException)

New ApiTestController(optional)

Modify configuration files (important)


<?xml version="1.0" encoding="utf-8"?>
<!--
  On how to configure  ASP.NET  For more information about the application, visit 
 http://go.microsoft.com/fwlink/?LinkId=169433
 -->
 
<configuration>
 <appSettings>
  <add key="webpages:Version" value="2.0.0.0" />
  <add key="webpages:Enabled" value="false" />
  <add key="PreserveLoginUrl" value="true" />
  <add key="ClientValidationEnabled" value="true" />
  <add key="UnobtrusiveJavaScriptEnabled" value="true" />
 </appSettings>
 
 <runtime>
 
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
 
   <dependentAssembly>
 
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
 
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
 
   </dependentAssembly>
 
   <dependentAssembly>
 
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
 
    <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
 
   </dependentAssembly>
 
   <dependentAssembly>
 
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
 
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
 
   </dependentAssembly>
 
 
   <dependentAssembly>
 
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
 
    <bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
 
   </dependentAssembly>
 
 
   <dependentAssembly>
 
    <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" />
 
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
 
   </dependentAssembly>
 
 
  </assemblyBinding>
 
 </runtime>
  
 <system.web>
   
   <customErrors mode="Off"/>
  <pages>
   <namespaces>
    <add namespace="System.Web.Helpers" />
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
    <add namespace="System.Web.WebPages" />
   </namespaces>
  </pages>
 </system.web>
 
 <system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
   
 <handlers>
   <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
   <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
   <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
   <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
   <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
   <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
  </handlers></system.webServer>
</configuration>


Related articles: