Skip to content

CSV2RDF4LOD_PUBLISH_VARWWW_ROOT

timrdf edited this page Feb 15, 2013 · 30 revisions

What is first

What we will cover

The htdocs directory has restricted unix permissions, and it is bad practice to use root to write to that directory. This page describes which scripts use the CSV2RDF4LOD_PUBLISH_VARWWW_ROOT variable, and how to set up a user for the project so that it can write to CSV2RDF4LOD_PUBLISH_VARWWW_ROOT.

Let's get to it!

CSV2RDF4LOD_PUBLISH_VARWWW_ROOT is used to specify the path to the htdocs directory -- linking files within this directory will make them available on the web for download. The VoID metadata (created by the converter) references data dump URLs that need to exist within $CSV2RDF4LOD_PUBLISH_VARWWW_ROOT. The automation correctly places these files if CSV2RDF4LOD_PUBLISH_VARWWW_DUMP_FILES is true.

Scripts that use CSV2RDF4LOD_PUBLISH_VARWWW_ROOT

  • bin/aggregate-source-rdf.sh uses it to determine which directory to link dump files to.
    • It avoids sudo (here) if the directory's stat --format=%U is the same as whoami.
  • bin/cr-ln-to-www-root.sh
    • avoids sudo (here) if the directory's stat --format=%U is the same as whoami.
  • bin/util/cr-full-dump.sh
    • avoids sudo (here) if the directory's stat --format=%U is the same as whoami.
  • bin/convert-aggregate.sh This was the original script, but is deprecated in favor of the three above. This one is specific to aggregating RDF conversions of tabular data, while the newer scripts handle arbitrary RDF files.
    • It avoids sudo (here) if the directory's stat --format=%U is the same as whoami.

Getting the unix permissions correct

(We use an example to set up the user to serve from http://healthdata.tw.rpi.edu, healthdata.)

First, create the user healthdata, adding it to the group tw and also the groups healthdata and wheel (admin could replace the use of wheel):

sudo su
/usr/sbin/useradd healthdata
/usr/sbin/usermod -gtw -Ghealthdata,wheel healthdata

Then, change the ownership of CSV2RDF4LOD_PUBLISH_VARWWW_ROOT and CSV2RDF4LOD_CONVERT_DATA_ROOT:

sudo chown -R healthdata:tw /var/www
sudo chown -R healthdata:tw /srv/twc-healthdata/data/source

The account should not be accessible via ssh or su; the only way into the user is by using sudo su - healthdata. The user's shell can be set by editing /etc/passwd.

What is next

Clone this wiki locally