Jexus Deploying ASP. NET Core Project

Source: Internet
Author: User
Tags dotnet

In my previous blog project, I published my. NET core to the cent OS, using the Nginx agent and the Supervisor Process Daemon, looked at my blog's Children's shoes, also found that this way is more troublesome, light command line on the head of the big, a total of two or three times deployed, But every time the same is to turn over the blog data, think or IIS good, click a few mouse to complete, not so many steps. I have been trying to use Jexus to deploy my project, also has no time to do, today, while outside the rain, carefully study this stuff.

Jexus Baidu Encyclopedia:

Jexus, or Jexus Web server, or JWS, is an ASP. NET Web server on Linux platform, which is the core program of ASP. Linux, Unix, FreeBSD and other non-Windows systems is an optional scenario for enterprise-class ASP. Compared with other Web servers, Jexus not only has the characteristics of cross-platform ASP, but also has kernel-level security monitoring, intrusion detection, URL rewriting, no file Routing and a series of important functions and proprietary features.

The definition of it is simple and straightforward, that is, an ASP. NET Web server on Linux, equivalent to the official release of iis,jexus5.8.2 on our Windows provides platform support for ASP. NET core into the production environment.

The highlight of this release is the addition of a "AppHost" configuration item that incorporates HTTP self-hosted applications (such as ASP. JS applications, etc.) into the Jexus process sequence for control (start, stop, restart, auto-resume after crash, etc.) Provides a strong platform for ASP. NET core applications into the enterprise production environment. Advantages of using Jexus to consolidate ASP: 1) support multiple sites, the same port can support any number of ASP.
2) application start, stop, restart and site start, stop, restart and other operations consistent, no need to manually manage the ASP.
3) with application crash after automatic restart function, for enterprise-class uninterrupted operation protection;
4) has a higher performance advantage than the reverse proxy;
5) Provide the same HTTP environment parameters as IIS.

Below, I will first stop my project, will supervisor and Nginx stop running, first will supervisor stop running, because supervisor set up boot, I need to disable it first:

Disable startup command: Systemctl disable Supervisord

To see if the boot command is on: Systemctl is-enabled Supervisord

As shown: Indicates that the boot is turned off and can be restarted.

At this time I restarted, my project will not be able to access, for the following content, we will start supervisor, the command, as shown in the following, we re-visit, then the site has been restored, the table name of our service has been launched

Execute Supervisorctl Stop all to stop all processes and display DayaliBlog.Web:Stoped after execution. Then we stop the Nginx, the command is: Systemctl stop nginx. Stop these services to eliminate these effects on Jexus, although I do not know what will affect. Now that my project is completely inaccessible, let's start by installing Jexus and deploying our. NET Core project.

Install jexus5.8.2 standalone version mkdir tempcd tempwget linuxdot.net/down/jexus-5.8.2-x64.tar.gztar zxvf jexus-5.8.2-x64.tar.gzcd Jexus /CD siteconf/

After installation, we go to modify the parameters in the default file in Siteconf, and the parameters to be configured are as follows:

Format: apphost={cmdline= life Line; approot= working path; port= Port Number} Description: CmdLine: Required option. Represents the command (with parameters) to start the Web application, such as cmdline= Dotnet/var/www/aspnetcore/aspnetcorestarted.dll       AppRoot: Required. Represents the working directory for this application, such as: Approot=/var/www/aspnetcore       Port: Optional. Represents the listening port for this application, with multiple ports separated by commas (note: If this is not the case, please fill in the port number in Apphost.port or reproxy, otherwise the request data cannot be forwarded to the application).       ENV: Optional parameter. Represents the environment variables that are required for this application to work, such as env= (Path=/usr/local/bin:/var/www/aspnetcore: $PATH), with multiple settings separated by commas.       errlog: Options available. Indicates that the exception output of this application is redirected to the specified file (the full path is required), and if the log is not output, it can be outlog. At this point, the Jexus will automatically switch off the console output (essentially redirected to/dev/null);       outlog: Optional. Indicates that the console output of this application is redirected to the specified file (full path required);       User: Optional. Runs the application as the specified user, which is the default root identity. Note:   1,apphost, like Apphost.port, does not support virtual paths; The   2,apphost feature is to manage the specified HTTP service-capable Web application into Jexus worker processes for the ASP. Self-hosted web programs such as core or node. js are useful for production environments.

Follow the instructions above to modify the parameters I want to configure

####################### Web site:default ####################################### #port =80root=//root/ dayaliblog.webhosts=* #OR your.com,*.your.com# addr=0.0.0.0# checkquery=falsenolog=true AppHost={CmdLine=dotnet/ Root/dayaliblog.web/dayaliblog.web.dll; Approot=/root/dayaliblog.web; port=5000}# nofile=/index.aspx Keep_alive=false usegzip=falseoutlog=/tmp/out.txt; errorlog=/tmp/err.txt;# usehttps=true# ssl.certificate=/x/xxx.crt #or pem# ssl.certificatekey=/x/xxx.key# ssl.protocol=tlsv1.0 # TLSv1.1 or TLSv1.2 ... # ssl.ciphers= # denyfrom=192.168.0.233, 192.168.1.*, 192.168.2.0/24# allowfrom=192.168.*.*# DenyDirs=~/cgi, ~/upfiles # indexes=myindex.aspx# rewrite=^/.+?\. (asp|php|cgi|pl|sh) $/index.aspx# reproxy=/bbs/http://192.168.1.112/bbs/# host. redirect=abc.com www.abc.com 301# responsehandler.add=mykey:myvalue# jexus php fastcgi address is '/var/run/jexus/ Phpsvr ' ######################################################## fastcgi.add=php|socket:/var/run/jexus/phpsvr# PHP-FPM Listen ADdress is ' 127.0.0.1:9000 ' ############################################# fastcgi.add=php|tcp:127.0.0.1:9000yi ' s 

The above # is the comment line, the default Apphost parameter entry is commented, need to uncomment, set the Apphost parameter, need to start Jexus, execute command as follows, need to switch to Jexus file directory

After successful execution, visit our project again to access the success.
Below we need to set the Jexus to boot, the command is as follows:

cd/etc/init.d/       vi JWs Press I edit mode, paste the following content #!/bin/bash#chkconfig:2345 05#description:jws#./etc/rc.d/init.d/ Functionscase "Instart"  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  ;; Esacexit $RETVAL Press ESC, enter: Wq save file Add this script as a "service" chmod 766 jwschkconfig--add JWs

So far, we have successfully deployed our. NET core project, and the Jexus is relatively simple compared to nginx+supervisor, and Jexus performance is comparable to that of IIS.

Reference blog:

Http://www.cnblogs.com/linqingfeng/archive/2013/06/14/3135716.html

Https://mp.weixin.qq.com/s/k0qVppETGDMZ4AUA9IDu1Q

Jexus Deploying ASP. NET Core Project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.