Your content here
Any markdown file that starts with the word "solution" will be automatically gated behind a username and password. The current username and password is TA and landaupole10e28. See the next section about how to change this.
Password protection works through Apache. PCS should be able to help you with this if the description here is confusing.
There are two relvant files -- one .htaccess
in each course directory, and the other htpasswd
in the top directory. These are 'hidden files' and start with a '.', so you may need to turn on viewing hidden files in your folder preferences to see them.
The first important file is .htaccess
. It tells Apache which files need a password to access them. this is what is inside:
<FilesMatch "solution.+\.md">
AuthUserFile /home/www/ILG/.htpasswd
AuthType Basic
AuthBasicProvider file
AuthName "Physics ??? Directory"
Require valid-user
</FilesMatch>
FilesMatch
is telling Apache to match any files that start with "solution" and end with ".md" using something called Regex, or regular expresisons, where the symbol ".+" means anything. You shouldn't need to learn anything about this unless you are making big changes.AuthUserFile
tells Apache where the .htpasswd
file is on the PCS server.AuthType Basic
means that we are using basic password authenticationAuthName Physics ??? Directory
is just the title that shows up on the username/password promptRequire valid-user
is the final instruction that tells Apache that access to this file require a valid user/pw combo from .htpasswd
The second file, htpasswd
has he following contents:
TA:$apr1$N6pyWGkE$oNNppM3UzBKebTli.9XIQ/
Each line represents a username and the password which has been hashed for security. The syntax is USERNAME:HASHEDPASSWORD
If you wanted to add users and/or change passwords, you can do so by generating the line of text via the MD5 protocol using a web htpasswd generator. If you enter "TA" and "landaupole10e28" with the method set to MD5, you will see that you get the above line.