Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
sudo apt-get install apache2-mpm-prefork libapache2-mod-wsgi nginx git-core python-virtualenv postfix openjdk-6-jre-headless postgresql build-dep

Configure the web server to play nice with neo4j-embedded.
/etc/apache2.conf

Code Block

<IfModule mpm_prefork_module>
    StartServers          1
    ServerLimit           1
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients            1
    MaxRequestsPerChild   0
</IfModule>

For neo4j-rest-client:

Code Block
sudo apt-get install apache2 libapache2-mod-wsgi git-core python-virtualenv postfix openjdk-6-jre-headless postgresql python-psycopg2 build-deplibpq-dev python-dev

For both neo4j versions:
Make a virtual python environment.

Code Block
cd /opt/python_environments/
sudo virtualenv --no-site-packages norduni

Install needed python modules.

Code Block
sudo su
source python_environments/norduni/bin/activate
pip install django ipaddr argparse pexpect markdown psycopg2 lucene-querybuilder gunicorn

Add the following python modules if you are running the Neo4j stand alone server:

...

Install nginx for serving static files.
Configure Apache to listen to localhost only and set up proxy through nginx.

Set up a GIT repository for the JSON files produced by the NERDS producers and make a clone in /var/opt/. We have a GIT repository called nistore
and we have made a clone found at /var/opt/nistore/.

Produce JSON files with the producers you want.

Consume the recently produces JSON files with the NORDUni consume scripts.

Install Neo4j graph database

Neo4j 1.5 embedded with Python bindings (recommended)

Install JPype and Neo4j-embedded.

Code Block

apt-get install python-jpype
pip install neo4j-embedded

Set JAVA_HOME for JPype to work correctly.

Code Block

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/jre

Neo4j 1.3 REST stand alone server

Download neo4j-1.3 from http://neo4j.orgImage Added.
Extract the file to, for example, /var/opt/norduni/dependencies/.

Code Block

cd /var/opt/norduni/dependencies/
tar xfz neo4j-1.3.tar.gz

Copy the startup script from /var/opt/norduni/scr/scripts/neo4j/ to /etc/init.d/ and then make neo4j start on boot.

Code Block

update-rc.d /et/init.d/neo4j defaults

You need to shut down port 7474 from anything except localhost.

Code Block

iptables -A INPUT -p tcp --dport 7474 -s localhost -j ACCEPT
iptables -A INPUT -p tcp --dport 7474 -j DROP

Save the rules and add the following line to your interface configuration so you will restore the rules on a reboot.

Code Block

bash -c "iptables-save > /etc/iptables.rules"

vi /etc/network/interfaces

iface eth0 inet static
    pre-up iptables-restore < /etc/iptables.rules

Old Apache stuff

Configure the web server to play nice with neo4j-embedded. Install apache2-mpm-prefork libapache2-mod-wsgi.
/etc/apache2.conf

Code Block

<IfModule mpm_prefork_module>
    StartServers          1
    ServerLimit           1
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients            1
    MaxRequestsPerChild   0
</IfModule>

Add the following lines to /etc/apache2/sites-available/default-ssl

Code Block
        <LocationMatch "Shibboleth.sso">
           SetHandler None
        </LocationMatch>

        <Location "/accounts/login-federated/">
           AuthType shibboleth
           ShibRequireSession On
           require valid-user
           RequestHeader set X_REMOTE_USER %{eppn}e
           RequestHeader set EPPN %{eppn}e
           RequestHeader set GIVENNAME %{givenName}e
           RequestHeader set SN %{sn}e
           RequestHeader set MAIL %{mail}e
           RequestHeader set AFFILIATION %{affiliation}e   
           RequestHeader set ENTITLEMENT %{entitlement}e
        </Location>

        Alias /admin_media /var/opt/norduni/scr/niweb/static/admin/
        Alias /site_media /var/opt/norduni/scr/niweb/static/
        <LocationMatch "^/(admin_media|site_media)">
           Options FollowSymLinks
           Order allow,deny
           allow from all
           SetHandler None
        </LocationMatch>

Set up a GIT repository for the JSON files produced by the NERDS producers and make a clone in /var/opt/. We have a GIT repository called nistore
and we have made a clone found at /var/opt/nistore/.

Produce JSON files with the producers you want.

Consume the recently produces JSON files with the NORDUni consume scripts.

Install Neo4j graph database

Neo4j 1.5 embedded with Python bindings (recommended)

Install JPype and Neo4j-embedded.

Code Block

apt-get install python-jpype
pip install neo4j-embedded

Set JAVA_HOME for JPype to work correctly.

Code Block

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/jre

Neo4j 1.3 REST stand alone server

Download neo4j-1.3 from http://neo4j.orgImage Removed.
Extract the file to, for example, /var/opt/norduni/dependencies/.

Code Block

cd /var/opt/norduni/dependencies/
tar xfz neo4j-1.3.tar.gz

Copy the startup script from /var/opt/norduni/scr/scripts/neo4j/ to /etc/init.d/ and then make neo4j start on boot.

Code Block

update-rc.d /et/init.d/neo4j defaults

You need to shut down port 7474 from anything except localhost.

Code Block

iptables -A INPUT -p tcp --dport 7474 -s localhost -j ACCEPT
iptables -A INPUT -p tcp --dport 7474 -j DROP

Save the rules and add the following line to your interface configuration so you will restore the rules on a reboot.

Code Block

bash -c "iptables-save > /etc/iptables.rules"

vi /etc/network/interfaces

iface eth0 inet static
    pre-up iptables-restore < /etc/iptables.rules