centos6.5+mono+nginx跑asp.net

來源:互聯網
上載者:User

標籤:soc   找不到   soft   asp   lis   data   上傳   nginx   cgi   

一、準備工作

1.升級相關庫

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel bison pkgconfig glib2-devel gettext make(由於以前安裝了案頭,所以未進行這步操作,具體需不需要有待測驗)

2.相關軟體下載

nginx下載:http://nginx.org/

(官網),在這裡使用的版本為1.8.1,因此下載軟體包nginx-1.8.1.tar.gz

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

,在這裡使用的版本為3.10.0,因此下載軟體包mono-3.10.0.tar.bz2

libgdiplus下載:http://download.mono-project.com/sources/libgdiplus/

,在這裡使用的版本為3.8,因此下載軟體包libgdiplus-3.8.tar.gz

xsp下載:http://download.mono-project.com/sources/xsp/

,在這裡使用的版本為3.8,因此下載軟體包xsp-3.8.tar.gz

pcre下載:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/

,在這裡使用的版本為8.37,因此下載軟體包pcre-8.37.tar.gz

聲明:mono、libgdiplus、xsp 4.0以上版本超出系統支援範圍。

二:安裝相關軟體

1.安裝pcre庫(nginx依賴)

tar  zxvf pcre-8.37.tar.gz(解壓軟體包)

cd pcre-8.37(切換目錄,進入pcre解壓目錄)

./configure

make

make install

2.建立跑nginx的使用者和組

/usr/sbin/groupadd www/usr/sbin/useradd -g www wwwmkdir -p /data0/webchmod +w /data0/web

chown -R www:www /data0/web

3.安裝nginx

tar zxvf nginx-1.8.1.tar.gz(解壓軟體包)

cd nginx-1.8.1(切換目錄,進入nginx解壓目錄)

./configure --user=www --group=www --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module

make

make install

啟動nginx:/opt/nginx/sbin/nginx

錯誤:如果找不到libpcre.so.1,那麼進入/lib64目錄,做軟串連: ln -s libpcre.so.0.0.1  libpcre.so.1

4.安裝libgdiplus

tar zvxf libgdiplus-3.8.tar.gz(解壓軟體包)

cd libgdiplus-3.8(切換目錄,進入libgdiplus 解壓目錄)

./configure --prefix=/opt/mono

make 

make install

echo "/opt/mono/lib" > /etc/ld.so.conf.d/mono.conf (放在標準庫下)

ldconfig (載入庫)

5.安裝mono

tar jxvf mono-3.10.0.tar.bz2(解壓軟體包)

cd mono-3.10.0(切換目錄,進入mono解壓目錄)

./configure --prefix=/opt/mono (時間較長)

make

make install

echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/.bash_profileecho export LD_LIBRARY_PATH=/opt/mono/lib:$LD_LIBRARY_PATH>>~/.bash_profile

echo export PATH=/opt/mono/bin:$PATH>>~/.bash_profile

source ~/.bash_profile(使配置生效)

驗證安裝:使用mono -V產看相關資訊。

6.安裝xsp:

tar jxvf xsp-3.8.tar.gz(解壓軟體包)

cd xsp-3.8(切換目錄,進入xsp解壓目錄)

./configure --prefix=/opt/mono

make

make install

三、配置相關軟體

1.配置nginx

vim /opt/nginx/conf/nginx.conf(進入設定檔)

server {

         listen   80;

         server_name  192.168.1.81;              --本機ip

         location / {

                 root /data0/web;                --網站的家目錄

                 index index.html index.htm;     --首頁

                 fastcgi_index index.aspx;       --網站預設首頁

                 fastcgi_pass 127.0.0.1:9000;    

                 include fastcgi_params;

         }

 }

2.配置fastcgi_params

vim /opt/nginx/conf/fastcgi_params

fastcgi_param  PATH_INFO           "";

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

--在設定檔中增加這兩行

四、軟體啟動

1.載入nginx

/opt/nginx/sbin/nginx -s reload

2.啟動fastcgi_mono

fastcgi-mono-server2 /applications=/:/data0/web /socket=tcp:127.0.0.1:9000 &

五、對整體進行測試

將相關程式上傳至網站家目錄/data0/web(測試程式串連:http://pan.baidu.com/s/1pL4Dh8J)

test下面的程式正常顯示頁面:

web下面的程式正常顯示頁面:

centos6.5+mono+nginx跑asp.net

相關文章

聯繫我們

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