Skip to content

Commit

Permalink
Move Fuseki install from stand alone server to deployable war.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruebot authored and Andrew Woods committed Aug 27, 2015
1 parent 3d715e1 commit 51f04d0
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 25 deletions.
9 changes: 5 additions & 4 deletions README.md
Expand Up @@ -23,14 +23,15 @@ You can shell into the machine with `vagrant ssh` or `ssh -p 2222 vagrant@localh
* No authentication configured
* [Solr 4.10.3](http://lucene.apache.org/solr/) at [http://localhost:8080/solr](http://localhost:8080/solr), for indexing & searching your content.
* Installed in "/var/lib/tomcat7/solr"
* [Fuseki 1.1.2](http://jena.apache.org/documentation/serving_data/index.html) at [http://localhost:3030](http://localhost:3030), for querying and updating.
* Installed in "/usr/share/fuseki"
* [Fuseki 2.3.0](http://jena.apache.org/documentation/fuseki2/) at [http://localhost:8080/fuseki](http://localhost:8080/fuseki), for querying and updating.
* Installed in "/etc/fuseki"
* Dataset Path name "/test"
* Persistent storage "/usr/share/fuseki/temp\_data"
* Persistent storage "/etc/fuseki/databases/test\_data"
* [Fcrepo-camel-toolbox 4.1.1](https://github.com/fcrepo4-labs/fcrepo-camel-toolbox)
* Installed in Tomcat container

###Usage

* Install Vagrant and VirtualBox
* Clone this repository
* `cd fcrepo4-vagrant`
Expand Down Expand Up @@ -61,4 +62,4 @@ and un-comment the **config.vm.box\_url** line, save the file and retry.

## Thanks

This VM setup was heavily influenced (read: stolen) from [Islandora 2.x VM](https://github.com/Islandora-Labs/islandora/tree/7.x-2.x/install)
This VM setup was heavily influenced (read: stolen) from [Islandora 2.x VM](https://github.com/Islandora-Labs/islandora/tree/7.x-2.x/install).
1 change: 0 additions & 1 deletion Vagrantfile
Expand Up @@ -13,7 +13,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"

config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat
config.vm.network :forwarded_port, guest: 3030, host: 3030 # Fuseki

config.vm.provider "virtualbox" do |v|
v.memory = 2048
Expand Down
37 changes: 37 additions & 0 deletions config/shiro.ini
@@ -0,0 +1,37 @@
# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0

[main]
# Development
ssl.enabled = false

plainMatcher=org.apache.shiro.authc.credential.SimpleCredentialsMatcher
#iniRealm=org.apache.shiro.realm.text.IniRealm
iniRealm.credentialsMatcher = $plainMatcher

localhostFilter=org.apache.jena.fuseki.authz.LocalhostFilter

[users]
# Implicitly adds "iniRealm = org.apache.shiro.realm.text.IniRealm"
admin=pw

[roles]

[urls]
## Control functions open to anyone
/$/status = anon
/$/ping = anon

## and the rest are restricted to localhost.
#/$/** = localhostFilter

## If you want simple, basic authentication user/password
## on the operations,
## 1 - set a better password in [users] above.
## 2 - comment out the "#/$/** = localhost" line and use:
## "/$/** = authcBasic,user[admin]"

## or to allow any access.
/$/** = anon

# Everything else
/**=anon
21 changes: 21 additions & 0 deletions config/test.ttl
@@ -0,0 +1,21 @@
@prefix : <http://base/#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .

:service_tdb_all a fuseki:Service ;
rdfs:label "test" ;
fuseki:dataset :tdb_dataset_readwrite ;
fuseki:name "test" ;
fuseki:serviceQuery "query" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore
"data" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" .

:tdb_dataset_readwrite
a tdb:DatasetTDB ;
tdb:location "/etc/fuseki/databases/test_data" .
5 changes: 3 additions & 2 deletions install_scripts/config
Expand Up @@ -20,8 +20,9 @@ FEDORA_AUDIT=true
FEDORA_AUDIT_LOCATION=/audit


FUSEKI_VERSION=1.3.0
FUSEKI_HOME=/usr/share/fuseki
FUSEKI_VERSION=2.3.0
FUSEKI_BASE=/etc/fuseki
FUSEKI_DEPLOY=/var/lib/tomcat7/webapps

SOLR_VERSION=4.10.3
SOLR_HOME=/var/lib/tomcat7/solr
34 changes: 16 additions & 18 deletions install_scripts/fuseki.sh
Expand Up @@ -6,28 +6,26 @@ if [ -f "$SHARED_DIR/install_scripts/config" ]; then
. $SHARED_DIR/install_scripts/config
fi

if [ ! -d $FUSEKI_HOME ]; then
mkdir $FUSEKI_HOME
if [ ! -d $FUSEKI_BASE ]; then
mkdir $FUSEKI_BASE
chown -hR tomcat7:tomcat7 $FUSEKI_BASE
fi

if [ ! -f "$DOWNLOAD_DIR/jena-fuseki1-$FUSEKI_VERSION-distribution.tar.gz" ]; then
if [ ! -f "$DOWNLOAD_DIR/apache-jena-fuseki-$FUSEKI_VERSION-distribution.tar.gz" ]; then
echo -n "Downloading Fuseki..."
wget -q -O "$DOWNLOAD_DIR/jena-fuseki1-$FUSEKI_VERSION-distribution.tar.gz" "http://www.apache.org/dist/jena/binaries/jena-fuseki1-"$FUSEKI_VERSION"-distribution.tar.gz"
wget -q -O "$DOWNLOAD_DIR/apache-jena-fuseki-$FUSEKI_VERSION-distribution.tar.gz" "http://www.us.apache.org/dist/jena/binaries/apache-jena-fuseki-$FUSEKI_VERSION.tar.gz"
echo " done"
fi

cd /tmp
cp "$DOWNLOAD_DIR/jena-fuseki1-$FUSEKI_VERSION-distribution.tar.gz" /tmp
tar -xzvf jena-fuseki1-"$FUSEKI_VERSION"-distribution.tar.gz
cd jena-fuseki1-"$FUSEKI_VERSION"
mv -v * $FUSEKI_HOME
chown -hR tomcat7:tomcat7 $FUSEKI_HOME

mkdir "$FUSEKI_HOME/test_data"
ln -s $FUSEKI_HOME/fuseki /etc/init.d
echo "FUSEKI_HOME=\"$FUSEKI_HOME\"" > /etc/default/fuseki
echo "FUSEKI_ARGS=\"--update --loc=$FUSEKI_HOME/test_data /test\"" >> /etc/default/fuseki
update-rc.d fuseki start 20 2 3 4 5 . stop 20 0 1 6 .

/etc/init.d/fuseki start

cp "$DOWNLOAD_DIR/apache-jena-fuseki-$FUSEKI_VERSION-distribution.tar.gz" /tmp
tar -xzvf apache-jena-fuseki-"$FUSEKI_VERSION"-distribution.tar.gz
cd apache-jena-fuseki-"$FUSEKI_VERSION"
mv -v fuseki.war $FUSEKI_DEPLOY
chown -hR tomcat7:tomcat7 $FUSEKI_DEPLOY/fuseki.war
service tomcat7 restart
# Need to sleep for a bit while Fuseki deploys for the first time.
sleep 20
cp $SHARED_DIR/config/shiro.ini $FUSEKI_BASE
cp $SHARED_DIR/config/test.ttl $FUSEKI_BASE/configuration
service tomcat7 restart

0 comments on commit 51f04d0

Please sign in to comment.