Linux+Jexus+MariaDB+ASP.NET[LJMA]環境搭建

來源:互聯網
上載者:User

標籤:

本文是以張老師的篇章總結而來、更多知識請訪問張老師的[LJMA]教程:http://www.cnblogs.com/shanyou/p/3362150.html 

一、簡介

  • [LJMA]是Linux+Jexus+MariaDB+ASP.NET的簡寫,和LAMP一樣
  • 其主要是Jexus和MariaDB以及ASP.NET安裝在Linux系統上,組成一個ASP.NET的平台
  • Jexus是Linux下的基於Mono編寫的WEB服務軟體,沒Mono是啟動不了Jexus的
  • MariaDB是比較小型的資料庫軟體
  • ASP.NET是由微軟在.NET Framework架構中所提供,開發Web應用程式的類庫,通過Mono我們可以讓他在Linux下運行

Jexus相比其它Linux系統的WEB伺服器的優勢:

  • Jexus直接支援跨平台的ASP.NET網站和PHP網站,中間無需第三方外掛程式。
  • Jexus在靜態檔案處理方面同樣擁有非常優秀的效能。
  • Jexus專們針對應用伺服器的需求進行了最佳化,具有超強的穩定性和不間斷運行能力,其穩健度,絕不亞於其它任何WEB伺服器。
  • Jexus擁有最基礎而關鍵的入侵檢測能力,這是所有其它WEB伺服器所不具備的。

 二、環境安裝

  1、Mono環境搭建

  • mono是指由Novell公司(由Xamarin發起,並由Miguel de lcaza領導的,一個致力於開創 .NET在Linux上使用的開源工程。
    //系統,安裝編譯環境,為編譯Mono源碼做準備    [[email protected] ~]# yum –y update
1    //安裝Mono源碼安裝需要的庫2 [[email protected] ~]# 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
1   //Mono需要的GDI+相容API的庫Libgdiplus 支援System.Drawing2 [[email protected]]# cd /usr/local/src/3 [[email protected] src]# wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz24 [[email protected] src]# tar -jxvf libgdiplus-2.10.tar.bz25 [[email protected] src]# cd libgdiplus-2.106 [[email protected] libgdiplus-2.10]# ./configure --prefix=/usr7 [[email protected] libgdiplus-2.10]# make8 [[email protected] libgdiplus-2.10]# make install
1   //源碼安裝Mono 3.2.32 [[email protected] ~]# cd /usr/local/src/3 [[email protected] src]# wget http://download.mono-project.com/sources/mono/mono-3.2.3.tar.bz24 [[email protected] src]# tar -jxvf mono-3.2.3.tar.bz25 [[email protected] mono-3.2.3]# cd mono-3.2.36 [[email protected] mono-3.2.3]# ./configure --prefix=/usr              //...耐心等待7 [[email protected] mono-3.2.3]# make                          //...耐心等待吧,可以去喝杯咖啡、看看風景8 [[email protected] mono-3.2.3]# make install
 1   //輸入 mono -V 如有mono版本資訊,肯定安裝成功了 2 [[email protected] ~]# mono -V 3 Mono JIT compiler version 3.2.3 (tarball Sat Aug 22 15:52:56 EDT 2015) 4 Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com 5         TLS:           __thread 6         SIGSEGV:       altstack 7         Notifications: epoll 8         Architecture:  amd64 9         Disabled:      none10         Misc:          softdebug11         LLVM:          supported, not enabled.12         GC:            sgen
1   //在安裝mono後,都 ldconfig一下2 [[email protected] ~]# ldconfig

  2、安裝Jexus

  • Jexus Web Server for nux 是一款基於.NET相容環境,運行於Linux/unix作業系統之上,以支援ASP.NET為核心功能的高效能WEB伺服器,用於替換Apache+mod_mono、Nginx+FastCgi 方案運行ASP.NET
  • Jexus不但具有跨平台ASP.NET伺服器這樣的標誌性特徵,同時還擁有核心級的安全監控、入侵檢測、URL重寫、無檔案路由
1   //開始下載並安裝2 [[email protected] ~]# cd /usr/local/src/3 [[email protected] src]# wget http://linuxdot.net/down/jexus-5.4.3.tar.gz4 [[email protected] src]# tar -zvxf jexus-5.4.3.tar.gz5 [[email protected]  src]# cd jexus-5.4.36 [[email protected]  jexus-5.4.3]# ./install /etc/jws/7   //安裝完成~!!!在執行install指令碼時,jexus預設是安裝到/usr/jexus/中,如果想安裝到其他目錄,可以在執行該指令碼時增加一個目錄的參數(比如 sudu install /usr/local/jexus/)
1   //啟動jexus 檢查是否正常了2 [[email protected] ~]# cd /etc/jws/3 [[email protected] jws]# ./jws start4 Start ... OK5 [[email protected] jws]# cat log/jws.log6 08-25 10:25:25: * Jexus web server start-up success.
  • 看到了Jexus已經成功啟動的日誌,我們還可以通過瀏覽器來檢查下:http://ip/info

 

 

  • 通過以下命令可以啟動/停止/重啟Jexus服務:

1 /etc/jws/jws start2 /etc/jws/jws stop3 /etc/jws/jws restart
  •  更多請參考Jexus的使用教程"點擊這裡下載"密碼:38bv

 3、安裝MariaDB

  • MariaDB是一個向後相容、替代MySQL的資料庫伺服器。MariaDB 是一個採用 Maria 儲存引擎的 MySQL 分支版本,是由原來 MySQL 的作者 Michael Widenius 創辦的公司所開發的免費開源的資料庫伺服器
  • 從源碼包安裝MariaDB,它的編譯需要很長的時間,推薦通過CentOS的yum方式安裝
1   //使用YUM安裝MariaDB2 [[email protected] ~]# yum -y install MariaDB-client MariaDB-server MariaDB-devel
1   //啟動資料庫2 [[email protected] ~]# service mysql start3   //如果啟動不了,請到 /data/mysql/ 下查看錯誤記錄檔,這個日誌通常是主機名稱.err。
 1   //修改Root的密碼 2 [[email protected] ~]# mysqladmin -u root password ‘xiaoling‘ 3   //配置遠端存取,MariaDB為了安全起見,預設情況下綁定ip( 127.0.0.1) 4 [[email protected] ~]# mysql -u root -p 5 Enter password: 6 Welcome to the MariaDB monitor.  Commands end with ; or \g. 7 Your MariaDB connection id is 17 8 Server version: 10.0.21-MariaDB MariaDB Server 9 Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.10 Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.11 MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘xiaoling’ WITH GRANT OPTION;12 MariaDB [(none)]> flush privileges;13   //第一句中"%"表示任何主機都可以遠程登入到該伺服器上訪問。如果要限制只有某台機器可以訪問,將其換成相應的IP即可,如:14 MariaDB [(none)]>GRANT ALL PRIVILEGES ON *.* TO root@"192.168.1.187" IDENTIFIED BY "xiaoling";15   //第二句表示從mysql資料庫的grant表中重新載入許可權資料。因為MySQL把許可權都放在了cache中,所以在做完更改後需要重新載入。

  4、測試LJMA

  • 使用Visual Studio編譯後放到jexus的 default網站所對應的目錄/var/www/default
  • 剛好筆者有一個小項目,通過FTP上傳至/var/www/default預設網站目錄

  • LJMA環境的搭建就好了,但是如果要瞭解很多細節。那麼必然需要去多花時間學習!

 

Linux+Jexus+MariaDB+ASP.NET[LJMA]環境搭建

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.