Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to run Mono and Asp.net under CentOS

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to run Mono and Asp.net under CentOS". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to run Mono and Asp.net under CentOS.

Download the compilation environment:

Yum install gcc bison pkgconfig glib2-devel gettext make httpd-devel gcc-c++ libstdc++-devel

Download and extract the source code:

Wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.6.3.tar.bz2

Wget http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.6.3.tar.bz2

Wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.6.3.tar.bz2

Tar-jxvf mono-2.6.3.tar.bz2

Tar-jxvf xsp-2.6.3.tar.bz2

Tar-jxvf mod_mono-2.6.3.tar.bz2

Install the mono environment:

Cd / root/mydir/mono-2.6.3

. / configure-- prefix=/opt/mono; make; make install

Echo export pkg_config_path=/opt/mono/lib/pkgconfig:$pkg_config_path > > ~ / .bash_profile

Echo export path=/opt/mono/bin:$path > > ~ / .bash_profile

Source / .bash_profile

Install xsp:

Cd / root/mydir/xsp-2.6.3

. / configure-- prefix=/opt/mono; make; make install

Install mod_mono:

First use the find /-iname apr*config command to find out "--with-apr-config=/usr/bin/apr-1-config" (I don't know what's the use of with-apr-config=/usr/bin/apr-1-config, it seems to be OK if you don't want it, please tell me if you know)

Then execute the following command:

Cd / root/mydir/mod_mono-2.6.3

. / configure-prefix=/opt/mono-with-mono-prefix=/opt/mono-with-apr-config=/usr/bin/apr-1-config; make; make install

Cp / etc/httpd/conf.d/ / etc/httpd/conf/mod_mono.conf

Selinux blocks httpd's access to mod-mono-server, so execute the following statement:

Setsebool-p httpd_disable_trans=1

Restart the httpd server:

Service httpd restart

Open port 80 in the firewall to allow other machines with the same lan to access:

Method 1. When not using graphical interface tools, port 80 is allowed to be opened by turning off the firewall.

Service iptables stop

(ps: I have tried the following methods

Vi / etc/sysconfig/iptables

Add:-a rh-firewall-1-input-m state-- state new-m tcp-p tcp-- dport 80-j accept

Service iptables restart

Although you see http in iptables-l

However, the server cannot be accessed from another machine.

If anyone is successful, please let me know):

Method 2. When a graphical interface tool is installed, enter the graphical interface with startx and open port 80 with "security level and firewall".

Install libgdiplus (many of the test pages of xsp require libgdiplus):

Yum install httpd build-essential gcc bzip bison pkgconfig glib-devel\

Glib2-devel httpd-devel libpng-devel libx11-devel freetype fontconfig\

Pango-devel ruby ruby-rdoc gtkhtml38-devel wget

Wget http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.6.2.tar.bz2

Tar-jxvf libgdiplus-2.6.2.tar.bz2

Cd / root/mydir/libgdiplus-2.6.2

. / configure

Make; make install

Echo export ld_library_path=/usr/local/lib/:$ld_library_path > > ~ / .bash_profile

Source / .bash_profile

Vi / opt/mono/etc/mono/config

Add a node:

Otherwise, an exception to dllnotfoundexception will occur.

Test:

First, test mono

a. Run mono-v output:

Mono jit compiler version 2.6.3 (tarball fri apr 2 06:13:46 cst 2010)

Copyright (c) 2002-2010 novell, inc and contributors. Http://www.mono-project.com/

Tls: _ _ thread

Gc: included boehm (with typed gc and parallel mark)

Sigsegv: altstack

Notifications: epoll

Architecture: x86

Disabled: none

b. Run the mono-test-install output:

Active mono: / opt/mono/bin/mono

Your have a working system.drawing setup

Your file system watcher is: system.io.inotifywatcher

Second, test the asp.net server

a. Test whether the aspx can be executed:

Create a test.aspx page under the / var/www/html/ directory with the following contents

Download the contents of the page through wget http://localhost/test.aspx.

b. Test whether other machines under the same lan can be accessed:

Open http://ip/test.aspx with the browsers of other machines

c. Run the test program that comes with xsp (click on a few more pages to see if there will be a gdiplus.dll dllnotfoundexception game):

1. Modify the configuration of apache to open firewall port 8080

Listen 8080

Namevirtualhost *: 8080

Serveradmin hlfstephen@gmail.com

Documentroot / var/www/test/

Servername local.mydomain.com

Errorlog logs/local.mydomain.com-error_log

Customlog logs/local.mydomain.com common

two。 Copy the / opt/mono/lib/xsp/test directory to var/www/

3.service httpd restart

4. Open http://ip:8080/ with a browser

Thank you for reading, the above is the content of "how to run Mono and Asp.net under CentOS". After the study of this article, I believe you have a deeper understanding of how to run Mono and Asp.net under CentOS, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report