Centos + mono + nginx + jexus build a linux c # running environment test 1. Update the system, install the compiling environment, and prepare for compiling the Mono source code.
1. update the system yum-y update
2. install the required library yum-y install wget glib2-devel libtiff-devel libjpeg-devel giflib-devel libpng-devel libX11 libX11-devel freetype-devel fontconfig- devel libexif-devel gcc-c ++ gettext unzip zip bzip2 bzip2-devel curl-devel gtk2-devel boost-devel
3. Install the library Libgdiplusgit required by Mono to clone git: // github.com/mono/libgdiplus.git
Cd libgdiplus
./Autogen. sh -- prefix =/usr
Make & make install
Second, the source code install Mono 3.43.4 this version of the official source code package, less files, so that the installation will have problems, specific can refer to the mono-3.4.0 source code Installation Problems (http://www.cnblogs.com/shanyou/p/3655447.html) solution. Or download from http://pan.baidu.com/s/1eQ452Ie directly
Upload the downloaded file to/usr/local/src.
Tar-zxvf mono-3.4.0.tar.gz
./Configure -- prefix =/usr -- libdir =/usr/lib64
Here we add -- libdir =/usr/lib64, which is mainly P/Invoke. For details, refer to MONO x64 amd_x64.
Make & make install
If mono-V has mono version information, the installation is successful.
If the CentOS version is 64-bit, we recommend that you run
CommandLdconfig. We recommend that you use ldconfig after installing mono. (Ldconfig
CommandIs mainly used in the default search directory (/lib and/usr/lib) and dynamic library configuration file/etc/ld. so. find the shared dynamic link library under the directory listed in conf (format as described earlier, lib *. so *) to create a dynamic loader (ld. so) the required connection and cache file. the default cached file is/etc/ld. so. cache, this file stores the list of Dynamic Linked Library names in the sorted order .)
In addition, it is very important to specify the/usr (. /configure -- prefix =/usr). If you install it in a folder that is "not understood" by the system, it will not work for ldconfig only, but also in/etc/ld. so. conf file or/etc/ld. so. conf. d
After adding the path to ldconfig.
3. Install Jexus 5.5
Since version 5.3.1, the installation process of Jexus has been simplified and two new scripts are built in: "install" and "upgrade ", the Jexus installation process is automated based on the original "installation" and "Upgrade. The installation and upgrade methods of jexus have not changed much. Therefore, you can still use the previous installation methods for users who are used to using versions earlier than 5.3.1.
Wget linuxdot.net/down/jexus-5.6.1.tar.gz
Tar-zxvf jexus-5.6.1.tar.gz
Cd jexus-5.6.1
./Install
Installation complete ~!!! When the install script is executed, jexus is installed in/usr/jexus/by default. If you want to install jexus in another directory, you can add a DIRECTORY parameter when executing the script (for example, sudu install/usr/local/jexus /). Execute the upgrade script for the upgrade.
Start jexus to check if it is normal
Start/usr/jexus/jws start
Stop/usr/jexus/jws stop
Restart/usr/jexus/jws restart
Since then, you can use http: // your IP/info to verify that Jexus is enabled
5. Add as system service and start with the System
Install Mono and Jexus in Centos and Ubuntu written by Zendic, and add Jexus as the System Service Code:
Cd/etc/init. d/
Vi jws
In the I edit mode, paste the following content
#! /Bin/bash
# Chkconfig: 2345 80 05
# Description: jws
#
./Etc/rc. d/init. d/functions
Case "$1" in
Start)
Echo "Jexus Start .."
/Usr/jexus/jws start
;;
Stop)
Echo "Jexus Stop .."
/Usr/jexus/jws stop
;;
Restart)
Echo "Jexus Restart"
/Usr/jexus/jws restart
;;
Status)
/Usr/jexus/jws status
;;
*)
Exit 1
;;
Esac
Exit $ RETVAL
Press ESC and enter wq to save the file.
Add this script as a "service"
Chmod 766 jws
Chkconfig -- add jws
So far, JEXUS has started with the system. Please try again in reboot.
You can also modify the site configuration by modifying the files in/usr/jexus/siteconf.
To test the asp.net website, run cp/usr/jexus/sitconf/default/usr/jexus/sitconf/mysite1 to get your own site configuration and change the ports and file directories in it.
Port = 80
Root = // var/www/html/mysite1
Create a new mysite1 file under/var/www/html/and put the website file in
Http: // ip/page address access, case sensitive
This scheme is tested and passed. A simple asp.net website is running normally, but an original website running normally in iis is put in, and an error occurs. I do not know the cause of the error yet.
---- CentOS build Nginx + Mono run ASP. NET environment --- From http://www.centoscn.com/CentosServer/www/2014/0807/3449.html
1. Obtain open-source related programs 1. Use the yum Command provided by CentOS Linux to install and upgrade the required libraries:
Sudo-s
LANG = C
Yum-y install gcc-c ++ autoconf libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel zlib-devel glibc-devel glib2 glib2-devel bzip2 bzip2-devel bison pkgconfig glib2-devel gettext make
2, download the program source package Nginx installation package: http://nginx.org/en/download.html
Mkdir-p/down
Cd/down
Wget http://nginx.org/download/nginx-1.1.11.tar.gz
Mono download: Official Site: http://download.mono-project.com/sources/mono/ (Please download the latest version)
Wget http://download.mono-project.com/sources/mono/mono-2.10.7.tar.bz2
Libgdiplus download: http://download.mono-project.com/sources/libgdiplus/ (Please download the latest version)
Wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2
Xsp download: http://download.mono-project.com/sources/xsp/ (Please download the latest version)
Wget http://download.mono-project.com/sources/xsp/xsp-2.10.2.tar.bz2
Pcre download (pcre Library required for Nginx): FTP: // ftp. csx. cam. ac. uk/pub/software/programming/pcre/(Please download the latest version)
Wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.gz
2. Install and compile Nginx1 and install the pcre Library required for Nginx Installation
Cd/down
Tar zxvf pcre-8.21.tar.gz
Cd pcre-8.21/
./Configure
Make & make install
Cd ../
2. Create www users and groups
/Usr/sbin/groupadd www
/Usr/sbin/useradd-g www
Mkdir-p/data0/web
Chmod + w/data0/web
Chown-R www: www/data0/web
3. Install Nginx
Tar zxvf nginx-1.1.11.tar.gz
Cd nginx-1.1.11/
./Configure -- user = www -- group = www -- prefix =/opt/nginx -- with-http_stub_status_module -- with-http_ssl_module
Make & make install
Cd ../
4. Open Port 80
Iptables-I INPUT-p tcp -- dport 80-j ACCEPT
Start nginx
1
/Opt/nginx/sbin/nginx
Enter the access address http: // 192.168.1.1 in the browser (based on the personal address page). The default nginx page is displayed normally.
3. Install and compile Mono1 and libgdiplus
Cd/down
Tar-jxvf libgdiplus-2.10.tar.bz2
Cd libgdiplus-2.10
./Configure -- prefix =/usr
Make & make install
Ldconfig
2. Install Mono
Tar-jxvf mono-2.10.7.tar.bz2
Cd mono-2.10.7
./Configure -- prefix =/usr
Make & make install // This process takes a long time
Ldconfig
Echo export PKG_CONFIG_PATH =/usr/lib/pkgconfig: $ PKG_CONFIG_PATH> ~ /. Bash_profile
Echo export LD_LIBRARY_PATH =/usr/lib: $ LD_LIBRARY_PATH> ~ /. Bash_profile
Echo export PATH =/usr/bin: $ PATH >> ~ /. Bash_profile source ~ /. Bash_profile
If mono-V has mono version information, the installation is successful.
3. Install XSP
Cd/down
Tar-jxvf xsp-2.10.2.tar.bz2
./Configure -- prefix =/usr
Configure: error: You need to install 'gmcs 'appears. error
XSP Installation failed
Make & make install
4. Configure Nginx
Vi/opt/nginx/conf/nginx. conf
Server {
Listen 80;
Server_name localhost;
Location /{
Root/data0/web;
Index index.html index.htm;
Fastcgi_index Default. aspx;
Fastcgi_pass 127.0.0.1: 9000;
Include fastcgi_params;
}
}
5. Configure fastcgi_params and add the following two lines.
Vi/opt/nginx/conf/fastcgi_params
Fastcgi_param PATH_INFO "";
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
6. Start
1. Restart nginx
/Opt/nginx/sbin/nginx-s reload
2. Start the fastcgi_mono Server
Fastcgi-mono-server2/applications =/:/data0/web/socket = tcp: 127.0.0.1: 9000 &
Failed to test, the fastcgi-mono-server2 could not find the command
VII. Test
Create an asp.net Web project and upload it to the/data0/web directory for testing.