If you have research data on the HPC cluster that you want to share on the Internet, or if you want to create your very own HPC web page with details of your research work, the following explains how to achieve this.
User Web Directory
All HPC users have a public www area available at ( where $USER is your HPC account name ):
A file, let’s say, "test.txt" — under your account name in this location will become available on the HPC web site at this location (note the initial tilda ~ character):
Any file you drop into your web directory here will be visible to everyone on the Internet if they know your account name and your file’s name. There is no automatic listing of files in your directory if a web link merely specifies your account name (the browser will just display a forbidden error message), unless you specifically enable such listings; see the section below concerning .htaccess files.
As an example, if our HPC account name is "anteater", and we create a file called test.txt, we can place it in our public www folder like so:
$ cd /pub/public-www/anteater $ echo "Hello, this is my data file." > test.txt
The file "test.txt" is now accessible by everyone on the Internet through the following HPC web link (that is, if user anteater existed on the system):
Please take note of the tilda "~" in front of user name anteater in the web address above.
.htaccess: Directory Listings and Limiting Access
As a security policy, the HPC web server will not display a directory listing of the contents of your user directory unless you specifically enable that feature by creating a .htaccess text file in your web directory. The file should contain these lines:
# Allow indexed view of files in this folder and its # subdirectories, and accommodate any file name width. Options +Indexes IndexOptions NameWidth=* DescriptionWidth=*
.htaccess files can also be used to restrict access to a particular directory, so that only certain subnets and/or IP numbers can access files in that directory. To do this, create a .htaccess text file in the directory, and add lines similar to the following (make sure the "Deny from all" line precedes any "Allow from" lines):
# Only allow certain ranges of IP numbers to access # the contents of this folder. # The following statement sets the initial default. Deny from all # The following then allows access by anyone on campus subnets. Allow from 128.200., 128.195. # The following also allows access by computers at theses specific # IP numbers: Allow from 188.8.131.52, 184.108.40.206
Symbolic Links to Your Data ( ls -s )
You may also create symbolic links to your data files, instead of copying them to your public-www folder. This is the preferred method of making your data visible, specially with large files. A link simply points to where the real file exists.
The only trick here is that the entire path leading to the file needs to be world executable. For example, let’s say we have a file named "file-to-share" at this location (substitute your user ID for $USER):
Every directory in the path leading to file "file-to-share" has to be world executable (not necessarily world readable, just world executable), while the file "file-to-share" has to be world readable. Here’s how you would create the syn link and make sure the path to your actual file is world executable, while making the file world readable:
$ cd /pub/public-www/$USER $ ln -s /bio/$USER/directory1/directory2/file-to-share file-to-share $ chmod a+x /bio/$USER $ chmod a+x /bio/$USER/directory1 $ chmod a+x /bio/$USER/directory1/directory2 $ chmod a+r /bio/$USER/directory1/directory2/file-to-share
The "chmod a+x" command means all (anyone) can execute (or really, traverse) that directory. The "chmod a+r" means all (anyone) can read that file.
Please remember that everyone on the Internet will be able to access all files in your public www folder, so be careful. Also, Internet users will NOT be able to see a listing of the files in your public www folder by simply going to:
For the web address above to display a web page, you need to create an "index.html" file in your public www folder, with the proper HTML formatting. If someone tries the above without you having an index.html file, they will receive a "Forbidden" message from the HPC web server.
A sample "index.html" file is available in the demo account. To get a copy:
$ cd /data/users/public-www/$USER $ cp ~demo/sample-index.html index.html
Editing your index.html file:
To edit your index.html file to suit your preferences, use bluefish on the HPC login node (if you have an X11 connection). If you only have a console, use a text editor like joe, vim or emacs (preferably in HTML mode).
$ bluefish /data/users/public-www/$USER/index.html
Now the web address "http://hpc.oit.uci.edu/~$USER" will display your index.html file.