How to publish site with Visual Studio 2017 to Linux server:
sudo apt-get update sudo apt-get install openssh-server unzip curl Y
- Go to VS2017 and hit publish on project:
- Set up debug mode on publish:
- Download WINSCP. https://winscp.net/eng/download.php
- Create new folder for your app.
- Copy all stuf from publish folder to new create folder on server
- In Putty go folder where you have copied your app:
cd //go out from myApp cd Music dotnet Musiction.API.dll //publish app
You should to see
Hosting environment: Production
Content root path: /root/Music
Now listening on: http://localhost:5000 - Your site is up and running on server, but it is not visible on internet. Open new Putty
sudo apt-get install nginx Y
- Go to /etc/nginx/sites-available/default. and replace content to:
server { listen 80; server_name 1.services.oktawave.com *.1.services.oktawave.com; 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; } }
- Run nginx
sudo nginx -t //verify if the syntax of the configuration files is correct sudo service nginx start
- Your site is visible on the internet under address: 1.services.oktawave.com/api/songs/ :)/
https://blogs.msdn.microsoft.com/premier_developer/2017/11/10/debugging-asp-core-on-linux-with-visual-studio-2017/
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.1&tabs=aspnetcore2x
Wow, this paragraph is nice, my younger sister is
analyzing such things, therefore I am going to inform her.