<commit_before>
-------------------------------------------------------------------------------
 
This document is a summary of the VIVO installation process. This and other documentation
can be found at:

     http://vivoweb.org/support
    
PLEASE NOTE!
These instructions assume that you are performing a clean install, 
including emptying an existing database and removing a previous installation 
from the Tomcat webapps directory. Product functionality may not be as expected 
if you install over an existing installation of an earlier version.

Upgrade:
If you are going to upgrade an existing service, please consult the upgrade.txt
in this directory.

VIVO Developers:
If you are working on the VIVO source code from Subversion, the instructions 
are slightly different. Please consult developers.txt in this directory.
 
-------------------------------------------------------------------------------
 
    * I. Install required software
    * II. Create an empty MySQL database
    * III. Download the VIVO Application Source
    * IV. Specify deployment properties
    * V. Compile and deploy
    * VI. Set Tomcat JVM Parameters
    * VII. Start Tomcat
    * VIII. Log in and add RDF data
    * IX. Set the Contact Email Address (if using "Contact Us" form)
    * X. Setup Apache Tomcat Connector
    * XI. Configure Pellet Reasoner
    * XII. Was the Installation Successful?

-------------------------------------------------------------------------------
 
I. Install required software

Before installing VIVO, make sure that the following software is installed on 
the desired machine:

    * Java (SE) 1.6 or higher [http://java.sun.com]
    * Apache Tomcat 6.x or higher [http://tomcat.apache.org]
    * Apache Ant 1.7 or higher [http://ant.apache.org]
    * MySQL 5.1 or higher [http://www.mysql.com]

Be sure to setup the environment variables for "JAVA_HOME" and "ANT_HOME" and 
add the executables to your path per your operating system and installation 
directions from the software support web sites.

-------------------------------------------------------------------------------
 
II. Create an empty MySQL database

Decide on a database name, username, and password. Log into your MySQL server 
and create a new database in MySQL that uses UTF-8 encoding. You will need 
these values for step IV when you configure the deployment properties. At the 
MySQL command line you can create the database and user with these commands 
substituting your values for "dbname", "username", and "password". Most of the 
time, the "hostname" will equal "localhost".

CREATE DATABASE dbname CHARACTER SET utf8;

Grant access to a database user. For example:

GRANT ALL ON dbname.* TO 'username'@'hostname' IDENTIFIED BY 'password';

Keep track of the database name, username, and password for Step IV.

-------------------------------------------------------------------------------
 
III. Download the VIVO Application Source

Download the VIVO application source as either rel-1.1.1.zip or rel-1.1.1.gz file 
and unpack it on your web server:
      
      http://vivoweb.org/download

-------------------------------------------------------------------------------
 
IV. Specify deployment properties

At the top level of the unpacked distribution, copy the file 
example.deploy.properties to a file named simply deploy.properties. This file 
sets several properties used in compilation and deployment.

NOTE: For those installing on Windows operating system, include the windows 
drive and use the forward slash "/" and not the back slash "\" in the 
directory locations, e.g. "c:/tomcat".

                Default namespace: VIVO installations make their RDF resources available for harvest 
                using linked data. Requests for RDF resource URIs redirect to HTML 
                or RDF representations as specified by the client. To make this 
                possible, VIVO's default namespace must have certain structure and 
                begin with the public web address of the VIVO installation. 
                For example, if the web address of a VIVO installation is 
                http://vivo.example.edu/ the default namespace must be set to 
                http://vivo.example.edu/individual/ in order to support linked data.
                Similarly, if VIVO is installed at http://www.example.edu/vivo the 
                default namespace must be set to http://www.example.edu/vivo/individual/
                Note:  The namespace must end with "individual/" (including the 
                trailing slash).
property name:  Vitro.defaultNamespace 	
example value:  http://vivo.mydomain.edu/individual/

                Directory where Vitro code is located. In most deployments, 
                this is set to ./vitro-core, but it commonly points elsewhere 
                during development.
property name:  vitro.core.dir
example value:  ./vitro-core

                Directory where tomcat is installed
property name:  tomcat.home
example value:  /usr/local/tomcat

                Name of your VIVO application
property name:  webapp.name
example value:  vivo

                Directory where uploaded files will be stored. You must create 
                this directory ahead of time.
property name:  upload.directory
example value:  /usr/local/vivo/data/uploads

                Directory where the Lucene search index will be built. 	
                Depending on your permissions and who Tomcat is running as, 
                you may need to create this directory ahead of time.
property name:  LuceneSetup.indexDir 	
example value:  /usr/local/vivo/data/luceneIndex

                Specify an SMTP host that the form will use for sending 
                e-mail (Optional). If this is left blank, the contact form 
                will be hidden and disabled.
property name:  Vitro.smtpHost 	
example value:  smtp.servername.edu

                Specify the JDBC URL of your database.  Change the end of the
                URL to reflect your database name (if it is not "vivo").
property name:  VitroConnection.DataSource.url 	
example value:  jdbc:mysql://localhost/vivo

                Change the username to match the authorized user you created in MySQL
property name:  VitroConnection.DataSource.username
example value:  username

                Change the password to match the password you created in MySQL 	
property name:  VitroConnection.DataSource.password
example value:  password
	  	 
                Specify the name of your first admin user for the VIVO application. 
                This user will have an initial temporary password of '<PASSWORD>'. 
                You will be prompted to create a new password on first login.
property name:  initialAdminUser 	
example value:  defaultAdmin

-------------------------------------------------------------------------------
 
V. Compile and deploy

At the command line, from the top level of the unpacked distribution directory,
type:

ant all

to build VIVO and deploy to Tomcat's webapps directory.

-------------------------------------------------------------------------------

VI. Set Tomcat JVM Parameters

Currently, VIVO copies the contents of your RDF database into memory in order
to serve Web requests quickly (the in-memory copy and the underlying database
 are kept in synch as edits are performed).

VIVO will require more memory than that allocated to Tomcat by default. With
most installations of Tomcat, the setenv.sh or setenv.bat file in Tomcat's bin
directory is a convenient place to set the memory parameters. 

For example: 

export CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=64m"

This sets Tomcat to allocate an initial heap of 1024 megabytes, a maximum heap 
of 1024 megabytes, and a PermGen space of 64 megs. 1024 megabytes is a minimum 
practical heap size for production installations storing data for large academic 
institutions, and additional heap space is preferable. For testing with small 
sets of data, 256m to 512m should be sufficient.

If an OutOfMemoryError is encountered during VIVO execution, it can be remedied 
by increasing the heap parameters and restarting Tomcat.

-------------------------------------------------------------------------------
 
VII. Start Tomcat

Most Tomcat installations can be started by running startup.sh or startup.bat 
in Tomcat's bin directory. Point your browser to http://localhost:8080/vivo/ 
to test the application.

If Tomcat does not start up, or the VIVO application is not visible, check the 
catalina.out file in Tomcat's logs directory. 

-------------------------------------------------------------------------------
 
VIII. Log in and add RDF data

If the startup was successful, you will see a welcome message informing you 
that you have successfully installed VIVO. Click the "Log in" link near the 
upper right corner. Log in with the initialAdminUser username you set up in 
Step IV. The initial password for initialAdminUser is <PASSWORD>. On first 
login, you will be prompted to select a new password and verify it a second <commit_msg>Adding information about setting the limits.conf file to improve performance.<commit_after>
-------------------------------------------------------------------------------
 
This document is a summary of the VIVO installation process. This and other documentation
can be found at:

     http://vivoweb.org/support
    
PLEASE NOTE!
These instructions assume that you are performing a clean install, 
including emptying an existing database and removing a previous installation 
from the Tomcat webapps directory. Product functionality may not be as expected 
if you install over an existing installation of an earlier version.

Upgrade:
If you are going to upgrade an existing service, please consult the upgrade.txt
in this directory.

VIVO Developers:
If you are working on the VIVO source code from Subversion, the instructions 
are slightly different. Please consult developers.txt in this directory.
 
-------------------------------------------------------------------------------
 
    * I. Install required software
    * II. Create an empty MySQL database
    * III. Download the VIVO Application Source
    * IV. Specify deployment properties
    * V. Compile and deploy
    * VI. Set Tomcat JVM parameters and security limits
    * VII. Start Tomcat
    * VIII. Log in and add RDF data
    * IX. Set the Contact Email Address (if using "Contact Us" form)
    * X. Setup Apache Tomcat Connector
    * XI. Configure Pellet Reasoner
    * XII. Was the installation successful?

-------------------------------------------------------------------------------
 
I. Install required software

Before installing VIVO, make sure that the following software is installed on 
the desired machine:

    * Java (SE) 1.6 or higher [http://java.sun.com]
    * Apache Tomcat 6.x or higher [http://tomcat.apache.org]
    * Apache Ant 1.7 or higher [http://ant.apache.org]
    * MySQL 5.1 or higher [http://www.mysql.com]

Be sure to setup the environment variables for "JAVA_HOME" and "ANT_HOME" and 
add the executables to your path per your operating system and installation 
directions from the software support web sites.

-------------------------------------------------------------------------------
 
II. Create an empty MySQL database

Decide on a database name, username, and password. Log into your MySQL server 
and create a new database in MySQL that uses UTF-8 encoding. You will need 
these values for step IV when you configure the deployment properties. At the 
MySQL command line you can create the database and user with these commands 
substituting your values for "dbname", "username", and "password". Most of the 
time, the "hostname" will equal "localhost".

CREATE DATABASE dbname CHARACTER SET utf8;

Grant access to a database user. For example:

GRANT ALL ON dbname.* TO 'username'@'hostname' IDENTIFIED BY 'password';

Keep track of the database name, username, and password for Step IV.

-------------------------------------------------------------------------------
 
III. Download the VIVO Application Source

Download the VIVO application source as either rel-1.1.1.zip or rel-1.1.1.gz file 
and unpack it on your web server:
      
      http://vivoweb.org/download

-------------------------------------------------------------------------------
 
IV. Specify deployment properties

At the top level of the unpacked distribution, copy the file 
example.deploy.properties to a file named simply deploy.properties. This file 
sets several properties used in compilation and deployment.

NOTE: For those installing on Windows operating system, include the windows 
drive and use the forward slash "/" and not the back slash "\" in the 
directory locations, e.g. "c:/tomcat".

                Default namespace: VIVO installations make their RDF resources available for harvest 
                using linked data. Requests for RDF resource URIs redirect to HTML 
                or RDF representations as specified by the client. To make this 
                possible, VIVO's default namespace must have certain structure and 
                begin with the public web address of the VIVO installation. 
                For example, if the web address of a VIVO installation is 
                http://vivo.example.edu/ the default namespace must be set to 
                http://vivo.example.edu/individual/ in order to support linked data.
                Similarly, if VIVO is installed at http://www.example.edu/vivo the 
                default namespace must be set to http://www.example.edu/vivo/individual/
                Note:  The namespace must end with "individual/" (including the 
                trailing slash).
property name:  Vitro.defaultNamespace 	
example value:  http://vivo.mydomain.edu/individual/

                Directory where Vitro code is located. In most deployments, 
                this is set to ./vitro-core, but it commonly points elsewhere 
                during development.
property name:  vitro.core.dir
example value:  ./vitro-core

                Directory where tomcat is installed
property name:  tomcat.home
example value:  /usr/local/tomcat

                Name of your VIVO application
property name:  webapp.name
example value:  vivo

                Directory where uploaded files will be stored. You must create 
                this directory ahead of time.
property name:  upload.directory
example value:  /usr/local/vivo/data/uploads

                Directory where the Lucene search index will be built. 	
                Depending on your permissions and who Tomcat is running as, 
                you may need to create this directory ahead of time.
property name:  LuceneSetup.indexDir 	
example value:  /usr/local/vivo/data/luceneIndex

                Specify an SMTP host that the form will use for sending 
                e-mail (Optional). If this is left blank, the contact form 
                will be hidden and disabled.
property name:  Vitro.smtpHost 	
example value:  smtp.servername.edu

                Specify the JDBC URL of your database.  Change the end of the
                URL to reflect your database name (if it is not "vivo").
property name:  VitroConnection.DataSource.url 	
example value:  jdbc:mysql://localhost/vivo

                Change the username to match the authorized user you created in MySQL
property name:  VitroConnection.DataSource.username
example value:  username

                Change the password to match the password you created in MySQL 	
property name:  VitroConnection.DataSource.password
example value:  password
	  	 
                Specify the name of your first admin user for the VIVO application. 
                This user will have an initial temporary password of '<PASSWORD>'. 
                You will be prompted to create a new password on first login.
property name:  initialAdminUser 	
example value:  defaultAdmin

-------------------------------------------------------------------------------
 
V. Compile and deploy

At the command line, from the top level of the unpacked distribution directory,
type:

ant all

to build VIVO and deploy to Tomcat's webapps directory.

-------------------------------------------------------------------------------

VI. Set Tomcat JVM parameters and security limits

Currently, VIVO copies the contents of your RDF database into memory in order
to serve Web requests quickly (the in-memory copy and the underlying database
 are kept in synch as edits are performed).

VIVO will require more memory than that allocated to Tomcat by default. With
most installations of Tomcat, the setenv.sh or setenv.bat file in Tomcat's bin
directory is a convenient place to set the memory parameters. 

For example: 

export CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=64m"

This sets Tomcat to allocate an initial heap of 1024 megabytes, a maximum heap 
of 1024 megabytes, and a PermGen space of 64 megs. 1024 megabytes is a minimum 
practical heap size for production installations storing data for large academic 
institutions, and additional heap space is preferable. For testing with small 
sets of data, 256m to 512m should be sufficient.

If an OutOfMemoryError is encountered during VIVO execution, it can be remedied 
by increasing the heap parameters and restarting Tomcat.

Security limits: VIVO is a multithreaded web application that may require more threads than are 
permitted under your Linux installation's default configuration. Ensure that 
your installation can support the required number of threads by making the 
following edits to /etc/security/limits.conf:

    apache    hard    nproc   400
    tomcat6   hard    nproc   1500 

-------------------------------------------------------------------------------
 
VII. Start Tomcat

Most Tomcat installations can be started by running startup.sh or startup.bat 
in Tomcat's bin directory. Point your browser to http://localhost:8080/vivo/ 
to test the application.

If Tomcat does not start up, or the VIVO application is not visible, check the 
catalina.out file in Tomcat's logs directory. 

-------------------------------------------------------------------------------
 
VIII. Log in and add RDF data

If the startup was successful, you will see a welcome message informing you 
that you have successfully installed VIVO. Click the "Log in" link near the 
upper right corner. Log in with the initialAdminUser username you set up in 
Step IV. The initial password for initialAdminUser is defaultAdmin. On first 
login, you will be prompted to select a new password and verify it a second 
{'fraction_non_alphanumeric': 0.12575781962551638, 'fraction_numerical': 0.0056870003755566285, 'mean_word_length': 2.1874145006839947, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6562634', 'n_tokens_mistral': 4619, 'n_tokens_neox': 4240, 'n_words': 2259}