Browse Source

Match tomcat version to solr

The package solr installs and uses tomcat7.  Installing tomcat8 appears
to be a mistake for Debian Jessie.
Mike Ashley 8 years ago
parent
commit
ae6d97a4b6

roles/mailserver/files/etc_tomcat8_server.xml → roles/mailserver/files/etc_tomcat7_server.xml View File

20
      Documentation at /docs/config/server.html
20
      Documentation at /docs/config/server.html
21
  -->
21
  -->
22
 <Server port="8005" shutdown="SHUTDOWN">
22
 <Server port="8005" shutdown="SHUTDOWN">
23
-
23
+  <!-- Security listener. Documentation at /docs/config/listeners.html
24
+  <Listener className="org.apache.catalina.security.SecurityListener" />
25
+  -->
24
   <!--APR library loader. Documentation at /docs/apr.html -->
26
   <!--APR library loader. Documentation at /docs/apr.html -->
25
   <!--
27
   <!--
26
   <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
28
   <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
29
   <Listener className="org.apache.catalina.core.JasperListener" />
31
   <Listener className="org.apache.catalina.core.JasperListener" />
30
   <!-- Prevent memory leaks due to use of particular java/javax APIs-->
32
   <!-- Prevent memory leaks due to use of particular java/javax APIs-->
31
   <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
33
   <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
32
-  <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
33
-  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
34
   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
34
   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
35
+  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
35
 
36
 
36
   <!-- Global JNDI resources
37
   <!-- Global JNDI resources
37
        Documentation at /docs/jndi-resources-howto.html
38
        Documentation at /docs/jndi-resources-howto.html
68
          APR (HTTP/AJP) Connector: /docs/apr.html
69
          APR (HTTP/AJP) Connector: /docs/apr.html
69
          Define a non-SSL HTTP/1.1 Connector on port 8080
70
          Define a non-SSL HTTP/1.1 Connector on port 8080
70
     -->
71
     -->
71
-    <Connector address="127.0.0.1" port="8080" protocol="HTTP/1.1"
72
+    <Connector port="8080" protocol="HTTP/1.1"
72
                connectionTimeout="20000"
73
                connectionTimeout="20000"
73
                URIEncoding="UTF-8"
74
                URIEncoding="UTF-8"
74
                redirectPort="8443" />
75
                redirectPort="8443" />
80
                redirectPort="8443" />
81
                redirectPort="8443" />
81
     -->
82
     -->
82
     <!-- Define a SSL HTTP/1.1 Connector on port 8443
83
     <!-- Define a SSL HTTP/1.1 Connector on port 8443
83
-         This connector uses the JSSE configuration, when using APR, the
84
-         connector should be using the OpenSSL style configuration
85
-         described in the APR documentation -->
84
+         This connector uses the BIO implementation that requires the JSSE
85
+         style configuration. When using the APR/native implementation, the
86
+         OpenSSL style configuration is required as described in the APR/native
87
+         documentation -->
86
     <!--
88
     <!--
87
-    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
88
-               maxThreads="150" scheme="https" secure="true"
89
+    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
90
+               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
89
                clientAuth="false" sslProtocol="TLS" />
91
                clientAuth="false" sslProtocol="TLS" />
90
     -->
92
     -->
91
 
93
 
113
       <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
115
       <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
114
       -->
116
       -->
115
 
117
 
116
-      <!-- The request dumper valve dumps useful debugging information about
117
-           the request and response data received and sent by Tomcat.
118
-           Documentation at: /docs/config/valve.html -->
119
-      <!--
120
-      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
121
-      -->
122
-
123
-      <!-- This Realm uses the UserDatabase configured in the global JNDI
124
-           resources under the key "UserDatabase".  Any edits
125
-           that are performed against this UserDatabase are immediately
126
-           available for use by the Realm.  -->
127
-      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
128
-             resourceName="UserDatabase"/>
118
+      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
119
+           via a brute-force attack -->
120
+      <Realm className="org.apache.catalina.realm.LockOutRealm">
121
+        <!-- This Realm uses the UserDatabase configured in the global JNDI
122
+             resources under the key "UserDatabase".  Any edits
123
+             that are performed against this UserDatabase are immediately
124
+             available for use by the Realm.  -->
125
+        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
126
+               resourceName="UserDatabase"/>
127
+      </Realm>
129
 
128
 
130
-      <!-- Define the default virtual host
131
-           Note: XML Schema validation will not work with Xerces 2.2.
132
-       -->
133
       <Host name="localhost"  appBase="webapps"
129
       <Host name="localhost"  appBase="webapps"
134
-            unpackWARs="true" autoDeploy="true"
135
-            xmlValidation="false" xmlNamespaceAware="false">
130
+            unpackWARs="true" autoDeploy="true">
136
 
131
 
137
         <!-- SingleSignOn valve, share authentication between web applications
132
         <!-- SingleSignOn valve, share authentication between web applications
138
              Documentation at: /docs/config/valve.html -->
133
              Documentation at: /docs/config/valve.html -->
141
         -->
136
         -->
142
 
137
 
143
         <!-- Access log processes all example.
138
         <!-- Access log processes all example.
144
-             Documentation at: /docs/config/valve.html -->
145
-        <!--
139
+             Documentation at: /docs/config/valve.html
140
+             Note: The pattern used is equivalent to using pattern="common" -->
146
         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
141
         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
147
-               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
148
-        -->
142
+               prefix="localhost_access_log." suffix=".txt"
143
+               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
149
 
144
 
150
       </Host>
145
       </Host>
151
     </Engine>
146
     </Engine>

+ 1
- 1
roles/mailserver/handlers/main.yml View File

8
   service: name=opendkim state=restarted
8
   service: name=opendkim state=restarted
9
 
9
 
10
 - name: restart solr
10
 - name: restart solr
11
-  service: name=tomcat8 state=restarted
11
+  service: name=tomcat7 state=restarted
12
 
12
 
13
 - name: import sql postfix
13
 - name: import sql postfix
14
   action: shell PGPASSWORD='{{ mail_db_password }}' psql -h localhost -d {{ mail_db_database }} -U {{ mail_db_username }} -f /etc/postfix/import.sql --set ON_ERROR_STOP=1
14
   action: shell PGPASSWORD='{{ mail_db_password }}' psql -h localhost -d {{ mail_db_database }} -U {{ mail_db_username }} -f /etc/postfix/import.sql --set ON_ERROR_STOP=1

+ 2
- 3
roles/mailserver/tasks/solr.yml View File

2
   apt: pkg={{ item }} state=installed
2
   apt: pkg={{ item }} state=installed
3
   with_items:
3
   with_items:
4
     - dovecot-solr
4
     - dovecot-solr
5
-    - tomcat8
6
     - solr-tomcat
5
     - solr-tomcat
7
   tags:
6
   tags:
8
     - dependencies
7
     - dependencies
11
   copy: src=solr-schema.xml dest=/etc/solr/conf/schema.xml group=root owner=root
10
   copy: src=solr-schema.xml dest=/etc/solr/conf/schema.xml group=root owner=root
12
 
11
 
13
 - name: Copy tweaked Tomcat config file into place
12
 - name: Copy tweaked Tomcat config file into place
14
-  copy: src=etc_tomcat8_server.xml dest=/etc/tomcat8/server.xml group=tomcat8 owner=root
13
+  copy: src=etc_tomcat7_server.xml dest=/etc/tomcat7/server.xml group=tomcat7 owner=root
15
   notify: restart solr
14
   notify: restart solr
16
 
15
 
17
 - name: Copy tweaked Solr config file into place
16
 - name: Copy tweaked Solr config file into place
19
   notify: restart solr
18
   notify: restart solr
20
 
19
 
21
 - name: Create Solr index directory
20
 - name: Create Solr index directory
22
-  file: state=directory path=/decrypted/solr group=tomcat8 owner=tomcat8
21
+  file: state=directory path=/decrypted/solr group=tomcat7 owner=tomcat7
23
   notify: restart solr
22
   notify: restart solr

+ 3
- 3
roles/monitoring/files/etc_monit_conf.d_tomcat View File

1
-check process tomcat with pidfile "/var/run/tomcat8.pid"
1
+check process tomcat with pidfile "/var/run/tomcat7.pid"
2
   group mail
2
   group mail
3
-  start program = "systemctl start tomcat8"
4
-  stop program = "systemctl stop tomcat8"
3
+  start program = "systemctl start tomcat7"
4
+  stop program = "systemctl stop tomcat7"
5
   if failed port 8080 then alert
5
   if failed port 8080 then alert
6
   if failed port 8080 for 5 cycles then restart
6
   if failed port 8080 for 5 cycles then restart

Loading…
Cancel
Save