In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to achieve Mono and Asp.net under CentOS". In the daily operation, I believe that many people have doubts about how to achieve Mono and Asp.net under CentOS. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to achieve Mono and Asp.net under CentOS". Next, please follow the editor to study!
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
Wget
Wget
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
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.
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.
b. Test whether other machines under the same lan can be accessed:
Open it with the browser of another machine
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
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 it with a browser
At this point, the study on "how to achieve Mono and Asp.net under CentOS" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.