Fork me on GitHub

在CentOS 6.3下安装OpenPetra 的 Mono 3.0.6 部署包

这篇文章记录的是在CentOS 6.3下安装《OpenPetra 以及CentOS Mono 3.0 部署包》提到的 Mono 3.0.6 部署包。

首先下载rpm包:

[azureuser@mono local]$ sudo wget http://downloads.sourceforge.net/project/openpetraorg/openpetraorg/mono-openpetra/centos6/mono-openpetra-3.0.6-1.x86_64.rpm
--2013-05-01 13:29:56--  http://downloads.sourceforge.net/project/openpetraorg/openpetraorg/mono-openpetra/centos6/mono-openpetra-3.0.6-1.x86_64.rpm
Resolving downloads.sourceforge.net... 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://iweb.dl.sourceforge.net/project/openpetraorg/openpetraorg/mono-openpetra/centos6/mono-openpetra-3.0.6-1.x86_64.rpm [following]
--2013-05-01 13:29:57--  http://iweb.dl.sourceforge.net/project/openpetraorg/openpetraorg/mono-openpetra/centos6/mono-openpetra-3.0.6-1.x86_64.rpm
Resolving iweb.dl.sourceforge.net... 70.38.0.134, 2607:f748:10:12::5f:2
Connecting to iweb.dl.sourceforge.net|70.38.0.134|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 118812004 (113M) [application/x-redhat-package-manager]
Saving to: “mono-openpetra-3.0.6-1.x86_64.rpmâ€

100%[======================================>] 118,812,004 1.01M/s   in 4m 21s

2013-05-01 13:34:18 (445 KB/s) - “mono-openpetra-3.0.6-1.x86_64.rpmâ€

下载完开始安装rpm包,发现安装包安装到了/opt/mono-openpetra 目录,而且还不支持重定向安装目录:

[azureuser@mono local]$ sudo yum install mono-openpetra-3.0.6-1.x86_64.rpm
Loaded plugins: security
base                                                     | 1.3 kB     00:00
base/primary                                             | 2.2 MB     00:00
base                                                                  6339/6339
extras                                                   | 1.3 kB     00:00
extras/primary                                           | 7.3 kB     00:00
extras                                                                    17/17
openlogic                                                | 1.3 kB     00:00
openlogic/primary                                        | 273 kB     00:00
openlogic                                                                 18/18
updates                                                  | 1.3 kB     00:00
updates/primary                                          | 495 kB     00:00
updates                                                               1170/1170
Setting up Install Process
Examining mono-openpetra-3.0.6-1.x86_64.rpm: mono-openpetra-3.0.6-1.x86_64
Marking mono-openpetra-3.0.6-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mono-openpetra.x86_64 0:3.0.6-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package           Arch      Version    Repository                         Size
================================================================================
Installing:
mono-openpetra    x86_64    3.0.6-1    /mono-openpetra-3.0.6-1.x86_64    320 M

Transaction Summary
================================================================================
Install       1 Package(s)

Total size: 320 M
Installed size: 320 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mono-openpetra-3.0.6-1.x86_64                                1/1
  Verifying  : mono-openpetra-3.0.6-1.x86_64                                1/1

Installed:
  mono-openpetra.x86_64 0:3.0.6-1

Complete!
[azureuser@mono local]$ mono
-bash: mono: command not found
通过参数 –relocate 指定安装路径,报了个is notrelocatable
[azureuser@mono local]$ sudo rpm -i --relocate /opt/mono-openpetra=/usr  mono-opnpetra-3.0.6-1.x86_64.rpm
        path /opt/mono-openpetra in package mono-openpetra-3.0.6-1.x86_64 is notrelocatable

可以使用下面的命令查看rpm包是否可以重定位,也就是安装到另一个目录
[azureuser@mono local]$ rpm -qpi mono-openpetra-3.0.6-1.x86_64.rpm  | head
Name        : mono-openpetra               Relocations: (not relocatable)
Version     : 3.0.6                             Vendor: (none)
Release     : 1                             Build Date: Sat 16 Mar 2013 12:59:24PM UTC
Install Date: (not installed)               Build Host: j45648.servers.jiffybox.et
Group       : OpenPetra Developers          Source RPM: mono-openpetra-3.0.6-1.sc.rpm
Size        : 335780608                        License: GPL
Signature   : (none)
Packager    : Timotheus Pokorra <timotheus.pokorra@solidcharity.com>
Summary     : Mono with fixes for OpenPetra
Description :
[azureuser@mono local]$

可以参照《CentOS设置Mono环境变量》设定Mono的路径,然后运行Mono就可以了。
[azureuser@mono ~]$ mono -V
Mono JIT compiler version 3.0.6 (tarball Sat Mar 16 13:41:55 CET 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)
[azureuser@mono ~]$

安装Jexus 5.3

1、下载:
下载地址是:http://www.linuxdot.net/down/jexus-5.3.tar.gz

2、解压:
tar -zxvf jexus-5.3.tar.gz

3、安装:
   Jexus安装非常简单,仅仅就是一个复制、粘帖和注册全局程序集的过程
   注意:以下所有操作请用root身份,同时假设把 Jexus 安装到 “/usr/jexus”文件夹中。

   1) 建立jexus工作文件夹:
      sudo mkdir /usr/jexus
   2) 把解压所得到的文件及文件夹全部复制或移动到 “/usr/jexus” 这个文件夹中
      如: sudo mv * /usr/jexus/
      cd /usr/jexus
   3) sudo chmod +x jws
   4) 注册全局程序集(*非常重要*)
      sudo ./jws regsvr

访问 http://mono.cloudapp.net/ 可以了,登陆的时候发生了异常

System.DllNotFoundException

/opt/mono-openpetra/lib/libgdiplus.so

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): System.Drawing.

Exception stack trace:

at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown>:0

Version Information: 3.0.6 (tarball Sat Mar 16 13:41:55 CET 2013); ASP.NET Version: 4.0.30319.17020

失败的原因是由于没有安装libgdiplus 包。/opt/mono-openpetra/etc/mono/config 里头的dllmap 映射到正确的地址就可以了

       <dllmap dll="gdiplus" target="/usr/lib/libgdiplus.so" />
        <dllmap dll="gdiplus.dll" target="/usr/lib/libgdiplus.so" />

说明:

Jexus 5.3开始,已经不在使用jws.start jws.stop 等命令,这些命令已经以新命令jws代替了。

jws的参数含义:

sudo ./jws start                 #启动JWS

sudo ./jws start  网站名    #启动指定网站

sudo ./jws restart             #重启JWS

sudo ./jws restart 网站名   #重启指定网站

sudo ./jws stop     #停止JWS

sudo ./jws stop 网站名   #停止指定网站

sudo ./jws regsvr    #更新或注册全局程序集,并重建本地映像

./jws  status # 查看JWS运行状态。

相关文章:

how to install rpm to specific directory

http://hi.baidu.com/rsnetworking/item/1aee5916b70cfa0d8fbde470

posted @ 2013-05-01 23:53  张善友  阅读(2162)  评论(0编辑  收藏  举报