Difference between revisions of "SUNScholar/Prepare Ubuntu/S08"
m (Text replacement - "Back to Index" to "Back to "Prepare Ubuntu"") |
|||
| Line 76: | Line 76: | ||
==References== | ==References== | ||
| + | *http://en.wikipedia.org/wiki/Environment_variable | ||
*http://wiki.apache.org/tomcat/FAQ/Memory | *http://wiki.apache.org/tomcat/FAQ/Memory | ||
*http://en.wikipedia.org/wiki/Java_performance#Memory_usage | *http://en.wikipedia.org/wiki/Java_performance#Memory_usage | ||
Revision as of 14:11, 14 January 2014
Back to "Prepare Ubuntu"
Contents
- 1 Step 8. Setup the environment variables
- 2 Step 8.1 Java environment settings for Tomcat webapp server
- 3 Step 8.2 Java environment settings for other java web applications
- 4 Step 8.3 Increase number of open files available
- 5 Step 8.4: Setup file creation permissions
- 6 Step 8.5 Setup Tomcat server permissions
- 7 References
Step 8. Setup the environment variables
Step 8.1 Java environment settings for Tomcat webapp server
To setup the environment variables for Tomcat java web applications, type the following:
sudo nano /etc/default/tomcat6
Check the following for comparison:
# You may pass JVM startup parameters to Java here. If unset, the default # options (-Djava.awt.headless=true -Xmx128m) will be used. #JAVA_OPTS="-Djava.awt.headless=true -Xmx128m" JAVA_OPTS="-Djava.awt.headless=true -Xms1024m -Xmx2048m -XX:MaxPermSize=1024m"
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
Java environment settings used for SUNScholar
Your settings will depend on how much RAM you have available to assign to the Tomcat server. See graph below as well.
JAVA_OPTS="-Djava.awt.headless=true -Xmx8192m -Xms4096m -XX:PermSize=4096m -XX:MaxPermSize=8192m"
Graph of RAM memory usage on SUNScholar.
Step 8.2 Java environment settings for other java web applications
To setup the environment variables for other java applications (such as the Handle and SOLR servers), type the following:
sudo nano /etc/environment
Copy and paste the following to the bottom of the file.
JAVA_HOME="/usr/lib/jvm/default-java" JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -Xms512m -Dfile.encoding=UTF-8"
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
Step 8.3 Increase number of open files available
Open the following file as follows:
sudo nano /etc/security/limits.conf
Add the following to the bottom of the file:
* hard nofile 65536 * soft nofile 65536
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
Make sure to check the files open parameter with the next computer reboot by typing the following as the root user:
ulimit -n
Step 8.4: Setup file creation permissions
nano $HOME/.bashrc
Add the following to the bottom of the file
umask 002
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
Step 8.5 Setup Tomcat server permissions
Please note: This procedure violates best security practice on an Ubuntu server. See: http://dspace.2283337.n4.nabble.com/DSpace-Security-td4664584.html for a discussion on the DSpace tech mailing list. You apply this procedure at your own risk!
sudo nano /etc/default/tomcat6
See example below.
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the # default of tomcat6. TOMCAT6_USER=root # Run Tomcat as this group ID. Not setting this or leaving it blank will use # the default of tomcat6. TOMCAT6_GROUP=dspace
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
References
- http://en.wikipedia.org/wiki/Environment_variable
- http://wiki.apache.org/tomcat/FAQ/Memory
- http://en.wikipedia.org/wiki/Java_performance#Memory_usage
- http://javaperformancetuning.com
- http://wiki.lib.sun.ac.za/index.php/SUNScholar/Optimisations
- https://wiki.duraspace.org/display/DSDOC3x/Performance+Tuning+DSpace
PREVIOUS
NEXT

