All AOS users have available to them the ability to publish webpages. In order to do so, please perform the following:
chmod 755 ~/public_html
~/public_htmldirectory. Here is a quick template you can use:
<html> <head> <title>Sample AOS Webpage</title> </head> <body> This is my very own sample AOS webpage. </body> </html>
~/public_htmldirectory is a good way to share things with others instead of by sending large email attachments.
~/public_htmldirectory is silly. Don't do it!
~/public_htmland put files there. When you visit http://www.meteo.mcgill.ca/~AOS_USERNAME/directory you will receive an index of that directory.
Often we wish to restrict access to a certain directory and only give access to it to users under our control. Following these steps will create a directory
~/public_html/secure which is a restricted directory under our personal webspace:
~/public_html/secureand set permissions:
mkdir ~/public_html/secure chmod 755 ~/public_html/secure
~/public_html/secure/.htaccesswith the following contents:
AuthType Basic AuthName "Restricted Access" AuthUserFile "/aos/home/AOS_USERNAME/.htpasswd" # Note: Use full path! require valid-user
This file instructs the webserver that we want the
~/public_html/secure directory to be password protected with basic authentication against the file
~/.htpasswd and any user in this file can access the page.
htpasswd -c ~/.htpasswd userName New password: Re-type new password: Adding password for user userName
This command creates the file ~/.htpasswd and adds an entry for the user
userName. If we take a look at the file:
cat ~/.htpasswd userName:1rp3zJGxrJ0hM
we see that the password is encrypted.
~/public_html/secureby either copying data there or creating a webpage.