Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Install them in that order. You can find them from /usr/ports.

lang/perl5.14
lang/python27
www/apache22
databases/postgresql91-server \
[ databases/postgresql91-contrib <\- optional, but may become handy \ ]
java/openjdk6
www/tomcat7
devel/apache-ant
www/mod_jk
devel/maven3
shells/bash

Panel

Wiki Markup

3 Configuration rollercoaster

...

Some lines are omitted from output. Also configure "apache22/extra/httpd-mpm.conf" and "httpd-default.conf" to suit You. Also don't forget apache certificates.

unmigrated-wiki-markup
Panel

*tcsh# egrep \ -v "#\|"^$ /usr/local/etc/apache22/httpd.conf*
/*/
LoadModule rewrite_module libexec/apache22/mod_rewrite.so
LoadModule jk_module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; libexec/apache22/mod_jk.so /*/ ErrorLog _module          libexec/apache22/mod_jk.so
/*/
ErrorLog "/var/log/apache2/httpd-error.log"
/*/ &nbsp;&nbsp;&nbsp; CustomLog "\
    CustomLog "|/usr/local/sbin/rotatelogs \ -l /var/log/apache2/httpd-access_%Y-%m-%d.log 86400" combined
/*/
Include etc/apache22/extra/httpd-mpm.conf
Include etc/apache22/extra/httpd-default.conf
Include etc/apache22/extra/httpd-ssl.conf
/*/
Include etc/apache22/Includes/*.conf
NameVirtualHost \ *:80
<IfModule jk_module> &nbsp;&nbsp; &nbsp;# relative path to
    # relative path to /usr/local &nbsp;&nbsp; &nbsp;JkWorkersFile
    JkWorkersFile etc/apache22/workers.properties &nbsp;&nbsp; &nbsp;JkShmFile&nbsp;
    JkShmFile  /var/run/jk-runtime-status &nbsp;&nbsp; &nbsp;JkLogLevel error &nbsp;&nbsp; &nbsp;JkLogFile&nbsp; /
    JkLogLevel error
    JkLogFile  /var/log/apache2/mod_jk.log
</IfModule>
<VirtualHost \ *:80>
ServerName dspace.example.com &nbsp;&nbsp; &nbsp;DocumentRoot
    DocumentRoot /usr/local/www/apache22/data &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <IfModule jk_module> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;JkMount /xmlui localhost-worker &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;JkMount /xmlui/\* localhost-worker &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;JkMount /solr localhost-worker &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;JkMount /solr/\* localhost-worker &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;JkMount /oai localhost-worker &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;JkMount /oai/\* localhost-worker &nbsp;&nbsp; &nbsp;</IfModule> &nbsp;&nbsp; &nbsp;RewriteEngine On &nbsp;&nbsp; &nbsp;RewriteRule \^/$ /xmlui/ \[PT\] &nbsp;&nbsp; &nbsp;RewriteRule \^/$ /solr/ \[PT\] &nbsp;&nbsp;&nbsp; RewriteRule \^/$ /oai/ \[PT\]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RewriteCond [http://%]\{HTTP_HOST\}%\{REQUEST_URI\} (.\
        <IfModule jk_module>
        JkMount /xmlui localhost-worker
        JkMount /xmlui/* localhost-worker
        JkMount /solr localhost-worker
        JkMount /solr/* localhost-worker
        JkMount /oai localhost-worker
        JkMount /oai/* localhost-worker
    </IfModule>
    RewriteEngine On
    RewriteRule ^/$ /xmlui/ [PT]
    RewriteRule ^/$ /solr/ [PT]
    RewriteRule ^/$ /oai/ [PT]   
    RewriteCond http://%{HTTP_HOST}%{REQUEST_URI} (.*)-login(.*) \ [OR\] &nbsp;&nbsp; &nbsp;RewriteCond [http]
    RewriteCond http://%]\{HTTP_HOST\}%\{REQUEST_URI\} (.\*)/register(.*) \ [OR\] &nbsp;&nbsp; &nbsp;RewriteCond []
    RewriteCond http://%]\{HTTP_HOST\}%\{REQUEST_URI\} (.\*)/forgot(.*) &nbsp; &nbsp;&nbsp; &nbsp;RewriteRule (.\*) [ 
    RewriteRule (.*) https://%]\{HTTP_HOST\}%\{REQUEST_URI\} &nbsp;&nbsp; &nbsp;# &nbsp;&nbsp; &nbsp;CustomLog "\}
    #
    CustomLog "|/usr/local/sbin/rotatelogs \ -l /var/log/apache2/dspace.example.com-access-%Y-%m-%d.log 86400" combined &nbsp;&nbsp; &nbsp;ErrorLog combined
    ErrorLog /var/log/apache2/dspace.example.com-error.log
</VirtualHost>unmigrated-wiki-markup

*tcsh# egrep \ -v "#\|"^$ /usr/local/etc/apache22/extra/httpd-ssl.conf*
Listen 443
/*/
<VirtualHost \ _default_:443>
ServerName dspace.example.com:443
ServerAdmin hostmaster@example.com
DocumentRoot "/usr/local/www/apache22/data"
<IfModule jk_module> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JkMount /xmlui localhost-worker &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JkMount /xmlui/\* localhost-worker &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JkMount /solr localhost-worker &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JkMount /solr/\* localhost-worker &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JkMount /oai localhost-worker &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JkMount /oai/\* localhost-worker &nbsp;&nbsp; &nbsp;RewriteEngine On &nbsp;&nbsp; &nbsp;RewriteRule \^/$ /xmlui/ \[PT\] &nbsp;&nbsp; &nbsp;RewriteRule \^/$ /solr/ \[PT\] &nbsp;&nbsp; &nbsp;RewriteRule \^/$ /oai/ \[PT\] </IfModule> ErrorLog "\|/usr/local/sbin/rotatelogs /var/log/apache2/
        JkMount /xmlui localhost-worker
        JkMount /xmlui/* localhost-worker
        JkMount /solr localhost-worker
        JkMount /solr/* localhost-worker
        JkMount /oai localhost-worker
        JkMount /oai/* localhost-worker
    RewriteEngine On
    RewriteRule ^/$ /xmlui/ [PT]
    RewriteRule ^/$ /solr/ [PT]
    RewriteRule ^/$ /oai/ [PT]
</IfModule>
ErrorLog "|/usr/local/sbin/rotatelogs /var/log/apache2/https-error-%Y-%m-%d.log 5M"
TransferLog "\|/usr/local/sbin/rotatelogs /var/log/apache2/https-access-%Y-%m-%d.log 86400"
/*/
SSLCertificateFile "/usr/local/etc/apache22/certs/dspace.example.com.crt"
SSLCertificateKeyFile "/usr/local/etc/apache22/certs/dspace.example.com.key"
SSLCertificateChainFile "/usr/local/etc/apache22/certs/dspace-bundle.example.com.crt"
/*/
<Directory "/data/dspace/webapps/xmlui"> &nbsp;&nbsp;&nbsp; SSLOptions \+StdEnvVars \+ExportCertData
    SSLOptions +StdEnvVars +ExportCertData
</Directory>

4 Install Dspace

Panel

tcsh# mkdir /data/dspace
tcsh# cd /data
tcsh# fetch -o dspace-1.8.1-src-release.tar.gz *http://sourceforge.net/projects/dspace/files/DSpace%20Stable/1.8.1/dspace-1.8.1-src-release.tar.gz/download\* (http://sourceforge.net/projects/dspace/files/DSpace%20Stable/1.8.1/dspace-1.8.1-src-release.tar.gz/download*)
tcsh# tar xzf dspace-1.8.1-src-release.tar.gz
tcsh# cd /data/dspace-1.8.1-src-release/dspace/config/

...

Now install certificates required to use LDAPS. Make sure that You have JAVA_HOME set:

unmigrated-wiki-markup
Panel

*tcsh# set JAVA_HOME=/usr/local/openjdk6* *
tcsh# echo $JAVA_HOME*
/usr/local/openjdk6 *
tcsh# keytool \ -import \ -file /tmp/myldap-clients.example.com.crt \ -alias myldap.example.com \ -keystore $JAVA_HOME/jre/lib/security/cacerts*
Enter keystore password:&nbsp;   'changeit'&nbsp;&nbsp; <\- by default without    <- by default without '-es\!
/*/
Trust this certificate? \ [no\]:&nbsp; *yes* Certificate was added to keystore *tcsh# keytool \-list \-keystore   yes
Certificate was added to keystore
tcsh# keytool -list -keystore $JAVA_HOME/jre/lib/security/cacerts* *
tcsh# rm \ -f /tmp{*}*/myldap-clients.example.com.crt*

5 Handle

If You are using "handle" also, then:

...

Panel

#!/bin/sh
#
# PROVIDE: handle
# REQUIRE: NETWORKING tomcat7
# KEYWORD: shutdown
#
# handle_server_enable="YES"
#

. /etc/rc.subr

name="handle_server"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
rcvar=`set_rcvar`

command="/data/dspace/bin/start-handle-server"unmigrated-wiki-markup

handle_server_start() \{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if \[ \-x $\{command\} \]; then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{
        if [ -x ${command} ]; then
        pid="`ps \ -axuwww \ | grep \ -v grep \ | grep handle-server \ | nawk '\{ print $2 \ }'`" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if \[ "$\{pid\}"X = "X" \]; then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; su - www \-c $\{command\} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Handle server is already running." &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi \} handle_server_stop() \{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pid="`ps \-axuwww \| grep \-v grep \| grep handle-server \| nawk '\{ print $2 \}'`" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if \[ "$\{pid\}"X \!= "X" \]; then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pid_owner="`ps \-axu \|grep \-v grep \| grep \-w $pid \|nawk '\{ print $1 \}'`" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if \[ "$\{pid_owner\}" = "www" \]; then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kill \-15 $\{pid\} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep 1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Handle server is not running?" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi \} \# set
                if [ "${pid}"X = "X" ]; then
                        su - www -c ${command}
                else
                        echo "Handle server is already running."
                fi
        fi
}
handle_server_stop()
{
        pid="`ps -axuwww | grep -v grep | grep handle-server | nawk '{ print $2 }'`"
        if [ "${pid}"X != "X" ]; then
                pid_owner="`ps -axu |grep -v grep | grep -w $pid |nawk '{ print $1 }'`"
                if [ "${pid_owner}" = "www" ]; then
                        kill -15 ${pid}
                        sleep 1
                fi
        else
                echo "Handle server is not running?"
        fi
}
# set defaults

handle_server_enable=${handle_server_enable:-"NO"}
load_rc_config "${name}"

run_rc_command "$1"

...