Web Access to account data

Introduction:

Periodically, people would like to share data that they have processed on the Katahdin HPC system. Each account has the ability to have data become visible via HTTP/HTTPS, ie., the Web. 

Making data available to the Web

TLDR:

If you just want the bare commands:


mkdir ~/WWW

ln -s ~/my_data_dir ~/WWW/my_data_dir

chmod o+x ~

echo "Options +Indexes" > ~/WWW/my_data_dir/.htaccess

The URL to get to the directory is:

http://katahdin.acg.maine.edu/~my_account/my_data_dir

where "my_account" refers to your account name and "my_data_dir" refers to the directory of data that you want to make available.

The Longer Version: 

In order to describe how to do this, we will use a sample account named "abol". The HOME directory for this account is:

/home/abol

The abol account has data in a directory called /home/abol/data that we want to share over the web. 

The first thing that is needed is to create a directory called WWW in the home directory:

/home/abol/WWW

One way to do this is to open a terminal ssh to Katahdin and run the commands:

mkdir ~/WWW

The ~ character refers to the HOME directory of the account. Here is what things look like so far:


Last login: Fri Aug 12 19:41:33 EDT 2022 on pts/37

[abol@katahdin ~]$ ls -al

total 2

drwxr-x--- 1 abol abol   6 Aug 12 19:28 .

drwxr-xr-x 1 root root 208 Aug 12 19:27 ..

-rw------- 1 abol abol 113 May 16 16:32 .bash_history

-rw-r--r-- 1 abol abol  18 Oct 16  2014 .bash_logout

-rw-r--r-- 1 abol abol 176 Oct 16  2014 .bash_profile

-rw-r--r-- 1 abol abol 269 Mar 23  2016 .bashrc

drwxrwxr-x 1 abol abol   1 Aug 12 19:48 data

drwxr-xr-x 1 abol abol   4 Aug  1  2012 pi_MPI

drwxr-xr-x 1 abol abol   1 Jul 30  2012 .vnc


[abol@katahdin ~]$ mkdir WWW


[abol@katahdin ~]$ ls -al

total 2

drwxr-x--- 1 abol abol   7 Aug 12 19:44 .

drwxr-xr-x 1 root root 208 Aug 12 19:27 ..

-rw------- 1 abol abol 113 May 16 16:32 .bash_history

-rw-r--r-- 1 abol abol  18 Oct 16  2014 .bash_logout

-rw-r--r-- 1 abol abol 176 Oct 16  2014 .bash_profile

-rw-r--r-- 1 abol abol 269 Mar 23  2016 .bashrc

drwxrwxr-x 1 abol abol   1 Aug 12 19:48 data

drwxr-xr-x 1 abol abol   4 Aug  1  2012 pi_MPI

drwxr-xr-x 1 abol abol   1 Jul 30  2012 .vnc

drwxrwxr-x 1 abol abol   0 Aug 12 19:49 WWW

As can be seen here, the WWW directory has been created. This is the Web Root directory for this account. Before it can be used though, a couple of things need to be done:

chmod o+x ~

ln -s ~/data ~/WWW/data

This says to create a link called /home/abol/WWW/data that points to /home/abol/data (remember that ~ refers to /home/abol for this user).

http://katahdin.acg.maine.edu/~abol/data/data.txt

And you should see in your web browser:


This is a sample DATA file.

However, if you try to just go to: http://katahdin.acg.maine.edu/~abol/data you will get an error like:

Forbidden

You don't have permission to access /~abol/data/ on this server.

This is because of the web server default permissions. To override these permissions a file called .htaccess needs to be put in the directory with a directive to override the defaults. You can do this with the command:

echo "Options +Indexes" > ~/WWW/data/.htaccess

This should now make it so the URL: http://katahdin.acg.maine.edu/~abol/data will show you:

This should be enough to get you going with sharing your data via the Web. If you have any problems, please let us know.