My notes from ChatGPT: List of Cancer hospitals in India

Here is a list of some well-known cancer hospitals in India: Tata Memorial Hospital, Mumbai : One of the oldest and most reputed cancer hospitals in India, known for its comprehensive cancer care and research. All India Institute of Medical Sciences (AIIMS), New Delhi : AIIMS is a premier medical institute in India with a dedicated cancer treatment center that offers advanced care and research facilities. Adyar Cancer Institute, Chennai : Known for its expertise in cancer treatment and research, particularly in radiation oncology and surgical oncology. Rajiv Gandhi Cancer Institute and Research Centre, Delhi : A leading cancer hospital providing comprehensive cancer care with state-of-the-art facilities. Cancer Institute (WIA), Chennai : Founded by Dr. Muthulakshmi Reddy, it is one of the oldest cancer hospitals in India, known for its pioneering work in cancer treatment and research. Apollo Hospitals, Chennai : Part of the Apollo Group, it offers specialized cancer care across various...

Setting up your VPS for .Net Core self hosting - Part 1

Ever wondered, how can you set up a cost-effective Virtual Private Server for .Net Core hosting? 

In this blog, I am discussing how to set up your own VPS for .Net Core self-hosting. 

Here are the steps:

  1. Set up an Ubuntu Server
  2. Install Asp.Net Core runtime
  3. Install Nginx
  4. Upload your published files in a folder on the server
  5. Configure nginx to receive and forward requests to the Kestrel Server
  6. Reload nginx config so that nginx reads the latest config
  7. Are you getting 502?
  8. Run the dll
  9. yay!

1. Setup an Ubuntu Server

I have set up an AWS Lightsail Server. You can follow this video to do the same.

2. Install Asp.Net Core runtime

I have followed this link for that:

Since I have Ubuntu20.x, the only commands that I ran to install dotnet core runtime are:

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y aspnetcore-runtime-3.1

To verify dotnet runtime run "dotnet --info"

3. Install Nginx

I have followed this link to install nginx and the only commands I ran were:
sudo apt-get update 
sudo apt-get install nginx

4. Upload published files to the server

Ideally, I recommend using Azure Pipelines which should own the responsibility of building the package and publishing the files on the server. For this demo, you can follow video in step 1 to upload the files using FTP.

5. Configure nginx to receive and forward requests

  • Run `sudo nano  /etc/nginx/sites-available/default`
  • Modify the contents of as below (Replace the text in <> with your own values):
    server {
            listen 80;
    #       listen [::]:80;
    #
            server_name ;
    #
            root /var/www/;
    #       index index.html;
    #
            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;
            }
    }

6. Reload nginx config so that nginx reads the latest config

Run `sudo nginx -s reload`

This command makes nginx read the latest configuration

7. Are you getting 502 Bad Gateway?

At this time, if you are getting bad gateway, then you should look in /var/log/nginx/error.log and you would get to know that you have not run the dll yet.

8. Run your dotnet application

Run the command in the directory where your files are available `dotnet <your dll>`

9. Check your website again. It should work fine. 

If your application did not work fine, please comment the issue that you are facing. I'll try my best to help you out. You have hosted a .Net Core application on your own VPS.

Next Steps?

We'll talk in the next blogs about running the dotnet application as a service and lot more. So, stay connected. 😊