首页 技术 正文
技术 2022年11月12日
0 收藏 586 点赞 3,966 浏览 5355 个字

<!–
.h2cls {
background: #6fa833 none repeat scroll 0 0 !important;
border-radius: 5px !important;
color: #fff;
font-family: “微软雅黑”,”宋体”,”黑体”,Arial;
margin-bottom: 5px;
padding-left: 15px;
text-shadow: 2px 2px 3px #222;
}
h3 {
background-color: #f5f5f5;
border-left: 13px solid #6fa833;
color: #6fa833;
padding: 5px;
margin: 15px auto 2px;
}
p {
margin: 10px auto;
text-indent: 0;
}
code {
background-color: #f5f5f5 !important;
border: 1px solid #ccc !important;
border-radius: 3px !important;
display: inline-block;
font-family: “Courier New”,sans-serif !important;
font-size: 12px !important;
height: 20px;
line-height: 1.8;
margin: 0 5px;
padding: 0 5px !important;
vertical-align: middle;
}
–>

本篇目录

前言

感谢:

http://www.jexus.org/

http://www.cnblogs.com/shanyou/archive/2012/01/07/2315982.html

http://www.cnblogs.com/hanyinglong/p/5456757.html

http://www.jb51.net/article/83550.htm

http://www.cnblogs.com/hanyinglong/p/5456757.html

http://bbs.csdn.net/topics/390944302

环境准备

虚拟机:VMware-workstation-full-11.0.0-2305329_0;

Linux系统:CentOS-7-x86_64-DVD-1511.iso;

Visual Studio 2013:创建默认ASP.NET MVC 4 Web 应用程序;

Linux连接工具:SecureCRT;

Linux下环境准备

更新系统

可以跳过,有四百多条更新。

yum –y update

安装Mono源码安装需要的库

yum -y install gcc gcc-c++ bison pkgconfig glib2-devel gettext make libpng-devel libjpeg-devel libtiff-devel libexif-devel giflib-devel libX11-devel freetype-devel fontconfig-devel  cairo-devel

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

安装Mono需要的GDI+兼容API的库Libgdiplus

cd /usr/local/src/

libgdiplus下载地址,当前最新版本libgdiplus-4.2.tar.gz | 2015-12-20 17:33 | 671K

wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-4.2.tar.gz

tar -zxvf libgdiplus-4.2.tar.gz

cd libgdiplus-4.2

./configure --prefix=/usr

make && make install

安装 mono

cd /usr/local/src/

mono下载地址,当前最新版本mono-4.6.2.6.tar.bz2 | 2016-11-02 14:22 | 79M

wget http://download.mono-project.com/sources/mono/mono-4.6.2.6.tar.bz2

tar -jxvf mono-4.6.2.6.tar.bz2

cd mono-4.6.2

./configure --prefix=/usr

make这步的时间稍微比较久点。

make && make install

安装完后使用mono -V查看版本信息。

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

Jexus安装

cd /usr/local/src/

Jexus下载地址,当前最新版本jexus-5.8.1.tar.gz

wget http://www.linuxdot.net/down/jexus-5.8.1.tar.gz

tar -zxvf jexus-5.8.1.tar.gz

cd jexus-5.8.1

./install

启动命令。

/usr/jexus/jws start

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

启动成功后通过http://localhost/info访问到如下页面。

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

至此环境准备工作完成。

部署ASP.NET MVC项目

Jexus配置

cd /usr/jexus/siteconf/

cp default simple

赋值默认配置修改port、root。

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

配置修改完成后到/var目录下创建www文件夹。

cd /var

mkdir www

VS2013创建MVC项目打包发布

使用SecureFX将打包文件夹simple上传至/var/www/simple目录。

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

将jexus停止后重新启动

/usr/jexus/jws stop

/usr/jexus/jws start

启动成功后通过http://localhost/info访问出现如下错误信息。

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

将Web.config文件内容替换成如下信息重新上传。

<?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>

/usr/jexus/jws restart

log4net引用到项目中。

重新启动后刷新能访问显示如下,但是样式信息未应用。这是因为Linux下是区分大小写的,需要配置jexus。

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

cd /usr/jexus/

vi jws

取消# export MONO_IOMAP=”all”这段内容的前面的#,保存,然后重新启动jexus。

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

重启jws后,重新访问结果。

Mono+Jexus让C#运行在Linux(centos7_x64),学习笔记

总结

没写完。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,494
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295