zoukankan      html  css  js  c++  java
  • 在Ubuntu中搭建.NET开发环境

    在Ubuntu中搭建.NET开发环境

    Mono简介
    Mono是Xamarin公司C#和CLR的ECMA标准基于开发的一个开源的.NET实现版本,它是Linux平台上开发.NET应用程序首选。同时其也提供了Xamarin.IOS和Xamarin.Andriod,是我们可以直接使用C#开发IOS和Andriod手机开发。
    安装Mono
    Mono的乌班图版本是由社区提供维护的。以下的版本在标准的Ubuntu库中是可用的:
    Ubuntu Hardy (8.04 LTS):     1.2.6
    Ubuntu Lucid (10.04 LTS):     2.4 branch snapshot
    Ubuntu Natty (11.04):     2.6.7
    Ubuntu Oneiric (11.10):     2.10.5
    Ubuntu Precise (12.04 LTS):     2.10.8.1
    Ubuntu Quantal (12.10):     2.10.8.1 
    Ubuntu默认安装的应用程序例如Tomboy、F-Spot等是需要使用Mono的,所以在12.04以前的发布版本中就已经默认安装了Mono。在12.04和以后的版本,我们可以使用mono-complete来安装Mono的全部组件。安装完成使用mono --version查看Mono相关信息。

    验证Mono是否安装成功
    1. 打开gedit并将如下代码保存为helloworld.cs文件


    2. 使用mcs helloworld.cs编译,完成后使用mono helloworld.exe执行生成的可执行文件。

    安装mono-fastcgi-server2
    sudo apt-get install mono-fastcgi-server2

    安装Nginx
    1.输入以下命令安装Nginx,sudo apt-get install nginx

    2. 打开以下配置文件 /etc/nginx/sites-available/default,并添加如下内容

    server {
             listen   30000;
             server_name  localhost;
             access_log   /var/log/nginx/mono.log;
      
             location / {
                     #root /usr/share/nginx/www;
             root /home/hys/Mono/sites/mysite;
                     index index.html index.htm default.aspx Default.aspx;
                     fastcgi_index Default.aspx;
                     fastcgi_pass 127.0.0.1:9000;
                     include /etc/nginx/fastcgi_params;
             }
     }


    3. 打开配置文件/etc/nginx/fastcgi_params,并添加如下内容

     fastcgi_param  PATH_INFO          "";
     fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;


    4. 在终端中执行如下命令启动FastCgi服务器
    fastcgi-mono-server2 /applications=*:30000:/:/home/hys/Mono/sites/mysite /socket=tcp:127.0.0.1:9000
    5. 启动Nignx服务器
     /etc/init.d/nginx start

    安装monoDevelop集成开发工具
    sudo apt-get install monodevelop

     
     
    分类: linux
    标签: ubuntumonoasp.netC#nignx
  • 相关阅读:
    HTML&CSS 学习网站收藏【转】
    HTML5安全:CORS(跨域资源共享)简介【转】
    SPDY以及示例
    前端开发中,对图片的优化技巧有哪些?(比如淘宝首页的图片)
    【javascript基础】之【__lookupSetter__ 跟 __lookupSetter__】
    毫秒必争,前端网页性能最佳实践【转】
    最近遇到的兼容性问题和适配问题
    备份的一些小tip
    Http2改造实践:statusText丢失问题
    vue-cli脚手架npm相关文件解读(9)config/index.js
  • 原文地址:https://www.cnblogs.com/Leo_wl/p/3828833.html
Copyright © 2011-2022 走看看