Web site hosting at ISG D-PHYS

A web share works like a regular group share but the data is hosted directly on the web server (for performance reasons) and is meant to make the files of your website easily accessible. It is not suitable for storing large amounts of data (more than a few GB) like on regular group shares.

Requesting a new web site

To request a new website, please contact us and provide the following information:

  • desired web share name: www<name>
  • desired domain name: <name>.phys.ethz.ch / <name>.ethz.ch
  • web share members (administrators): a list of D-PHYS usernames
  • web share owner (may edit members): a list of D-PHYS usernames
  • website access restrictions: public or a list of D-PHYS groups
  • website specifics:
  • CMS installation: Wordpress, Drupal, TWiki, Mediawiki, etc.
  • SQL database
  • dynamic content: provide CGI file extensions (.php, .pl, .py, .cgi, etc)
  • Python 3 WSGI web app: provide required modules

To check if your desired domain name is still available, you can use any managed Linux workstation:

host <name>.phys.ethz.ch

Access the files and directory structure

A web share can be accessed like a regular group share and is prefixed with www. See also How to access your files.

cd /home/wwwshare

It has the following directory structure:

wwwshare
├── public
├── private
├── logs
│   ├── archive
│   ├── goaccess
│   ├── http_access.log
│   ├── http_error.log
│   ├── https_access.log
│   ├── https_error.log
├── stats
│   ├── archive
│   └── current
├── fcgid
│   └── fcgid-wrapper-generic
└── tmp

This structure is managed my ISG. Users do not have write permission in the main web share home directory, but in the sub-directories public, private and tmp.

The sub-directories contain the following types of files:

  • public: files that should be visible on the web (previously htdocs)
  • private: files that should not be visible, like PHP DB config files etc [1]
  • logs: the log files of your web site
  • stats: the website statistics files
  • fcgid: only present if you use CGI (Python, PHP, etc)
  • tmp: for temporary files, unpacking zips etc; may be regularly deleted

[1] note that .htpasswd files do not work in private/, but are protected differently

Access website statistics

All websites contain a statistics URL (/website-statistics), that are updated on a daily basis. The stats are generated using goaccess and may only be accessed by web share administrators (all members of the respective wwwshare group).

The stats may be accessed as follows:

The sub-directory current holds the daily website statistics, archive holds old archived statistics.

Access log files

The log files can be used for debugging purposes, example usage on linux:

ssh <username>@login.phys.ethz.ch
tail -f /home/wwwshare/logs/*.log | ccze

We provide separate log files for HTTP and HTTPS requests. Users should normally only care about the https_* log files, as all website requests are automatically redirected to HTTPS.

The sub-directory archive may contain old archived log files from recent migrations, goaccess holds temporary data for website statistics generation.

Access the database

Some websites are connected to an SQL database, which can be accessed via web-interface.

Dynamic content using CGI

We allow to use dynamic content using CGI, which is enabled on demand only (please contact us). It allows to use various scripting languages like PHP or Perl.

It is implemented using libapache2-mod-fcgid and mod_suexec via an ISG managed FCGID wrapper script. This means that code is executed as the wwwshare user and only files within the web share may be accessed from CGI scripts.

Python 3 web applications

We allow to host Python 3 web applications using WSGI, which is enabled on demand only (please contact us).

  • The WSGI app lives at: /home/wwwshare/public
  • The WSGI entry point is usually at: /home/wwwshare/public/wwwshare.wsgi

If you make changes to the source code, you have to tell the webserver to restart the WSGI app by modifying the file time stamp on the WSGI entry point:

touch /home/wwwshare/public/wwwshare.wsgi

Our WSGI uses a virtualenv at .venv/, which contains any custom python modules. Some python modules may be installed system wide if they are used on multiple websites (like for example Django).