This document describes how to set up a ParaViewWeb server instance on a freshly installed Ubuntu Desktop 14.04 LTS.
The server version can also be used, but to properly leverage the GPU, you will need to install and run X or build ParaView with OSMesa.
This document is split in 4 sections:
- Configuring the Linux distribution so all the needed component are available
- Installing ParaViewWeb
- Configuring the ParaViewWeb launcher
- Configuring Apache to serve the standard ParaViewWeb example application and documentation
- Structuring the Web Site content with the ParaViewWeb sample application
Once you’ve properly installed your new Unbuntu Desktop you may want to add all the missing libraries and dependencies.
$ sudo apt-get update
If you are using Ubuntu Server, you should also install kde to make sure you have a graphics environment:
$ sudo apt-get install kde-full
In order to properly install the NVidia drivers, you will need to execute the following command line and restart:
$ sudo nvidia-xconfig
Unless you have your own launcher application that will take care of who is running
the visualization process based on your SSO system, you may want to simply use
the process launcher that comes with ParaView. And if you do so, you might not want that
process to run under your ‘powerful’ user.
# Create a new user
Then you should make sure that this user will auto login in the graphical environment.
This will allow ParaViewWeb to properly use your GPU.
The path provided below are just an example on how to structure the different pieces that will
be needed for your web server. But by defining them here it is easier to reference them later on.
In the proposed structure, everything will be nested underneath the /data directory.
So let’s create those directories.
$ sudo mkdir -p /data/pvw /data/pv /data/logs /data/www
- /data/www will contains the html/js/css files that compose your web site that will leverage ParaViewWeb.
- /data/pv will contains the ParaView installation binaries.
- /data/pvw will contains the ParaView process launcher that will dynamically trigger a new process for each visualization session.
- /data/logs will contains the Apache logs that will serve your ParaViewWeb virtual host.
ParaView which contains ParaViewWeb is available for download here.
And you can even take the latest version that was build on the master branch of ParaView which is supposed to be stable.
If you want to build ParaView yourself, you can refer to the Wiki here.
In any case, you should have a directory structure that looks like that:
-> paraview-xxx + bin - pvpython - pvserver - ... + lib + paraview-5.2 - libvtkXXXX.so + python2.7 + site-packages + paraview + vtk + ... + share + paraview-5.2 + web + visualizer + www - index.html - ... + server - pvw-visualizer.py + lightviz + www + server
Let’s copy it in our global directory structure and assign it to our ParaViewWeb user:
$ sudo cp -r /.../paraview-xxx /data/pv/pv-5.2.0
We’ve already created the /data/pvw directory to embed the ParaView Process Launcher with its configuration.
Let’s structure the content of that directory.
$ sudo mkdir -p /data/pvw/bin /data/pvw/conf /data/pvw/data /data/pvw/logs
When you edit the configuration file, shown below, be sure to replace
YOUR_HOST_NAME_TO_REPLACE with your actual hostname.
$ sudo vi /data/pvw/conf/launcher.json
Add ParaView Data as sample data to visualize
$ wget http://paraview.org/files/v4.0/ParaViewData-v4.0.1.tar.gz
Change the security rights to the directory content
$ sudo chown -R pvw-user /data/pvw
Then, you need the user pvw-user to execute /data/pvw/bin/start.sh when it is properly logged in with its display setup…
Apache will act as our front-end webserver. This means that both the HTML content and the WebSocket forwarding will be handled by Apache.
First of all, you will need to enable the modules that will be used by our ParaViewWeb virtual host.
$ sudo a2enmod vhost_alias
Then lets create our virtual host. Be sure to replace
YOUR_HOST_NAME_TO_REPLACE, shown in the example below, with your actual host name. Also include a real email address in place of `YOUR_EMAIL@COMPANY.COM`.
$ vi /etc/apache2/sites-available/001-pvw.conf
Then enable that virtual host and restart Apache
$ sudo a2ensite 001-pvw.conf
If you run into problems with your new virtual host listening properly, you may need to disable the default virtual hosts file as follows:
$ sudo a2dissite 000-default.conf
You just need to copy the various web applications to our served directory.
$ cd /data/pv/pv-5.2/share/paraview-5.2/web
$ cd /data/pv/pv-5.2/share/paraview-5.2/web
You may need to ensure proper rights for the /data/www directory
$ sudo chown -R www-data:www-data /data/www
For notes on getting the graphics environment set up properly on instances running Ubuntu 14.04 LTS, the EC2 Graphics Setup guide.