Friday, November 20, 2009

Linking two Virtuoso instances to one Apache server

Virtuoso comes with its own web front end, but I did not want to make that public. Additionally, I actually have two instances running, one for the GNU FDL licensed NMRShiftDB data, and one for the CC0 ChemPedia and Solubility data sets.

So, I used Apache's proxy module linking to two Virtuoso instances. These two are set up by just duplicating a data based folder and to have it use two virtuoso.ini config files. Modify one of two config files to have them run on a different port in the Parameters section, for example 1198 and 1199:
ServerPort                      = 1199
And assign a different server ports in the HTTPServer section, such as 2290 and 2291:
ServerPort                      = 2291
Then modify the /etc/apache2/mods-enabled/proxy.conf (or whatever equivalent on your system) to have two sections creating two URL rewrites proxying the request to the virtuoso server:
<Proxy /nmrshiftdb/sparql>
  RewriteEngine On
  Allow from all
  ProxyPass        http://localhost:2290/sparql
  ProxyPassReverse http://localhost:2290/sparql

<Proxy /cc0/sparql>
  RewriteEngine On
  Allow from all
  ProxyPass        http://localhost:2291/sparql
  ProxyPassReverse http://localhost:2291/sparql

No comments:

Post a Comment