zoukankan      html  css  js  c++  java
  • mono3.0.2安装指南及一键安装脚本

    下载版本:http://blog.chinaunix.net/uid-20682147-id-3453384.html


    mono-3.0.2安装指南

    一见 2012/12/27

    目录

    1. 前言 1

    1.1. 什么是mono 1

    1.2. 目的 1

    2. 下载网址 1

    3. 依赖关系 2

    4. 安装步骤 2

    4.1. mono 2

    4.2. xsp 2

    4.3. mod_mono 2

    5. 修改Apachehttpd.conf 3

    6. 附1:一键脚本 4

    6.1. 一键脚本前提 4

    6.2. 一键脚本全文 4

    7. 附2mod_mono.diff 6

    1. 前言

    1.1. 什么是mono

    mono是一个由Novell公司主持的一个致力于开创.netLinuxFreeBSDMac OS XSolaris上使用的开源工程。

    1.2. 目的

    本文档试图以最简单方式阐明mono-3.0.2版本的安装。mono采用的是automake编译方式,包括它所依赖的库,正因为这种依赖,使用得编译安装稍变复杂。

    2. 下载网址

    monoxspmod_mono的下载网址均为:

    http://download.mono-project.com/sources/

    3. 依赖关系

    1) mono无依赖;

    2) xps依赖mono

    3) mod_mono的安装依赖Apache,关于Apache的安装,请参考另一篇文章《apache2.4安装指南》。

    4. 安装步骤

    4.1. mono

    1) ./configure --prefix=/usr/local/mono(注:将mono安装到/usr/local/mono目录下)

    2) make

    3) make install

    4.2. xsp

    xps的安装需要注意一下,如果直接以标准的automake方式编译,可能会遇到错误,以下面的步骤操作,可帮助避免错误:

    1) export PATH=/usr/local/mono/bin:$PATH(需要用到mono提供的dmcsgmcs等命令)

    2) export PKG_CONFIG_PATH=/usr/local/mono/lib/pkgconfig:$PKG_CONFIG_PATHXSP依赖mono

    3) sed -i -e 's! test !!' Makefile.am(不编译test,因为test可能编译失败)

    4) ./configure --prefix=$XSP_HOME --disable-docs(文档也不编译,减少遇到错误的概率)

    5) make

    6) make install

    4.3. mod_mono

    对于mod_mono-2.10版本,如果依赖的是Apache2.4版本,则需要修改mod_mono.c后才可以编译通过,需要修改的地方请参见“2mod_mono.diff”。而如果是Apache2.2版本,则不用做任何修改。

    1) ./configure --prefix=/usr/local/mod_mono --with-apxs=/usr/local/httpd/bin/apxs(假设将Apache安装在/usr/local/httpd目录下)

    2) make

    3) make install

    5. 修改Apachehttpd.conf

    成功安装mono后,需要对Apachehttpd.conf文件进行修改,修改点包括:

    1) 加入:include /usr/local/httpd/conf/mod_mono.conf

    2) 加入以下内容(这部分需要根据实际进行修改):

    <VirtualHost *:80>

      ServerName mono.com

      ServerAlias mono.com

      ServerAdmin web-admin@mono.com

      DocumentRoot /usr/local/xsp/lib/xsp/test

      

      # MonoServerPath can be changed to specify which version of ASP.NET is hosted

      # mod-mono-server1 = ASP.NET 1.1 / mod-mono-server2 = ASP.NET 2.0

      # For SUSE Linux Enterprise Mono Extension, uncomment the line below:

      # MonoServerPath mono.com "/opt/novell/mono/bin/mod-mono-server2"

      # For Mono on openSUSE, uncomment the line below instead:

      MonoServerPath mono.com "/usr/local/xsp/bin/mod-mono-server4"

      # To obtain line numbers in stack traces you need to do two things: 

      # 1) Enable Debug code generation in your page by using the Debug="true" 

      #    page directive, or by setting <compilation debug="true" /> in the 

      #    application's Web.config

      # 2) Uncomment the MonoDebug true directive below to enable mod_mono debugging

      MonoDebug mono.com true

      # The MONO_IOMAP environment variable can be configured to provide platform abstraction

      # for file access in Linux.  Valid values for MONO_IOMAP are:

      #    case

      #    drive

      #    all

      # Uncomment the line below to alter file access behavior for the configured application

      MonoSetEnv mono.com MONO_IOMAP=all

      

      #

      # Additional environtment variables can be set for this server instance using 

      # the MonoSetEnv directive.  MonoSetEnv takes a string of 'name=value' pairs 

      # separated by semicolons.  For instance, to enable platform abstraction *and* 

      # use Mono's old regular expression interpreter (which is slower, but has a

      # shorter setup time), uncomment the line below instead:

      # MonoSetEnv mono.com MONO_IOMAP=all;MONO_OLD_RX=1

      MonoApplications mono.com "/:/usr/local/xsp/lib/xsp/test"

      <Location "/">

        Allow from all

        Order allow,deny

        MonoSetServerAlias mono.com

        SetHandler mono

        SetOutputFilter DEFLATE

        SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary

      </Location>

      <IfModule mod_deflate.c>

        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript

      </IfModule>

    </VirtualHost>

    6. 附1:一键脚本

    6.1. 一键脚本前提

    1) 使用root用户操作;

    2) Apache安装在/usr/local/httpd目录下;

    3) monoxpsmod_mono安装包都放在同一个目录下,如:

    ~/app # ls

    mod_mono-2.10.tar.bz2  mono-3.0.2.tar.bz2  xsp-2.10.2.tar.bz2

    4) 如果是Apache2.4,还需要将mod_mono.diff文件和安装包放在同一个目录下。

    6.2. 一键脚本全文

    #!/bin/sh

    # Writed by yijian on 2012/12/27

    # A key to install mono on linux

    export APACHE_HOME=/usr/local/httpd

    export MONO_HOME=/usr/local/mono

    export XSP_HOME=/usr/local/xsp

    export MOD_MONO_HOME=/usr/local/mod_mono

    mono=`basename mono-*.tar.bz2 .tar.bz2`

    xsp=`basename xsp-*.tar.bz2 .tar.bz2`

    mod_mono=`basename mod_mono-*.tar.bz2 .tar.bz2`

    basedir=`pwd`

    apache_version=`$APACHE_HOME/bin/httpd -V|awk -F"[/ .]" '/Server version/{print $5}'`

    echo "Apache version: $apache_version"

    # Compile & install mono

    echo "tar xjf $mono.tar.bz2"

    cd $basedir

    #tar xjf $mono.tar.bz2

    cd $basedir/$mono

    #./configure --prefix=$MONO_HOME

    #if test $? -ne 0; then

    # exit 1

    #fi

    #make

    #make install

    # Compile & install XSP

    export PATH=$MONO_HOME/bin:$PATH

    export PKG_CONFIG_PATH=$MONO_HOME/lib/pkgconfig:$PKG_CONFIG_PATH

    cd $basedir

    tar xjf $xsp.tar.bz2

    cd $basedir/$xsp

    sed -i -e 's! test !!' Makefile.am

    ./configure --prefix=$XSP_HOME --disable-docs

    if test $? -ne 0; then

    exit 1

    fi

    make

    if test $? -ne 0; then

    exit 1

    fi

    make install

    if test $? -ne 0; then

    exit 1

    fi

    # Compile & install mod_mono

    cd $basedir

    tar xjf $mod_mono.tar.bz2

    if test $apache_version -gt 2; then

    if test -f ./mod_mono.diff; then

    echo "cp ./mod_mono.diff $mod_mono/src/"

    cp ./mod_mono.diff $mod_mono/src/

    if test $? -ne 0; then

    exit 1

    fi

    fi

    fi

    cd $basedir/$mod_mono/src

    if test -f ./mod_mono.diff; then

    echo "patch mod_mono.c mod_mono.diff"

    patch mod_mono.c mod_mono.diff

    fi

    cd $basedir/$mod_mono

    ./configure --prefix=$MOD_MONO_HOME --with-apxs=$APACHE_HOME/bin/apxs

    if test $? -ne 0; then

    exit 1

    fi

    make

    if test $? -ne 0; then

    exit 1

    fi

    make install

    if test $? -ne 0; then

    exit 1

    fi

    cd $basedir

    echo "finished!"

    exit 0

    7. 2mod_mono.diff

    389c389

    <  return unixd_config.user_id;

    ---

    >  return ap_unixd_config.user_id;

    399c399

    <  return unixd_config.group_id;

    ---

    >  return ap_unixd_config.group_id;

    409c409

    <  return unixd_config.user_name;

    ---

    >  return ap_unixd_config.user_name;

    488c488

    <  rv = unixd_set_global_mutex_perms (xsp->dashboard_mutex);

    ---

    >  rv = ap_unixd_set_global_mutex_perms (xsp->dashboard_mutex);

    850,857c850

    < #if defined(APACHE22)

    <  return c->remote_addr->port;

    < #else

    <  apr_port_t port;

    <  apr_sockaddr_port_get (&port, c->remote_addr);

    <  return port;

    < #endif

    ---

    >  return c->client_addr->port;

    863d855

    < #if defined(APACHE22)

    865,869d856

    < #else

    <  apr_port_t port;

    <  apr_sockaddr_port_get (&port, r->connection->local_addr);

    <  return port;

    < #endif

    1981c1968

    <  info.remote_ip_len = strlen (r->connection->remote_ip);

    ---

    >  info.remote_ip_len = strlen (r->connection->client_ip);

    2029c2016

    <  ptr += write_string_to_buffer (ptr, 0, r->connection->remote_ip, info.remote_ip_len);

    ---

    >  ptr += write_string_to_buffer (ptr, 0, r->connection->client_ip, info.remote_ip_len);


  • 相关阅读:
    一, 认识一下Python
    VUE
    排序算法6---归并排序算法
    排序算法5---堆排序算法,改进的简单选择排序
    排序算法4---希尔排序算法,改进的直接插入排序
    排序算法3---直接插入排序算法
    排序算法2---简单选择排序
    排序算法1---冒泡排序及其改进版
    10.17写一函数,实现两个字符串的比较。即自己写一个strcmp函数,函数原型为: int strcmp(char * p1,char * p2) 设p1指向字符串s1,p2指向字符串s2。要求:当s1=s2时,返回值为0。当s1≠s2时,返回它们两者的第一个不同字符的ASCII码差值(如”BOY”与”BAD”,第二个字母不同,”O”与”A”之差为79-65=14);如果s1>s2,则输出正值;
    10.16输入一个字符串,内有数字和非数字字符,如: a123x456 17960? 302tab5876 将其中连续的数字作为一个整数,依次存放到一数组num中。例如123放在num[0]中,456放在num[1]中……统计共有多少个整数,并输出这些数。
  • 原文地址:https://www.cnblogs.com/aquester/p/9891747.html
Copyright © 2011-2022 走看看