Fedora Install Notes

Fedora Install Notes:
## notes taken while setting up fedora (on Ben's desktop), risearch, xacml, gsearch and solr on dev11.  Effort
## was to mirror Domokun's installation for upgrade testing.
## dev11 already had php, java, databases and fedora installed.
yum install postgresql-server.i386 postgresql.i386 postgres
yum install php php-pgsql
yum install java

adduser fedora
mkdir /home/pgsql
chown -R postgres:postgres /home/pgsql
usermod -d /home/pgsql postgres
vi /etc/profile
    export FEDORA_HOME
su - postgres
mkdir data
initdb -D /home/pgsql/data
pgctl -D /home/pgsql/data -l logfile start
createdb fedora321
createuser -P -s scolli9
createuser -P fedora

# install phppgadmin
wget http://downloads.sourceforge.net/phppgadmin/phpPgAdmin-4.2.2.tar.bz2
tar jxvf phpPgAdmin-4.2.2.tar.bz2
mv phpPgAdmin-4.2.2 /home/httpd/html/phpPgAdmin

mkdir /home/fedora321
cd /home/fedora321
wget http://downloads.sourceforge.net/fedora-commons/fedora-installer-3.2.1.jar
java -jar fedora-installer-3.2.1.jar
    <enter> or hostname
    <enter> x 6
    <enter> or port#
    <enter> x 2
    included  (for self signed cert)

    <enter> x 5
    false (for demos)

chown -R fedora:fedora /home/fedora*
su - fedora
vi .bash_profile
. ./.bash_profile
tomcat/bin/startup.sh            #set JAVA_HOME if needed...JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk
# go to https://localhost:8443/fedora/

# added another user for Rebecca...may not need for projects other than ETD.
vi /home/fedora32a/server/config/fedora-users.xml        #insert below line
    <user name="etdmaint" password="etdmaint">

###### DEV11 setup section ####
## enable risearch ##
# Fedora info on web: http://fedora-commons.org/confluence/display/FCR30/Resource+Index
vi server/config/fedora.fcfg
    #find ResourceIndex, change value to 1
    #find syncUpdates, change value to true

mkdir $FEDORA_HOME/store/resourceIndex

## install xacml policy (ETD policies in example) ##
cd $FEDORA_HOME/data/fedora-xacml-policies/repository-policies
svn co https://svn.library.emory.edu/svn/fedora/repository-policies/trunk/
cd /home/fedora32a/data/fedora-xacml-policies/repository-policies/default
vi deny-apim-if-not-localhost.xml
    # down where it says add a duplicate line with IP needed to access...Rebecca needed the below added
    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"></AttributeValue>

## gsearch ##
# For gsearch I downloaded the wrong version and had to reinstall.  I tried to remove the parts where we
# installed the wrong version.  Also on dev11, we are running 2 instances of Fedora.  The instance these notes
# are on are for the second instance listening on port 8180.
wget http://downloads.sourceforge.net/fedora-commons/genericsearch-2.2.zip
unzip genericsearch-2.2.zip
cp genericsearch-2.2/fedoragsearch.war tomcat/webapps/
vi /home/fedora32a/tomcat/webapps/fedoragsearch/configvalues.xml
    -replace all 8080 with 8180

# copy the config directory and sub directories file from Domokun.  Domokun has 2 solr instances, ETD and
# Smallpox.  Some steps below may not apply, but should prove useful
scp domokun:/home/fedora22/tomcat/webapps/fedoragsearch/WEB-INF/classes/config.tar dev11:/home/fedora32a/tomcat/webapps/fedoragsearch/WEB-INF/classes/
cd /home/fedora32a/tomcat/webapps/fedoragsearch/WEB-INF/classes/
tar xvf config.tar
cd config
vi fedoragsearch.properties
    replace 8080 with 8180
    change userid and password
    change dir
cd /home/fedora32a/tomcat/webapps/fedoragsearch/WEB-INF/classes/config/repository/FedoraRepository
vi repository.properties
    replace 8080 with 8180
    change dir
cd /home/fedora32a/tomcat/webapps/fedoragsearch/WEB-INF/classes/config/rest/
    change all files with proper dir except copyXml.xslt

cd /home/fedora32a/tomcat/webapps/fedoragsearch/WEB-INF/classes/config/index/ETDsolr
vi index.properties
    change dir
cd ../SmallpoxSolr
vi index.properties

##Alternate install from scratch
cd /home/fedora321/tomcat/webapps/fedoragsearch/WEB-INF/classes
cp -r configDemoOnSolr/ config
cd config
vi fedoragsearch.properties
    change url
    userid and password
    add text/xml to mime types
cd repository
cd DemoAtDtu
vi repository.properties
    url, userid, passwd, objectdir, and removed the other crap
cd /home/fedora321/tomcat/webapps/fedoragsearch/WEB-INF/classes/config/rest
    #change files with CONFIGPATH with proper dir except copyXml.xslt
cd /home/fedora321/tomcat/webapps/fedoragsearch/WEB-INF/classes/config/index/DemoOnSolr
vi index.properties
    change dir

## solr ##
# Again Dev11 will have multicore.  If you are running a single core, some of the multicore steps can be skipped.
wget http://www.hightechimpact.com/Apache/lucene/solr/1.3.0/apache-solr-1.3.0...
tar zxvf apache-solr-1.3.0.tgz
cd apache-solr-1.3.0
cp dist/apache-solr-1.3.0.war /home/fedora32a/tomcat/webapps/solr.war
cp -r example ../solr
cd ../solr/multicore
vi solr.xml            #comment out the default cores config
  <cores adminPath="/admin/cores">
    <core name="etd" instanceDir="etd" default="true" >
    <property name="dataDir" value="etd/data" />
    <core name="smallpox" instanceDir="smallpox" >
    <property name="dataDir" value="smallpox/data" />

mkdir etd
mkdir smallpox
# copy the Domokun conf dir for the multicores.  The conf file holds configurations as well as schema info.
# tar up config dir in /home/fedora22/gsearch/solr/multicore/etd/ and /home/fedora22/gsearch/solr/multicore/
# smallpox/  scp the tar files over.
sudo cp etd.tar  /home/fedora32a/gsearch/solr/multicore/etd/
sudo chown fedora:fedora /home/fedora32a/gsearch/solr/multicore/etd/etd.tar
sudo cp sp.tar  /home/fedora32a/gsearch/solr/multicore/smallpox/
sudo chown fedora:fedora /home/fedora32a/gsearch/solr/multicore/smallpox/sp.tar
# expand and modify
cd etd
tar xvf etd.tar
rm etd.tar
vi conf/solrconfig.xml
    # remove datadir entry
cd ../smallpox
tar xvf sp.tar
rm sp.tar
vi conf/solrconfig.xml
    #remove datadir entry
# config fedoragsearch or verify proper dir, etc.
vi /home/fedora32a/tomcat/webapps/fedoragsearch/WEB-INF/classes/config/index/ETDsolr/index.properties
vi /home/fedora32a/tomcat/webapps/fedoragsearch/WEB-INF/classes/config/index/SmallpoxSolr/index.properties
# start tomcat
cd /home/fedora32a/gsearch/solr
# At this point I started solr with the below commands.
    # java -Dsolr.solr.home=multicore -jar start.jar &   (command for starting in multicore)
# test via http://dev11.library.emory.edu:8180/fedoragsearch/rest  click updateIndex.
# keep getting segments* errors...kill java, copy over segments from single core and restarted:
ps -ef|grep java        #get pid
kill <pid>
cp /home/fedora32a/gsearch/solr/solr/data/index/segment* /home/fedora32a/gsearch/solr/multicore/etd/data/index/
cp /home/fedora32a/gsearch/solr/solr/data/index/segment* /home/fedora32a/gsearch/solr/multicore/smallpox/data/index/
# start up and test
java -Dsolr.solr.home=multicore -jar start.jar &
# test via http://dev11.library.emory.edu:8180/fedoragsearch/rest  click updateIndex.  If no error in the "Foxml # files path:" box enter /home/fedora32a/data/objects    That should start the index of ETD (the default index).