Degree .netcore 1.0 app to Ubuntu?

  • Can you tell me how to put the ubuntu annex on the sale?

  • In general, the reference is fully detailed ( My steps were as follows (Ubuntu 16.04):

    1. Establish .net core if not determined;
    2. Load the application binary on prod server, make sure it starts. The server turns into Ubuntu, then Kestrel:
     var host = new WebHostBuilder()
    1. The article above recommends the use of nginx. Until is not very friendly with ssl and other things, and nginx can. That's why we put it. Normal routing can also be built: 1. Install: sudo apt-get install nginx 2. Start: sudo service nginx start 3. Check: sudo service nginx status
    2. In nginx.config (/etc/nginx/nginx.config), routing is built:

    location /test/gateway/ {

                        rewrite /test/gateway/(.*) /$1  break;
                        proxy_http_version 1.1;
                        proxy_set_header Upgrade $http_upgrade;
                        proxy_set_header Connection keep-alive;
                        proxy_set_header Host $host;
                        proxy_cache_bypass $http_upgrade;

    In proxy_pass, you indicate the way to your annex. I'm still on the same car with a test app and production. So use different URLs for their access.

    rewrite /test/gateway/(.*) /$1  break;

    This team changes url by removing /test/gateway/. Thus, access to the test and combat server is only different in the outer url, there is no need to change within the annex.

    1. Let's make the app uploaded at the start and overloaded at the fall. Systemctl is used for this. In /etc/systemd/system, create a file app_name.service with the following contents:
    Description=Gateway server for StreetFlow.

    ExecStart=/usr/bin/dotnet /etc/bt/st.gateway/GatewayServer.dll



    We're pointing out what team we need to do if we have to make a mistake. It is also possible to indicate dependence, say postgresql or nginx.
    After the service has been established, two teams have to be performed:
    sudo systemctl enable your_app
    sudo systemctl start your_app
    Sometimes after a change in configuration, the service may not start. It's being treated by a team.
    sudo systemctl daemon-reload.

    Congratulations, your app is full!

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2