Home  >  Article  >  Backend Development  >  centos+mono+nginx+jexus builds c# running environment test under linux

centos+mono+nginx+jexus builds c# running environment test under linux

WBOY
WBOYOriginal
2016-08-08 09:21:281179browse

centos+mono+nginx+jexus builds c# running environment test under Linux

----Centos 7.0 installs Mono 3.4 and Jexus 5.6----

Quoted from http://www.cnblogs.com/shanyou/p/ 3887223.html
1. Update the system, install the compilation environment, and prepare for compiling Mono source code.

1. Update the system

yum –y update

2. Install the libraries required for Mono source code installation

yum -y install wget glib2-devel libtiff libtiff-devel libjpeg libjpeg-devel giflib giflib-devel libpng libpng-devel libX11 libX11- devel freetype freetype-devel fontconfig fontconfig-devel libexif libexif-devel gcc-c++ gettext unzip zip bzip2 bzip2-devel curl-devel gtk2-devel boost-devel

3. Install the GDI+ compatible API library Libgdiplus required by Mono

git clone git://github.com/mono/libgdiplus.git
cd libgdiplus
./autogen.sh --prefix=/ usr
make && make install

2. Source code installation Mono 3.4

3.4 This version of the official source code package is missing some files, so that installation problems may occur. For details, please refer to the problems that occur during mono-3.4.0 source code installation ( http://www.cnblogs.com/shanyou/p/3655447.html) solution. Or download directly from http://pan.baidu.com/s/1eQ452Ie
Download and upload to /usr/local/src
tar -zxvf mono-3.4.0.tar.gz
./configure --prefix=/ usr --libdir=/usr/lib64
Add --libdir=/usr/lib64 here, mainly P/Invoke, please refer to MONO x64 amd_x64
make && make install
Enter mono -V If there is mono version information, then The installation is successful.
If it is a 64-bit version of CentOS, it is recommended that you run the command ldconfig. It is recommended that everyone ldconfig after installing mono. (The purpose of the ldconfig command is mainly to search for shareable dynamic link libraries ( The format is as introduced before, lib*.so*), and then the connection and cache files required by the dynamic loader (ld.so) are created. The cache file defaults to /etc/ld.so.cache, and this file has been saved. A well-ordered list of dynamic link library names. )
Another point is also very important. When compiling Mono, you must specify the installation to /usr (./configure --prefix=/usr). If you install it into a system, you will not understand it at all. " folder, only ldconfig will not work. You must add the path to the /etc/ld.so.conf file or /etc/ld.so.conf.d
and then ldconfig.

3. Install Jexus 5.5


Starting from version 5.3.1, the installation process of Jexus has been simplified. Two new scripts are built-in. They are "install" and "upgrade", corresponding to the original "install" and " Upgrade", which automates the Jexus installation process. The installation and upgrade methods of jexus itself have not changed further, so for users who are accustomed to using versions before 5.3.1, you can still use the previous installation method.
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 completed~! ! ! When executing the install script, jexus is installed to /usr/jexus/ by default. If you want to install it to another directory, you can add a directory parameter when executing the script (such as sudu install /usr/local/jexus/). For upgrade, execute the upgrade script.
Start jexus and check if it is normal
Start /usr/jexus/jws start
Stop /usr/jexus/jws stop
Restart /usr/jexus/jws restart
From now on, use http://your IP/info Verify whether Jexus is started
5. Add it as a system service and start it with the system
Centos and Ubuntu written by Zendic install Mono and Jexus, which includes the code to add Jexus as a system service:
cd /etc/init.d/
vi jws
Press i in edit mode and 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

After pressing ESC, enter :wqSave the file
Add this script as a "service"
chmod 766 jws
chkconfig --add jws
At this point, JEXUS has started with the system, you can reboot and try it
You can also modify /usr/jexus/siteconf file to modify the site configuration.
To test the asp.net website, you can cp /usr/jexus/sitconf/default /usr/jexus/sitconf/mysite1 to copy your own site configuration and change the port and file directory inside
port=80
root= / /var/www/html/mysite1
Create a new mysite1 under /var/www/html/ and put the website files in
http://ip/page address access, pay attention to capitalization
This solution has been tested, simple I made an asp.net website and it runs normally, but when I put a website that was running normally on IIS, it ran into an error. The cause of the error is not yet known.

----CentOS builds Nginx+Mono to run ASP.NET environment---

Quoted from http://www.centoscn.com/CentosServer/www/2014/0807/3449.html

1. Obtain open source related programs

1. Use the yum command that comes with the CentOS Linux system to install and upgrade the required programs Library:

sudo -s
LANG=C
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. Download the program source code package

Nginx installation package: Download address: 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 website: 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 Latest version)

wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2
xspDownload: 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 by 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 Nginx

1. Install the pcre library required to install Nginx

cd /down
tar zxvf pcre-8.21.tar.gz
cd pcre-8.21/
./configure
make && make install
cd ../
2. Create www user and group

/usr/sbin/groupadd www
/usr/sbin/useradd -g www 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 (according to the personal local address page) on the browser, you will normally see the default nginx page

3. Install and compile Mono

1. Install 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 //It takes a long time here
ldconfig

echo export PKG_C/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
Enter mono -V. If there is 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', error
XSP failed to install
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 12 7.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 /applicati/data0/web /socket=tcp:127.0.0.1:9000 &
Failed to test, fastcgi-mono-server2 found If you don’t get this command
7. Test
Create a new asp.net Web project and upload it to the /data0/web directory and test it.
Another article about jexus http://wenku.baidu.com/link?url=CzIkvNlbyKg6jP0LJThY_PQmbAKI-5Ito-T9E7OMOSugNpJt_c59Wgb8K5XnOpcDgn6FgrAQ9-6HimQEt1t-zerHrM26nzsBaqvuB-0xmdO

The above introduces centos+mono+nginx+jexus to build c# running environment test under Linux, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn