@cryptotaxi247 / infra / commits / f9332e62

Backup of current version

svn path=/configurations/trunk/tud/; revision=32113

Sander van der Burg committed Feb 7, 2012 at 13:36 UTC f9332e622e7dfeb4b9f4619d935cf1082a8bdb6a
1 file changed +126 -9
webdsl.nix
+126 -9
@@ -7,7 +7,14 @@ let
7 sha256 = "1q66x429wpqjqcmlsi3x37rkn95i55nj8ldzcrblnx6a0jnjgd2g";
8 rev = 94;
9 };
10 -
10 +
11 + aselect = import ./aselect {
12 + inherit (pkgs) stdenv apacheHttpd libtool;
13 + };
14 +
15 + feedback = import ./aselect/feedback.nix {
16 + inherit (pkgs) stdenv;
17 + };
18 in
19
20 {
@@ -27,6 +34,26 @@ in
34 }
35 ];
36
37 + jobs.aselect = {
38 + name = "aselect";
39 +
40 + startOn = "started httpd";
41 +
42 + preStart = ''
43 + if [ ! -d /var/lib/aselect ]
44 + then
45 + mkdir -p /var/lib/aselect/log/aselectagent/system
46 + cp -a ${aselect}/work /var/lib/aselect
47 + chmod -R u+rw /var/lib/aselect
48 + cp ${feedback}/* /var/lib/aselect/work/aselectagent
49 + fi
50 + '';
51 +
52 + preStop = "${pkgs.jdk}/bin/java -classpath \"${aselect}/bin/aselectagent/\" StopAgent";
53 +
54 + exec = "${pkgs.jdk}/bin/java -Duser.dir=\"/var/lib/aselect/work/aselectagent\" -server -jar \"${aselect}/bin/aselectagent/org.aselect.agent.jar\"";
55 + };
56 +
57 services.ttyBackgrounds.enable = false;
58
59 services.zabbixAgent.extraConfig = ''
@@ -35,6 +62,8 @@ in
62 UserParameter=mysql_qps,${pkgs.mysql}/bin/mysqladmin -uroot status|cut -f9 -d":"
63 UserParameter=hydra.queue.total,${pkgs.postgresql}/bin/psql hydra -At -c 'select count(*) from builds where finished = 0'
64 UserParameter=hydra.queue.building,${pkgs.postgresql}/bin/psql hydra -At -c 'select count(*) from builds natural join BuildSchedulingInfo where finished = 0 and busy = 1'
65 + UserParameter=hydra.queue.buildsteps,${pkgs.postgresql}/bin/psql hydra -At -c 'select count(*) from BuildSteps s join BuildSchedulingInfo i on s.build = i.id where i.busy = 1 and s.busy = 1'
66 + UserParameter=hydra.builds,${pkgs.postgresql}/bin/psql hydra -At -c 'select count(*) from Builds'
67 '';
68
69 services.systemhealth = {
@@ -76,12 +105,12 @@ in
105 };
106
107 services.postgresqlBackup = {
79 - enable = true;
80 - databases = [ "hydra" ];
108 + enable = true;
109 + databases = [ "hydra" "jira" "mediawiki" ];
110 };
111
112 services.syslogd.extraConfig = ''
84 - local0.* -/var/log/pgsql
113 + local0.* -/var/log/pgsql
114 '';
115
116 services.postgresql = {
@@ -89,9 +118,10 @@ in
118 enableTCPIP = true;
119 dataDir = "/data/postgresql";
120 extraConfig = ''
92 - log_min_duration_statement = 200
121 + log_min_duration_statement = 1000
122 log_duration = off
123 log_statement = 'none'
124 + max_connections = 250
125 '';
126 authentication = ''
127 local all mediawiki ident mediawiki-users
@@ -119,25 +149,108 @@ in
149 Order deny,allow
150 Deny from all
151 </Location>
152 +
153 ExtendedStatus On
154 +
155 + <IfModule mod_aselect_filter.c>
156 +
157 + # The location of the error template
158 + aselect_filter_set_html_error_template "${aselect}/apachefilter/conf/error_template.html"
159 +
160 + # A-Select Agent IP and port
161 + aselect_filter_set_agent_address "127.0.0.1"
162 + aselect_filter_set_agent_port "1495"
163 +
164 + # Applications to protect
165 + aselect_filter_add_secure_app "/evaluaties" "tudfeedb39de56" "default"
166 + aselect_filter_add_secure_app "/weblab" "tudfeedb39de56" "default"
167 + # Global options
168 + aselect_filter_set_use_aselect_bar "0"
169 + aselect_filter_set_redirect_mode "full"
170 +
171 + # Authorization
172 + #aselect_filter_add_authz_rule "app1" "*" "ip=127.0.0.1"
173 +
174 + </IfModule>
175 +
176 '';
177
178 extraSubservices = [
179 { serviceType = "tomcat-connector";
180 inherit logDir ;
181 stateDir = "/var/run/httpd";
182 + extraWorkersProperties = ''
183 + worker.list=loadbalancer,loadbalancer2,status
184 +
185 + # modify the host as your host IP or DNS name.
186 + worker.node2.port=8010
187 + worker.node2.host=localhost
188 + worker.node2.type=ajp13
189 + worker.node2.lbfactor=1
190 +
191 + # Load-balancing behaviour
192 + worker.loadbalancer2.type=lb
193 + worker.loadbalancer2.balance_workers=node2
194 + '';
195 }
196 ];
197 +
198 + extraModules = [
199 + { name = "aselect_filter"; path = "${aselect}/modules/mod_aselect_filter.so"; }
200 + ];
201 +
202 +
203 + virtualHosts = [
204 +
205 +
206 + { hostName = "webdsl.org";
207 + extraConfig = ''
208 +JkMount /* loadbalancer
209 + '';
210 + }
211 +
212 + { hostName = "researchr.org";
213 + extraConfig = ''
214 +JkMount /* loadbalancer2
215 + '';
216 + }
217 +
218 + { hostName = "department.st.ewi.tudelft.nl";
219 + enableSSL = true;
220 + sslServerCert = "/root/server.crt";
221 + sslServerKey = "/root/server.key.insecure";
222 + extraConfig = ''
223 +JkMount /* loadbalancer
224 + '';
225 + }
226 +
227 + /*{ hostName = "department.st.ewi.tudelft.nl"; }
228 +
229 + { hostName = "tweetview.net"; }
230 + { hostName = "pil-lang.org"; }
231 + { hostName = "department.st.ewi.tudelft.nl"; }
232 + { hostName = "phaedrus.webdsl.org"; }
233 + { hostName = "book.webdsl.org"; }
234 + { hostName = "yellowgrass.org"; }
235 + { hostName = "www.yellowgrass.org"; }
236 + { hostName = "eelcovisser.org"; }
237 + { hostName = "dsl-engineering.org"; }*/
238 + ];
239 };
240
241 + services.xserver.enable = true;
242 + jobs.tomcat.environment.DISPLAY = ":0.0";
243 + jobs.tomcat.path = [ pkgs.wkhtmltopdf ];
244 +
245 services.tomcat = {
246 enable = true;
247 baseDir = "/data/tomcat";
136 - javaOpts = "-Dshare.dir=/nix/var/nix/profiles/default/share -Xms350m -Xss8m -Xmx4096m -XX:MaxPermSize=512M -XX:PermSize=512M -XX:-UseGCOverheadLimit -XX:+UseCompressedOops "
248 + javaOpts = "-Dshare.dir=/nix/var/nix/profiles/default/share -Xms350m -Xss8m -Xmx8G -Djava.security.egd=file:/dev/./urandom -XX:MaxPermSize=512M -XX:PermSize=512M -XX:-UseGCOverheadLimit -XX:+UseCompressedOops "
249 + "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=localhost "
138 - + "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/tomcat/logs/java_pid<pid>.hprof";
250 + + "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/tomcat/logs/java_pid<pid>.hprof -Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE=true";
251 logPerVirtualHost = true;
252 virtualHosts = [
253 + { name = "examinr.org";}
254 { name = "researchr.org";}
255 { name = "webdsl.org"; }
256 { name = "tweetview.net"; }
@@ -157,6 +270,8 @@ in
270 user = "root";
271 databases = [ "researchr" "twitterarchive" "webdslorg" "pilweb" "mysql" "yellowgrass" "department" ];
272 singleTransaction = true;
273 + split = true;
274 + extraArgs = "--ignore-table=researchr._SecurityContext --ignore-table=researchr.RequestLogEntry_params_RequestLogEntryParam --ignore-table=researchr._RequestLogEntry --ignore-table=researchr._RequestLogEntryParam --ignore-table=researchr._RequestLogEntry --ignore-table=researchr._RequestLogEntryParam --ignore-table=researchr.RequestLogEntry_params_RequestLogEntryParam";
275 };
276
277 users = {
@@ -234,7 +349,9 @@ in
349 defaultGateway = "130.161.158.1";
350 hostName = "webdsl";
351 domain = "st.ewi.tudelft.nl";
237 - extraHosts = "127.0.0.2 webdsl.st.ewi.tudelft.nl webdsl";
352 + extraHosts = "127.0.0.2 webdsl.st.ewi.tudelft.nl webdsl researchr.org department.st.ewi.tudelft.nl "+
353 + "webdsl.org tweetview.net pil-lang.org phaedrus.webdsl.org book.webdsl.org "+
354 + "yellowgrass.org www.yellowgrass.org eelcovisser.org dsl-engineering.org";
355
356 interfaces = [ { ipAddress = "130.161.159.114"; name = "eth0"; subnetMask = "255.255.254.0"; } ];
357 nameservers = [ "130.161.180.1" "130.161.180.65" ];
@@ -249,5 +366,5 @@ in
366
367 };
368
252 - environment.systemPackages = [ pkgs.stdenv pkgs.lsiutil ] ++ (with pkgs.strategoPackages018; [ aterm sdf strategoxt ]) ;
369 + environment.systemPackages = [ pkgs.stdenv /*pkgs.lsiutil*/ ] ++ (with pkgs.strategoPackages018; [ aterm sdf strategoxt ]) ;
370 }