Ticket #13089: 0002-Suggestion-for-INSTALL.patch

File 0002-Suggestion-for-INSTALL.patch, 4.4 KB (added by iwakeh, 5 years ago)

based on your ​task-13089 branch

  • INSTALL

    From c3e24816fe9f86258a4137da4f46b2811ed6351f Wed Oct 1 17:45:00 2014
    From: iwakeh <iwakeh@users.ourproject.org>
    Date: Wed, 1 Oct 2014 17:45:00 +0000
    Subject: [PATCH 2/2] Suggestion for INSTALL.
    
    ---
     INSTALL | 86 ++++++++++++++++++++++++-----------------------------------------
     1 file changed, 31 insertions(+), 55 deletions(-)
    
    diff --git a/INSTALL b/INSTALL
    index 5bc8c62..aa5856e 100644
    a b $ git clone https://git.torproject.org/onionoo.git /srv/onionoo/ 
    1111$ cd /srv/onionoo
    1212
    1313
    14 Install Java 1.6 or higher, ant 1.8 or higher, and Tomcat 6
     14Install Java 1.7 or higher and ant 1.8 or higher
    1515-----------------------------------------------------------
    1616
    1717$ javac -version
    18 javac 1.6.0_26
     18javac 1.7.0_65
    1919
    2020$ ant -version
    2121Apache Ant version 1.8.0 compiled on March 11 2010
    Apache Ant version 1.8.0 compiled on March 11 2010 
    2424Provide required .jar files
    2525---------------------------
    2626
    27 Download or build the following .jar files and put them in the lib/
    28 directory:
    29 
    30 - Apache Commons Codec 1.4
    31 - Apache Commons Compress 1.4.1
    32 - Apache Commons Lang 2.6
    33 - Servlet API, e.g., from Tomcat 6
    34 - Tor Metrics Descriptor Library, metrics-lib
    35 - Gson 2.2.3
     27Download jar files listed in the build.xml classpath.  The Onionoo
     28project usually uses debian stable provided libraries. If you download
     29them elsewhere, please edit the corresponding paths in build.xml.
    3630
    3731Attempt to compile the Java sources to make sure that everything works
    3832correctly:
    change the value for the maxmemory.value property near the top of the 
    9387build.xml file.
    9488The initial run may take a while:
    9589
    96 $ ant run
     90$ java -DLOGBASE=/path/to/logfiles -Xmx4g dist/onionoo-<version>.jar
    9791
    9892
    9993Set up an hourly cronjob
    one: 
    10610015 * * * * cd /srv/onionoo/ && bin/update.sh
    107101
    108102
    109 Configure Tomcat
    110 ----------------
    111 
    112 The following file may be a useful Tomcat configuration file.
    113 Make changes according to your server setup, i.e. replace ${your-host-ip}
    114 with your ip address and the like (ports, lognames and paths).
    115 Put it in /etc/tomcat6/server.xml:
    116 
    117 <Server port="8005" shutdown="SHUTDOWN">
    118   <Service name="Catalina">
    119     <Connector port="8080" maxHttpHeaderSize="8192"
    120                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    121                enableLookups="false" redirectPort="8443" acceptCount="100"
    122                connectionTimeout="20000" disableUploadTimeout="true"
    123                compression="on" compressionMinSize="2048"
    124                noCompressionUserAgents="gozilla, traviata"
    125                compressableMimeType="text/html,application/json" />
    126     <Engine name="Catalina" defaultHost="${your-host-ip}">
    127       <Host name="${your-host-ip}" appBase="webapps"
    128             unpackWARs="true" autoDeploy="true"
    129             xmlValidation="false" xmlNamespaceAware="false">
    130         <Alias>${your-host-ip}</Alias>
    131         <Valve className="org.apache.catalina.valves.AccessLogValve"
    132                directory="logs" prefix="onionoo_access_log." suffix=".txt"
    133                pattern="%l %u %t %r %s %b" resolveHosts="false"/>
    134       </Host>
    135     </Engine>
    136   </Service>
    137 </Server>
    138 
    139 It may also be necessary to increase Tomcat's maximum heap space.  Do this
    140 by editing JAVA_OPTS in /etc/default/tomcat6 and change "-Xmx128m" to
    141 "-Xmx512m".
    142 
    143 
    144 Deploy the Tomcat application
    145 -----------------------------
     103Running the web server
     104----------------------
    146105
    147106Create a .war file:
    148107
    149108$ ant war
    150109
    151 Create a symbolic link to the .war file, so that non-root users can
    152 re-deploy the application in the future.  Run the following commands as
    153 root:
     110Start the Onionoo server
    154111
    155 # cd /var/lib/tomcat6/webapps/
    156 # ln -s /srv/onionoo/onionoo.war onionoo.war
     112$ java -DLOGBASE=/path/to/logfiles -Xmx4g dist/onionoo-<version>.jar
    157113
    158114The Onionoo server should now be available at
    159 http://localhost:8080/onionoo/.
     115http://localhost:8080/.
     116
     117Configure Embedded Jetty
     118------------------------
     119
     120Settings for the embedded jetty can be found in etc/jetty.xml
     121If you change anything, run
     122$ ant clean war
     123again.
     124
     125Configure logging
     126-----------------
     127
     128Logging can be configured inside logback.xml
     129If you change anything, run
     130$ ant clean war releasejar
     131again.
     132
     133The command line option LOGBASE is the path for the log files.
     134In case you forget to set it, you'll find the logs in the current
     135path in the folder LOGBASE_IS_UNDEFINED/
    160136