GithubHelp home page GithubHelp logo

tbro-dev / dotnetlinuxdeploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mzand111/dotnetlinuxdeploy

0.0 0.0 0.0 19 KB

Files related to a sample video created to help .Net developers to publish a simple .Net web app to Linux server

License: MIT License

Shell 100.00%

dotnetlinuxdeploy's Introduction

Startnet Script for .NET Application on Linux

This repository contains a Bash script (startnet.sh) designed to automate the setup process of a .NET application environment on an Ubuntu server. This includes installing the .NET SDK, runtime, ASP.NET Core runtime, and configuring Nginx as a reverse proxy to forward requests to the .NET application. This project is a fork of DotNetLinuxDeploy: https://github.com/mzand111/DotNetLinuxDeploy

Prerequisites

  • A server running Ubuntu.
  • Sudo privileges on the server.

How to Use

  1. Clone the Repository

    First, clone this repository to your server:

    git clone <repository-url>
    cd <repository-name>

...or clone and move the startnet.sh script to your Ubuntu server:

  1. Make the Script Executable

    Change the permission of the script to make it executable:

    chmod +x startnet.sh
  2. Run the Script

    Execute the script by running:

    ./startnet.sh

    If you encounter the error: " /bin/bash^M: bad interpreter: No such file or directory". Run the script below:

       sudo apt install dos2unix
       dos2unix ./startnet.sh

    Follow the on-screen prompts to enter your applications name and your user name when requested. These inputs are crucial for setting up the environment correctly.

What the Script Does

Here's a breakdown of the tasks performed by startnet.sh:

  • Prompts you for your application's name and your user name.
  • Installs the .NET SDK, runtime, and ASP.NET Core runtime using the Microsoft package signing key and package repository.
  • Installs Nginx and configures it to forward requests to your .NET application.
  • Sets up a directory for your application and configures the necessary permissions.
  • Creates a systemd service file for your application, enabling and starting the service.
  • Reloads Nginx to apply the configuration changes.

Manual Steps

After running the script, you need to manually deploy your .NET application:

  • Copy your application to /var/www/app.
  • Run sudo dotnet <YourAppName>.dll inside /var/www/app.

Final Notes

  • The script is designed for use on Ubuntu and has been tested with Ubuntu 20.04 LTS.
  • Ensure you have sudo privileges on your server to run the script successfully.
  • Modify the script according to your specific needs or Ubuntu version if necessary.

For any issues or contributions, please open an issue or a pull request in this repository.


dotnetlinuxdeploy's People

Contributors

mzand111 avatar tbro-dev 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.