在CentOS 6.3下安裝OpenPetra 的 Mono 3.0.6 部署套件

來源:互聯網
上載者:User
文章目錄
  • System.DllNotFoundException

這篇文章記錄的是在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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.