Jexus 即 Jexus Web Server,简称JWS,是Linux平台上的一款ASP.NET WEB服务器,是 Linux、Unix、FreeBSD 等非Windows系统架设 ASP.NET WEB 服务器的核心程序,是企业级ASP.NET跨平台部署的一种可选方案。与其它WEB服务器相比,Jexus不但具有跨平台ASP.NET服务器这样的标志性特征,同时还拥有内核级的安全监控、入侵检测、URL重写、无文件路由等一系列重要功能和专有特性。
一、使用Jexus5.8.1独立版
网址http://www.linuxdot.net/ ps:该“独立版”支持64位的CentOS 6.5、Ubuntu 12.04以上版本的操作系统,能运行WebForm、Mvc3-5、WebService 以及WebApi,支持PHP,支持OWIN,支持反向代理,也就是说,无需安装mono的“独立版”与需要安装mono的“通用版”在功能上是完全相同的。
下载 cd /tmp wget http://www.linuxdot.net/down/jexus-5.8.1-x64.tar.gz
解压 tar -zxvf jexus-5.8.1-x64.tar.gz
移动 mv jexus /usr/local
测试 在/var/www/default/ 用vim新建一个简单index.apsx<%@Page Language="c#" %><%=DateTime.Now.ToString()%>
二、Jexsus常用命令
启动 ./jws start
重启 ./jws restart
停止`./jws stop`
启动某个网站 start 网站名
重启某个网站 restart 网站名
关闭某个网站 stop 网站名
三、使用vs2013新建一个基本mvc4项目
修改引用Microsoft.Web.Infrastructure 复制本地设为False
新建HomeController和View/Home/Index.chstml (重要,不新建是没有默认页面异常:System.Web.HttpException)
新建ApiTestController(可选)
修改配置文件(重要)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
<? xml version = "1.0" encoding = "utf-8" ?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
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 >
|