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

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

Aug 08, 2016 am 09:21 AM
devel mono nbsp nginx

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 of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to allow external network access to tomcat server How to allow external network access to tomcat server Apr 21, 2024 am 07:22 AM

To allow the Tomcat server to access the external network, you need to: modify the Tomcat configuration file to allow external connections. Add a firewall rule to allow access to the Tomcat server port. Create a DNS record pointing the domain name to the Tomcat server public IP. Optional: Use a reverse proxy to improve security and performance. Optional: Set up HTTPS for increased security.

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

Steps to run ThinkPHP Framework locally: Download and unzip ThinkPHP Framework to a local directory. Create a virtual host (optional) pointing to the ThinkPHP root directory. Configure database connection parameters. Start the web server. Initialize the ThinkPHP application. Access the ThinkPHP application URL and run it.

Welcome to nginx!How to solve it? Welcome to nginx!How to solve it? Apr 17, 2024 am 05:12 AM

To solve the "Welcome to nginx!" error, you need to check the virtual host configuration, enable the virtual host, reload Nginx, if the virtual host configuration file cannot be found, create a default page and reload Nginx, then the error message will disappear and the website will be normal show.

How to communicate between docker containers How to communicate between docker containers Apr 07, 2024 pm 06:24 PM

There are five methods for container communication in the Docker environment: shared network, Docker Compose, network proxy, shared volume, and message queue. Depending on your isolation and security needs, choose the most appropriate communication method, such as leveraging Docker Compose to simplify connections or using a network proxy to increase isolation.

How to generate URL from html file How to generate URL from html file Apr 21, 2024 pm 12:57 PM

Converting an HTML file to a URL requires a web server, which involves the following steps: Obtain a web server. Set up a web server. Upload HTML file. Create a domain name. Route the request.

How to deploy nodejs project to server How to deploy nodejs project to server Apr 21, 2024 am 04:40 AM

Server deployment steps for a Node.js project: Prepare the deployment environment: obtain server access, install Node.js, set up a Git repository. Build the application: Use npm run build to generate deployable code and dependencies. Upload code to the server: via Git or File Transfer Protocol. Install dependencies: SSH into the server and use npm install to install application dependencies. Start the application: Use a command such as node index.js to start the application, or use a process manager such as pm2. Configure a reverse proxy (optional): Use a reverse proxy such as Nginx or Apache to route traffic to your application

What are the most common instructions in a dockerfile What are the most common instructions in a dockerfile Apr 07, 2024 pm 07:21 PM

The most commonly used instructions in Dockerfile are: FROM: Create a new image or derive a new image RUN: Execute commands (install software, configure the system) COPY: Copy local files to the image ADD: Similar to COPY, it can automatically decompress tar archives or obtain URL files CMD: Specify the command when the container starts EXPOSE: Declare the container listening port (but not public) ENV: Set the environment variable VOLUME: Mount the host directory or anonymous volume WORKDIR: Set the working directory in the container ENTRYPOINT: Specify what to execute when the container starts Executable file (similar to CMD, but cannot be overwritten)

Can nodejs be accessed from the outside? Can nodejs be accessed from the outside? Apr 21, 2024 am 04:43 AM

Yes, Node.js can be accessed from the outside. You can use the following methods: Use Cloud Functions to deploy the function and make it publicly accessible. Use the Express framework to create routes and define endpoints. Use Nginx to reverse proxy requests to Node.js applications. Use Docker containers to run Node.js applications and expose them through port mapping.

See all articles