HW10: Running ASP.NET core on Linux

Using the links below, configure your site as follows.

  1. Setup apache as a web proxy to your kestrel server with a lets encrypt certificate for your valid cs.southern.edu host.
  2. Setup the kestrel server to run as a service. Make sure it starts by default!
  3. Setup your project on kestrel to reverse proxy back to the apache service

Create a video that tests the following

Demo

  1. I will want to see your kestrel service
    1. stop and start,
    2. verify that it will run at startup.
  2. Show a netstat that output that shows both kestrel service and apache service running on appropriates ports and IPs.
    1. Kestrel should be running on 127.0.0.1:5000 (http not https)
    2. Apache of course should be running on *:443 (https not http) with a valid certificate
  3. Go to the web page and show that it is working correctly

Gotchas and Hints

IT IS VERY LIKELY THAT YOU ALSO ARE MISSING OTHER ELEMENTS TOO, NAMELY the following three modules. There is an easy fix for both of these and you can do it right from a command prompt:

   1 # sudo a2enmod headers
   2 # sudo a2enmod proxy
   3 # sudo a2enmod proxy_http
   4 # systemctl start apache2
   5 

So now you are ready! To run the application, you need to run it from the directory you would normally start the application from. I.e. cd to the directory the contains the .dll you are going to run. Then:

   1 # dotnet ./myfile.dll
   2 

Note: If you don't start it from the current directory, you will lose the static contents from wwwroot!

Deploy Steps

  1. Create the application
  2. Publish it to a directory
  3. Use scp or sftp (I'm using bitvise to do this) to copy the published directory to my linux instance
    1. Make sure it’s the correct directory
    2. Make sure that the ownership is www-data for ubuntu or apache for centos
  4. Restart kestrel (or whatever you named the service)
  5. Test the website.

WebServices/ProgrammingHomeworks/HW10 (last edited 2019-05-15 21:21:26 by scot)