This page covers the personal web page service operated by CSG for DoC staff and students. The commands listed here should be run on a DoC Linux workstation or remote access server.
Note: All pages hosted on DoC or other College resources must be non-political, legal, and must not bring the Department or the College into disrepute. Your personal web page must contain a link back to the Department's home page. In short, any content you publish via our resources must abide by the Departmental and College regulations.
ENABLING YOUR PERSONAL WEB PAGES
DoC runs the Apache web server, the latest, secure version.
-
Make your home directory publicly accessible (but not readable!):
chmod a+x ~
Note: On directories, the permissions set by the chmod command are interpreted as follows:
-
r = permission to get a directory listing
-
w = permission to create and delete files in the directory
-
x = permission to access files in the directory provided the name of the files are known
-
-
If it doesn't already exist, create a directory called public_html:
mkdir -p ~/public_html
- Make this subdirectory publicly accessible:
chmod a+x ~/public_html -
Create a file called index.html within this directory and make this readable by all:
cd ~/public_html
chmod a+r index.html
This will be your main personal web page (a.k.a. your "home page"). - Then for each file you have created that you want to make available on the web:
chmod a+r filename
-
Your main personal web page, index.html, will then be visible around the world as the following URL:
https://www.doc.ic.ac.uk/~username/
The webserver automatically maps URLs of the form https://www.doc.ic.ac.uk/~username/X to the Unix path/homes/username/public_html/X.
-
Other web pages in your public_html directory area will be visible as URLs of the form:
https://www.doc.ic.ac.uk/~username/somefile.html
Feel free to create subdirectories inside public_html for each web-based project you want, set their permissions exactly the same way.
GROUP PROJECT WEB PAGES
When you do a group project organised by your Lab Organiser, a group is created with the right members, and a group project area is created, stored inside /vol/project. For example, 2014-15 first year Topics groups are stored in/vol/project/2014/163/g14163xx (where xx is the group no and 163 is the Topics course code).
By default, your entire group project directory (eg./vol/project/2014/163/g14163xx) is accessible via the web as URL:
-
https://www.doc.ic.ac.uk/project/2014/163/g14163xx/
We strongly recommend that you prevent accidental exposure of privateinformation via the web by adding a very restrictive .htaccess file to the top level directory to disallow web browsing of your entire group project directory. For instance, a member of g14163xx might do the following:
cd /vol/project/2014/363/g14163xx echo "deny from all" > .htaccess
Then you could explicitly open up a subdirectory to the web via a similar.htaccess ("allow from all") in that directory.. For instance:
mkdir web echo "allow from all" > web/.htaccess
which allows access to
-
https://www.doc.ic.ac.uk/project/2014/363/g14163xx/web/
Permissions are also important in group directories, essentially all members of the group must be able to write files and create new directories in there, and the web server must be able to read all the files. We recommend the following:
.We recommend the following simple rules for keeping permissions in your group project directory sensible:
- All members of the group should set 'umask 002' before working in the group project directory. This ensures that all new files/dirs are user-writable, group-writable and other-readable. In fact, it is best for the duration of the project if each group member adds 'umask 002' to the end of their ~/.cshrc file.
- Whenever a group member creates a new subdirectory in the group directory, you should do "chmod g+ws NEW_DIR_NAME". This will ensure that newly created files/dirs within that directory inherit the group ownership from the parent (i.e. be group-owned by the project group) rather than reverting to be group-owned by your primary group.
EDITING YOUR PERSONAL WEB PAGES UNDER WINDOWS
CSG do not advise editing web pages on Windows due to incompatibilities between line-endings on Windows and Unix. More precisely, you must not edit CGI scripts on Windows, as the line-ending incompatibility will stop the script from running completely.
If you must edit plain HTML web pages on Windows, proceed as follows:
- Once you have a public_html folder you can save files to it from DoC Lab Windows 10 systems with the correct permissions in the following way:
-
Double-click on My Computer on the Desktop or open from the Start Menu.
- Look at your H: drive, that should be labelled with the UNC eg. \\redkite\dcw. You'll need to use the server name (eg. redkite) below.
-
Right-click My Computer and select Map Network Drive, then in the Folder: box type:
\\SERVERNAME\public_html
- where SERVERNAME is replaced by the name of server, eg. redkite.
-
Tick Reconnect at logon.
-
Click Ok.
-
-
-
Note the drive letter that the folder is allocated to, and always save web pages to this location. The reason for this is that the user files saved to your home directory via the H: drive is private. Files saved directly to the public_html share are publicly readable.