Benutzer-Werkzeuge

Webseiten-Werkzeuge


lilypond:lsr_setup

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
lilypond:lsr_setup [2011/07/06 13:33] – [section 9] reinholdlilypond:lsr_setup [2013/03/13 10:42] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 4: Zeile 4:
  
   - Install tomcat, mod_jk, velocity, libtagsoup-java, libmysql-java and mysql from your distribution's packages   - Install tomcat, mod_jk, velocity, libtagsoup-java, libmysql-java and mysql from your distribution's packages
-  - Download [[http://mg4j.dsi.unimi.it/|MG4J's dependencies package and the binary package]], [[http://erw.dsi.unimi.it/|ERW]] and the [[http://lsr.dsi.unimi.it/download/|LSR source code and the mysql dump]]. In particular, you should download the following files:<code> +  - Download [[http://mg4j.dsi.unimi.it/|MG4J's dependencies package and the binary package]], [[http://erw.dsi.unimi.it/|ERW]] and the [[http://lsr.dsi.unimi.it/download/|LSR source code and the mysql dump]]. In particular, you should download the following files: 
-mg4j-deps.tar.gz +    mg4j-deps.tar.gz 
-mg4j-3.0.1-bin.tar.gz +    mg4j-3.0.1-bin.tar.gz 
-ERW-1.0.10.tar.gz +    ERW-1.0.10.tar.gz 
-lsr-0.5-src.tar.gz +    lsr-0.5-src.tar.gz 
-lsr-2011-06-30.mysqldump.gz +    lsr-2011-06-30.mysqldump.gz
-</code>+
   - Extract the LSR source code (into the lsr-0.5/ directory):<code>   - Extract the LSR source code (into the lsr-0.5/ directory):<code>
 tar xfz lsr-0.5-src.tar.gz tar xfz lsr-0.5-src.tar.gz
-mkdir -p lsr-0.5/lib 
 </code> </code>
  
Zeile 19: Zeile 17:
  
   - Install MG4J: extract mg4j and all dependencies to the the lsr folder: <code>   - Install MG4J: extract mg4j and all dependencies to the the lsr folder: <code>
 +mkdir -p lsr-0.5/lib
 tar -C lsr-0.5/lib/ -xvzf mg4j-deps.tar.gz tar -C lsr-0.5/lib/ -xvzf mg4j-deps.tar.gz
-rm lsr-0.5/lib/tomcat5-servlet-2.4-api-5.5.27.jar+rm lsr-0.5/lib/tomcat5-servlet-*.jar
 tar xfz mg4j-3.0.1-bin.tar.gz tar xfz mg4j-3.0.1-bin.tar.gz
-cp mg4j-3.0.1/mg4j-3.0.1.jar lsr-0.5/lib/+cp mg4j-3.0.1/mg4j-*.jar lsr-0.5/lib/
 </code> </code>
   - Copy all required global jar files to the lsr code directory:<code>   - Copy all required global jar files to the lsr code directory:<code>
-cp /usr/share/java/tagsoup-1.2.jar lsr-0.5/lib/+cp /usr/share/java/tagsoup.jar lsr-0.5/lib/
 cp /usr/share/java/mysql.jar lsr-0.5/lib/ cp /usr/share/java/mysql.jar lsr-0.5/lib/
 cp /usr/share/java/mysql-connector-java.jar lsr-0.5/lib/ cp /usr/share/java/mysql-connector-java.jar lsr-0.5/lib/
Zeile 31: Zeile 30:
 </code> </code>
   - Create a sh/ subdirectory that will contain several helper shell scripts:<code>   - Create a sh/ subdirectory that will contain several helper shell scripts:<code>
-mkdir -p lsr-0.5/sh/</code> +mkdir -p lsr-0.5/sh/ 
-  - Download the setcp.sh and indexlsr.sh scripts to that directory: {{:lilypond:lsr:setcp.sh|setcp.sh}}, {{:lilypond:lsr:indexlsr.sh|indexlsr.sh}}+</code>and download the setcp.sh and indexlsr.sh scripts to that directory: {{:lilypond:lsr:setcp.sh|setcp.sh}}, {{:lilypond:lsr:indexlsr.sh|indexlsr.sh}}
   - We also need to tell the javac compiler to use those .jar files in the lib subdirectory (plus, the build.xml file contains the wrong version), therefore we have to patch build.xml. Download the following patch and store it in the lsr-0.4/ subdirectory: {{:lilypond:lsr:build.xml.patch|Patch file for build.xml}}<code>   - We also need to tell the javac compiler to use those .jar files in the lib subdirectory (plus, the build.xml file contains the wrong version), therefore we have to patch build.xml. Download the following patch and store it in the lsr-0.4/ subdirectory: {{:lilypond:lsr:build.xml.patch|Patch file for build.xml}}<code>
 cd lsr-0.5/ cd lsr-0.5/
Zeile 41: Zeile 40:
 cd .. cd ..
 </code>You will now have a lsr-0.5.jar file in lsr-0.5 </code>You will now have a lsr-0.5.jar file in lsr-0.5
 +  - Finally, remove all hardcoded references to lsr.dsi.unimi.it and to the https host (we are using http for both the front- and the backend). Download this patch: {{:lilypond:lsr:remove-dsi-url-https.patch|remove-dsi-url-https.patch}}<code> 
 +patch -p0 < remove-dsi-url-https.patch 
 +</code>
 ===== Setting up the MySQL database ===== ===== Setting up the MySQL database =====
   - Create a MySQL user lsr with password lsr and also create a database lsr, to which the user has all rights.   - Create a MySQL user lsr with password lsr and also create a database lsr, to which the user has all rights.
Zeile 48: Zeile 49:
 mysql --user=lsr --password=lsr lsr < lsr-2011-06-30.mysqldump mysql --user=lsr --password=lsr lsr < lsr-2011-06-30.mysqldump
 </code> </code>
-  - Create a group superadmin and give it all rights to all types. Also add a user 'admin' and add it to the superadmin group. It's easiest to use the following SQL file: {{:lilypond:lsr:sql-add-superadmin.sql|sql-add-superadmin.sql}}<code>+  - Create a group superadmin and give it all rights to all types. Also add a user 'admin' and add it to the superadmin group. It's easiest to use the following SQL file (Please change the password!): {{:lilypond:lsr:sql-add-superadmin.sql|sql-add-superadmin.sql}}<code>
 mysql --user=lsr --password=lsr lsr < sql-add-superadmin.sql mysql --user=lsr --password=lsr lsr < sql-add-superadmin.sql
 </code> </code>
Zeile 57: Zeile 58:
 </code> </code>
   - Create the proper forms, definition files and the SQL for an initial database for ERW (ertool --forms/defs/sql does the same, but has a hardcoded path to the erw.jar and needs it globally installed. Here we simply use the same direct java call as ertool does):<code>   - Create the proper forms, definition files and the SQL for an initial database for ERW (ertool --forms/defs/sql does the same, but has a hardcoded path to the erw.jar and needs it globally installed. Here we simply use the same direct java call as ertool does):<code>
 +erwdir=$PWD/ERW-1.0.10
 +alias myerwtool="java -cp $erwdir/ERtool/erw.jar:$CLASSPATH -Dit.unimi.dsi.erw.dtddir="$erwdir/dtd/" it.unimi.dsi.erw.ERtool "
 cd lsr-0.5/ERW/ cd lsr-0.5/ERW/
-java -cp ../../ERW-1.0.10/ERtool/erw.jar:$CLASSPATH -Dit.unimi.dsi.erw.dtddir="../../ERW-1.0.10/dtd/" it.unimi.dsi.erw.ERtool --forms forms/*.erf < lsr.xml +myerwtool --forms forms/*.erf < lsr.xml 
-mkdir defs+mkdir -p defs
 cd defs cd defs
-java -cp ../../../ERW-1.0.10/ERtool/erw.jar:$CLASSPATH -Dit.unimi.dsi.erw.dtddir="../../../ERW-1.0.10/dtd/" it.unimi.dsi.erw.ERtool --defs < ../lsr.xml+myerwtool --defs < ../lsr.xml
 cd .. cd ..
-java -cp ../../ERW-1.0.10/ERtool/erw.jar:$CLASSPATH -Dit.unimi.dsi.erw.dtddir="../../ERW-1.0.10/dtd/" it.unimi.dsi.erw.ERtool --sql < lsr.xml > lsr-ERW-db-structure.sql+myerwtool --sql < lsr.xml > lsr-ERW-db-structure.sql
 cd ../../ cd ../../
 </code> </code>
Zeile 72: Zeile 75:
 ===== Preparing the web host's directory structure ===== ===== Preparing the web host's directory structure =====
   - Create an output directory, where we collect all files for the web application: <code>   - Create an output directory, where we collect all files for the web application: <code>
-mkdir -p web/LSR/WEB-INF/{classes,data,templates,lib}+mkdir -p web/LSR/WEB-INF/{classes,data,templates,lib} web/{custom,defs,forms}
 </code> </code>
   - Copy the lsr-0.5.jar and all other required java packages to the output directory:<code>   - Copy the lsr-0.5.jar and all other required java packages to the output directory:<code>
Zeile 83: Zeile 86:
   - Copy all LSR files (also the generated ERW files) over, which will be served by apache:<code>   - Copy all LSR files (also the generated ERW files) over, which will be served by apache:<code>
 cp -r lsr-0.5/{css,html,img} web/LSR/ cp -r lsr-0.5/{css,html,img} web/LSR/
-mkdir -p web/LSR/ERW/ +cp lsr-0.5/ERW/custom/*.php web/custom
-cp -r lsr-0.5/ERW/{custom,defs,forms} web/LSR/ERW/ +cp lsr-0.5/ERW/defs/*.php web/defs/ 
-mv web/LSR/ERW/custom/login.php web/+cp lsr-0.5/ERW/forms/*.php web/forms/ 
 +mv web/custom/login.php web/
 cp lsr-0.5/vm/*.vm web/LSR/WEB-INF/templates cp lsr-0.5/vm/*.vm web/LSR/WEB-INF/templates
 </code> </code>
-  - Download the web.xml file and save it in the web/LSR/WEB-INF/ directory: {{:lilypond:lsr:web.xml|web.xml required to set up the tomcat webapp}} +  - Download the web.xml and velocity.properties files to the web/LSR/WEB-INF/ directory:  
-  - Download the velocity.properties file and save it in the web/LSR/WEB-INF/ directory: {{:lilypond:lsr:velocity.properties|velocity.properties required by the tomcat webapp}} +    * {{:lilypond:lsr:web.xml|web.xml required to set up the tomcat webapp}} 
-  - Open web/ERW-config.orig.php in a text editor and change $_ERW_erlId, the database user, password and database to "lsr". Also prepend LSR/ERW/ to the entries for defs, custom and forms. Then rename it to ERW-config.php:<code> +    {{:lilypond:lsr:velocity.properties|velocity.properties required by the tomcat webapp}} 
-mv web/ERW-config.orig.php web/ERW-config.php+  - Open web/ERW-conf.orig.php in a text editor and change $_ERW_erlId, the database user, password and database to "lsr". Then rename it to ERW-config.php:<code> 
 +mv web/ERW-conf.orig.php web/ERW-conf.php
 </code>My ERW-config.php can also be downloaded here: {{:lilypond:lsr:erw-conf.php|My ERW-conf.php config file}} </code>My ERW-config.php can also be downloaded here: {{:lilypond:lsr:erw-conf.php|My ERW-conf.php config file}}
   - Create the initial MG4J search index:<code>   - Create the initial MG4J search index:<code>
 +  lsrshdir=$PWD/lsr-0.5/sh/
   cd web/LSR/WEB-INF/data   cd web/LSR/WEB-INF/data
-  . ../../../../lsr-0.5/sh/setcp.sh +  . $lsrshdir/setcp.sh 
-  ../../../../lsr-0.5/sh/indexlsr.sh+  $lsrshdir/indexlsr.sh 
 +  cd -
 </code> </code>
 ===== Setting up Tomcat ===== ===== Setting up Tomcat =====
Zeile 161: Zeile 168:
  
 ===== Setting up the LilyPond jail needed for creating snippet output ===== ===== Setting up the LilyPond jail needed for creating snippet output =====
 +
 +  - Install a Lilypond version from the binary builds: 
 +    - Download the .sh file
 +    - As root, do <code>
 +  sudo mkdir /opt/lily2.14
 +  sudo ./lilypond-2.14.2-1.linux-x86.sh --prefix=/opt/lily2.14/</code>
 +  - Use {{:lilypond:lsr:create_lily_jail.sh|this script}} to setup a lilypond jail directory (each installed lilypond version needs roughly 100MB). You can use multiple installations with multiple -p arguments (in this example, I have versions 2.10, 2.12 and 2.14 installed in the same jail):<code>
 +  sudo ./create_lily_jail.sh -p /opt/lily2.10/ -p /opt/lily2.12/ -p /opt/lily2.14/ -s 400000 lilyjail</code>
 +  - This script will print out some instructions how to enable sudo for a user and how to automount the jail on boot. Follow the instructions, i.e.
 +    - Add the following line to /etc/fstab to ensure the loop device will be mounted on boot:<code>
 +/home/lilyjail/lilyloop /home/lilyjail/lilymnt    ext3 auto,loop 0       0</code>
 +    - Call ''visudo'' as root and add the following lines to the sudoers file (typically /etc/sudoers):<code>
 +ALL   ALL=NOPASSWD: /opt/lily2.10/lilypond/usr/bin/lilypond -jlilyjail\,lilyjail\,/home/lilyjail/lilymnt\,/lilyhome *
 +ALL   ALL=NOPASSWD: /opt/lily2.12/lilypond/usr/bin/lilypond -jlilyjail\,lilyjail\,/home/lilyjail/lilymnt\,/lilyhome *
 +ALL   ALL=NOPASSWD: /opt/lily2.14/lilypond/usr/bin/lilypond -jlilyjail\,lilyjail\,/home/lilyjail/lilymnt\,/lilyhome *
 +</code>This allows all users to run the jailed lilypond installation.
  
  
 +For details see the LilyPond documentation: http://lilypond.org/doc/v2.14/Documentation/usage/command_002dline-usage.html#lilypond-in-chroot-jail
 ===== Open issues ===== ===== Open issues =====
  
-  * Adjust all hard-coded links to lsr.dsi.unimi.it by relative links to the local host.+.
lilypond/lsr_setup.1309959226.txt.gz · Zuletzt geändert: 2013/03/13 10:42 (Externe Bearbeitung)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki