Linux serverlinux web serverNETWORK ADMINISTRATIONS

Deploy .NET Web Applications To A Linux Server | Development Guides

Useful Links :
– Repository Used
https://github.com/ZairiAimenDz/ECommerce_MVC
– Digital Ocean Link
https://m.do.co/c/8bf560e88a20
– Hostinger Link
https://hostinger.com?REFERRALCODE=1CASUALDEV28

=========== Deployment Script ============

cd
cd ECommerce_MVC/ECommerce_MVC/
git pull
dotnet publish -c Development -p:PublishProfile=FolderProfile -o ./publish
cd publish
sudo systemctl stop ecomm
sudo mkdir /var/www/Ecomm
sudo rsync -a * /var/www/Ecomm/
sudo chown -R www-data /var/www
sudo systemctl start ecomm
echo “Ecom App”
sudo systemctl is-active ecomm

=======================================

========= Service File Example ============

[Unit]
Description=EComm

[Service]
WorkingDirectory=/var/www/CRMService
ExecStart=/var/www/CRMService/CRM.API
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=3
KillSignal=SIGINT
SyslogIdentifier=crm
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=ASPNETCORE_URLS=http://localhost:5100
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

=======================================

=======================================
https://zairiaimen.com
=======================================

source

by Zairi Aimen

linux web server