|There are two common use cases:
- 1 Using GitHub to Manage or Host an MIT Website
- 1.1 Option One: github.io
- 1.2 Option Two: github.mit.edu, AFS, web.mit.edu
Example URLs and Usernames
In this article, many example URLs and usernames are needed to explain functionality. For the purposes of clarity and internal consistency, the following are used:
|Name of Project/Website/Locker
|Alpha Group, Alpha Project, alpha.mit.edu, web.mit.edu/alpha, /mit/alpha
|Username on Public GitHub
|MIT Username and Associated AFS Homedir Locker
|Having DNS records created for your site requires a Cost Object. While there is no charge for this process, it is intended for official DLC purposes, and the Cost Object helps assign long-term ownership for the record.
Make a GitHub Pages repository, see the instructions here.
Once the site is ready, IS&T can make DNS records to point to it. From Connecting an MIT URL to an Outsourced Website:
You should establish a bravo.github.io hostname for the entire site; we will not be able to work with a requested path that is bravo.github.io/delta.
Note also that we do not provide Github Pages functionality on our internal github (github.mit.edu) - you must use the externally hosted github if you wish to host web content there.
We will provide a single CNAME record:
Create a repo on github.mit.edu to manage your site files. If you are a staff, faculty member or student and haven't already signed up, just go to github.mit.edu to get started. See this page for more details.
Pick a location to store your site files in AFS, either:
- Request an organizational locker
- Use a subdirectory of your own homedir or other existing locker, e.g. /mit/charlie/delta. Note that this means the URL for your site will be: web.mit.edu/charlie/delta/
Clone your repo into your EMPTY locker or subdirectory via HTTPS:
|The trailing period (".") is critical. Without it, git will make a new directory to store these files.
As of v. 2.35.3, Git will complain if you are not the owner of the working directory.
This a security measure intended to prevent compromises of your code, but if you are planning to have multiple contributors working in this AFS locker, you will need to add an exception.
You can do so by running the following in the root directory of your local repo:
Set the permissions in AFS
If you have an organizational locker, the path would look something like: /mit/alpha, or explicitly /afs/athena.mit.edu/org/a/alpha
Wait 15 minutes, and check your site, e.g.: web.mit.edu/alpha
|To set permissions for this directory and all subdirectories, use fsr instead of fs. You will need to have access to /mit/consult do so, either by running add consult or by manually appending it to your PATH variable.
For a more detailed look at how this works, see: How do permissions work in AFS?
For details on a more sophisticated permissions configuration, e.g. restricting access by certificate, see: Web Publishing - Access privileges on web.mit.edu
Ideally this repo would be cloned on a personal machine(s) to make changes, which would then be tested, commited and then pushed back into github.mit.edu.
Once they are ready for public consumption, they can be pulled down into AFS.
- Navigate to the directory in AFS
- Pull the latest data from github.mit.edu, in this case from the master branch:
- Clear your cache and refresh your browser, and you should now see the latest copy of the page(s).