forked from subbuss/newsrack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SETUP.NOTES
57 lines (48 loc) · 2.22 KB
/
SETUP.NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
1. edit /etc/init.d/tomcat6 and change
- umask to 002
# -- sample commands --
sudo chown -R tomcat6:nogroup /var/lib/tomcat6/webapps
sudo chown -R tomcat6:nogroup /var/log/tomcat6
sudo chmod 777 /var/lib/tomcat6/webapps
sudo chmod 775 /var/log/tomcat6
cd /var/log/tomcat6/
2. edit /etc/default/tomcat6 and change
- jvm path, if necessary
- add TOMCAT5_GROUP=tomcat6
- disable tomcat6 security
- edit jvm options to add heap sizes, server vm, gc settings
3. for enabling access logs, edit server.xml and uncomment FastCommonAccessLogValve
and set log format to combined
4. for mod_jk,
- edit /etc/libapache2-mod-jk/workers.properties
and change tomcat_home and java_home for our installation.
- IMPORTANT: add socket_timeout for the works to ensure that sockets
get closed promptly!
worker.ajp13_worker.socket_timeout=5
EITHER:
- set up newsrack.in.conf and mod-jk.conf in /etc/apache2/conf.d
- edit newsrack.in.conf and make sure the ip address is correct
OR:
- Set up newsrack.in in /sites.available and link in /sites.enabled,
can set virtualhosts * rather than for a specific ip addr
- Make sure that default site is not enabled in /sites.enabled
5. make sure permissions for files in data/users/ and data/news.archive/ are
set to g+w and that ownership is tomcat6:nogroup
6. Edit /etc/security/limits.conf and double nofile limit for newsrack
from 1024 to 2048 -- to give me breathing space while I figure out
how to get tomcat/mod_jk to co-operate and not leave lots of sockets
in CLOSE_WAIT state -- this will also let me increase the number of
download threads without running out of available file descriptors
Add the following:
---------
## SSS: Doubling the number of open descriptors -- mod_jk / tomcat seem to have
## bug wherein they take a while before they close sockets -- they end up in
## CLOSE_WAIT state for a long time, and when there is a lot of available memory
## number of threads downloading feeds is high, this quickly leads to the
## "Too many open files" error because 1024 fds are reached!
ubuntu soft nofile 2048
ubuntu hard nofile 2048
---------
TIPS:
1. Use sudo lsof -p <jsvc.process.id> to the list of open files!
2. Use sudo netstat to see the state of sockets