3

I installed Jena and Fuseki as a service using a ansible role gremid.fuseki.

And I'd like to custom listen host and listen port.However, I have no idea.

Maybe I should edit $FUSEKI_BASE/config.ttl, its defaut content is

[] rdf:type fuseki:Server ;
# Server-wide context parameters can be given here.
# For example, to set query timeouts: on a server-wide basis:
# Format 1: "1000" -- 1 second timeout
# Format 2: "10000,60000" -- 10s timeout to first result, then 60s timeout to for rest of query.
# See java doc for ARQ.queryTimeout
# ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000" ] ;

# Load custom code (rarely needed)
# ja:loadClass "your.code.Class" ;
.
scil
  • 169
  • 10
  • 2
    The port is set when the server is started with "--port" or in the WAR file form, it comes from the webapp container server. – AndyS Sep 05 '18 at 16:48
  • Thank you. But I'd like to know is there any easy way to set 'port' when fuseki is a service, not a standlone server. – scil Sep 06 '18 at 08:50
  • How are you running it as a service? – AndyS Sep 06 '18 at 12:07
  • official doc [Fuseki as a Service](https://jena.apache.org/documentation/fuseki2/fuseki-run.html#fuseki-service). And I use ansible role [ansible-role-fuseki ](https://github.com/paginagmbh/ansible-role-fuseki/) – scil Sep 06 '18 at 13:52
  • 1
    The "fuseki" service script uses the environment variable `FUSEKI_ARGS` to pass the command line arguments to the Fuseki server. One way is to use `/etc/default/fuseki`. The script has comments at the top. – AndyS Sep 06 '18 at 16:47
  • Thank you! I added "FUSEKI_ARGS=--port=3031" to /etc/default/fuseki, and it worked! – scil Sep 07 '18 at 00:24
  • I've turned it into an answer to make it easier for people to find again later. Please accept it. (The port setting can't go in the TTL configuration because that gets read after the port is assigned by the webapp container. This packing of Fuseki is a webapp run by Jetty.) – AndyS Sep 07 '18 at 08:38

1 Answers1

3

When Fuseki is run as a service, using the fuseki script in the distribution, the command line arguments are given by environment variable FUSEKI_ARGS.

The service script reads the file /etc/default/fuseki to set the environment in which to execute and this can contain environment variable settings which as FUSEKI_ARGS.

There are a number of environment variables that can be set and these are dscribed it the script.

Currently:

# Configuration
# -------------
# Values are loaded from /etc/default/fuseki, if it exists.
# The description below cover the default settings if /etc/default/fuseki
# does not exist.
#
# Set DEBUG=1 (see below or set the environment variable) to print the
# settings to be used.
#
# JAVA
#   Command to invoke Java. If not set, java (from the PATH) will be used.
#   JAVA_HOME can also be used to set JAVA.
#
# JAVA_OPTIONS
#   Extra options to pass to the JVM.
#
# FUSEKI_HOME
#   Where Fuseki is installed.  If not set, the script will try
#   to guess it based on the script invokation path.
# 
# FUSEKI_BASE
#   The root of the runtime area - logs files, system files, local configuration.
#   Defaults to $FUSEKI_HOME/run.
#
# FUSEKI_RUN
#   Where the fuseki.pid file should be stored.  It defaults
#   first available of /var/run, /usr/var/run, $FUSEKI_HOME and /tmp if not set.
#
# FUSEKI_PID
#   The FUSEKI PID file, defaults to $FUSEKI_RUN/fuseki.pid
#
# FUSEKI_ARGS
#   The arguments to pass to the Fuseki server on the command line. Defaults to:
#                                        # if FUSEKI_CONF is not set
#    --config=$FUSEKI_CONF               # if FUSEKI_CONF is set
#
# FUSEKI_START
#   Path to the jar file. Defaults to $FUSEKI_HOME/fuseki-server.jar 
#
# FUSEKI_CLASSES
#   Path to extra jars to add to the class path.  Defaults to none
#   Should be of the form path/class.jar:path/class2.jar
#
# FUSEKI_CONF
#   The Fuseki configuration file, usually in RDF Turtle notation.
#
# FUSEKI_USER
#   If set, the server will be run as this user
#
# FUSEKI_LOGS
#   Directory where logs will be generated. 
#   Fixed as $FUSEKI_BASE/logs.
#
# FUSEKI_LOGS_STDERROUT
#   Log file with stderr and stdout log output from Fuseki. 
#   Defaults to $FUSEKI_LOGS/stderrout.log
AndyS
  • 16,345
  • 17
  • 21