Build an ASP. NET core environment and install Jexus in the CentOS environment

Source: Internet
Author: User
Tags dotnet

?? After the. NET Core2.0 came out, many companies started to practice production, the reasons for which presumably we all understand, the most important points.

    • Cross-platform, can be deployed in Linux and Docker containers

    • Superior performance, about 20 times times the time of node testing

    • Communities are starting to live more and more, with a lot of good open source projects

Installing the. NET Core Development Environment adds a dotnet product feed in two steps:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.ascsudo sh -c 'echo -e "[packages-microsoft-com-prod]name=packages-microsoft-com-prod baseurl= https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prodenabled=1gpgcheck=1gpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'
Install the. Net Core
    • Update the Software Warehouse
    • Download. NET SDK2.0

      sudo yum updatesudo yum -y install libunwind libicusudo yum install dotnet-sdk-2.0.3

      Above we have installed the. NET core environment, below we can start to run a console application, output the almighty "Hello World"

      dotnet new console -o helloworldAppcd helloworldAppdotnet run

      Is it a success, a sense of accomplishment, continue to go down.
      Create an ASP. NET core Web application.

      cd /homedotnet new razor -o webappcd webappdotnet run

      The following will be an error, no hurry Oh ~ "Unable to bind to http://localhost:5000 on the IPV6 loopback interface: ' Error-99 eaddrnotavail Address not a Vailable "
      Continue, we can install Jexus after completion in resolving

Installing the standalone version of Jexus
curl https://jexus.org/release/x64/install.sh|sh
Configure Jexus, and publish our site to Jexus

Create a directory for our publishing site

mkdir -p /var/www/websitecd /home/webapp/                  --我们前面创建的Web站点dotnet publish -o /var/www/website   --发布到website目录下
Configuring the Jexus Web site
    • Switch to the Jexus configuration file directory
    • Copy the default configuration file to Aspnetcore
      ```
      Cd/usr/jexus/siteconf
      CP Default Aspnetcore
      VI Aspnetcore
      Port=80
      root=//var/www/website
      hosts= * #OR your.com,*.your.com

Apphost={cmdline=dotnet/var/www/aspnetcore/webapp.dll; approot=/var/www/website/; Port=0}

注意这里的端口port = 0不是站点的端口,而是Jexus映射的端口,这里写0即可- 最后删除Jexus的配置文件default- 启动Jexus

Rm-rf/usr/jexus/siteconf/default
Sh/usr/jexus/jws start
```

Last visited site

After the startup/Restart is successful, enter the IP address/domain name in the browser: the port number to access the ASP. NET Core application:

Build an ASP. NET core environment and install Jexus in the CentOS environment

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.