Giter Site home page Giter Site logo

dotnet.pi.switch's Introduction

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?tabs=aspnetcore2x&view=aspnetcore-2.1

https://www.microsoft.com/net/download/linux-package-manager/ubuntu16-04/sdk-2.1.4

#install SDK x64: wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb

sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install dotnet-sdk-2.1.4

#arm: https://www.microsoft.com/net/download/thank-you/dotnet-sdk-2.1.302-linux-arm32-binaries wget https://download.microsoft.com/download/4/0/9/40920432-3302-47a8-b13c-bbc4848ad114/dotnet-sdk-2.1.302-linux-arm.tar.gz mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-2.1.302-linux-arm.tar.gz -C $HOME/dotnet export DOTNET_ROOT=$PATH:$HOME/dotnet export PATH=$PATH:$HOME/dotnet

#proxy apt-get install nginx

alleen nodig na eerste setup

sudo service nginx start

http://<server_IP_address>/index.nginx-debian.html

modify /etc/nginx/sites-available/default

server { listen 8080; server_name localhost; location / { proxy_pass http://localhost:5000; 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; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }

#firewall sudo ufw allow 8080

create server file: sudo nano /etc/systemd/system/kestrel-pi-gpio.service

[Unit] Description=Example .NET Web API App running on Ubuntu

[Service] WorkingDirectory=/home/opvolger/runapi ExecStart=/home/opvolger/dotnet/dotnet /home/opvolger/runapi/api.rpi.gpio.dll Restart=always

Restart service after 10 seconds if the dotnet service crashes:

RestartSec=10 SyslogIdentifier=dotnet-rpi-gpio User=opvolger Environment=ASPNETCORE_ENVIRONMENT=Production Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install] WantedBy=multi-user.target

systemctl enable kestrel-pi-gpio.service systemctl start kestrel-pi-gpio.service systemctl status kestrel-pi-gpio.service

sudo journalctl -fu kestrel-pi-gpio.service

sudo journalctl -fu kestrel-pi-gpio.service --since "2016-10-18" --until "2016-10-18 04:00"

dotnet.pi.switch's People

Contributors

opvolger avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.