HW10: Running ASP.NET core on Linux
Using the links below, configure your site as follows.
- Setup apache as a web proxy to your kestrel server with a lets encrypt certificate for your valid cs.southern.edu host.
- Setup the kestrel server to run as a service. Make sure it starts by default!
- Setup your project on kestrel to reverse proxy back to the apache service
Create a video that tests the following
Demo
- I will want to see your kestrel service
- stop and start,
- verify that it will run at startup.
- Show a netstat that output that shows both kestrel service and apache service running on appropriates ports and IPs.
- Kestrel should be running on 127.0.0.1:5000 (http not https)
- Apache of course should be running on *:443 (https not http) with a valid certificate
- 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:
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:
Note: If you don't start it from the current directory, you will lose the static contents from wwwroot!
Deploy Steps
- Create the application
- Publish it to a directory
- Use scp or sftp (I'm using bitvise to do this) to copy the published directory to my linux instance
- Make sure it’s the correct directory
- Make sure that the ownership is www-data for ubuntu or apache for centos
- Restart kestrel (or whatever you named the service)
- Test the website.