Kaynağa Gözat

improve default configuration

Ralf S. Engelschall 13 yıl önce
ebeveyn
işleme
13d95d48ce
2 değiştirilmiş dosya ile 89 ekleme ve 4 silme
  1. 83 0
      tomcat/tomcat.patch
  2. 6 4
      tomcat/tomcat.spec

+ 83 - 0
tomcat/tomcat.patch

@@ -0,0 +1,83 @@
+Index: conf/server.xml
+--- conf/server.xml.orig	2012-03-31 16:45:11.000000000 +0200
++++ conf/server.xml	2012-04-06 10:38:11.000000000 +0200
+@@ -19,7 +19,7 @@
+      define subcomponents such as "Valves" at this level.
+      Documentation at /docs/config/server.html
+  -->
+-<Server port="8005" shutdown="SHUTDOWN">
++<Server address="127.0.0.1" port="8005" shutdown="SHUTDOWN">
+   <!-- Security listener. Documentation at /docs/config/listeners.html
+   <Listener className="org.apache.catalina.security.SecurityListener" />
+   -->
+@@ -67,13 +67,13 @@
+          APR (HTTP/AJP) Connector: /docs/apr.html
+          Define a non-SSL HTTP/1.1 Connector on port 8080
+     -->
+-    <Connector port="8080" protocol="HTTP/1.1"
++    <Connector address="127.0.0.1" port="8080" protocol="HTTP/1.1"
+                connectionTimeout="20000"
+                redirectPort="8443" />
+     <!-- A "Connector" using the shared thread pool-->
+     <!--
+     <Connector executor="tomcatThreadPool"
+-               port="8080" protocol="HTTP/1.1"
++               address="127.0.0.1" port="8080" protocol="HTTP/1.1"
+                connectionTimeout="20000"
+                redirectPort="8443" />
+     -->
+@@ -82,13 +82,13 @@
+          connector should be using the OpenSSL style configuration
+          described in the APR documentation -->
+     <!--
+-    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
++    <Connector address="127.0.0.1" port="8443" protocol="HTTP/1.1" SSLEnabled="true"
+                maxThreads="150" scheme="https" secure="true"
+                clientAuth="false" sslProtocol="TLS" />
+     -->
+ 
+     <!-- Define an AJP 1.3 Connector on port 8009 -->
+-    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
++    <Connector address="127.0.0.1" port="8009" protocol="AJP/1.3" redirectPort="8443" />
+ 
+ 
+     <!-- An Engine represents the entry point (within Catalina) that processes
+@@ -132,7 +132,7 @@
+         <!-- Access log processes all example.
+              Documentation at: /docs/config/valve.html
+              Note: The pattern used is equivalent to using pattern="common" -->
+-        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
++        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="@l_prefix@/var/tomcat/log"
+                prefix="localhost_access_log." suffix=".txt"
+                pattern="%h %l %u %t &quot;%r&quot; %s %b" />
+ 
+Index: conf/tomcat-users.xml
+--- conf/tomcat-users.xml.orig	2012-03-31 16:45:11.000000000 +0200
++++ conf/tomcat-users.xml	2012-04-06 10:38:21.000000000 +0200
+@@ -16,21 +16,9 @@
+   limitations under the License.
+ -->
+ <tomcat-users>
+-<!--
+-  NOTE:  By default, no user is included in the "manager-gui" role required
+-  to operate the "/manager/html" web application.  If you wish to use this app,
+-  you must define such a user - the username and password are arbitrary.
+--->
+-<!--
+-  NOTE:  The sample user and role entries below are wrapped in a comment
+-  and thus are ignored when reading this file. Do not forget to remove
+-  <!.. ..> that surrounds them.
+--->
+-<!--
+-  <role rolename="tomcat"/>
+-  <role rolename="role1"/>
+-  <user username="tomcat" password="tomcat" roles="tomcat"/>
+-  <user username="both" password="tomcat" roles="tomcat,role1"/>
+-  <user username="role1" password="tomcat" roles="role1"/>
+--->
++  <role rolename="admin-gui"/>
++  <role rolename="admin-script"/>
++  <role rolename="manager-gui"/>
++  <role rolename="manager-script"/>
++  <user username="admin" password="@l_password@" roles="admin-gui,admin-script,manager-gui,manager-script"/>
+ </tomcat-users>

+ 6 - 4
tomcat/tomcat.spec

@@ -32,14 +32,15 @@ Class:        EVAL
 Group:        Web
 License:      Apache Software License 2.0
 Version:      7.0.27
-Release:      20120405
+Release:      20120406
 
 #   list of sources
 Source0:      http://www.apache.org/dist/tomcat/tomcat-7/v%{version}/bin/apache-tomcat-%{version}.tar.gz
 Source1:      rc.tomcat
+Patch0:       tomcat.patch
 
 #   build information
-BuildPreReq:  OpenPKG, openpkg >= 20100101
+BuildPreReq:  OpenPKG, openpkg >= 20100101, apg
 PreReq:       OpenPKG, openpkg >= 20100101, java, JAVA-JDK
 
 %description
@@ -57,6 +58,7 @@ PreReq:       OpenPKG, openpkg >= 20100101, java, JAVA-JDK
 
 %prep
     %setup -q -n apache-tomcat-%{version}
+    %patch -p0
 
 %build
 
@@ -101,8 +103,8 @@ PreReq:       OpenPKG, openpkg >= 20100101, java, JAVA-JDK
         $RPM_BUILD_ROOT%{l_prefix}/libexec/tomcat/work
 
     #   relocate logfile and temporary directory
-    %{l_shtool} subst \
-        -e 's;directory="logs";directory="%{l_prefix}/var/tomcat/log";' \
+    %{l_shtool} subst %{l_value -s -a} \
+        -e "s;@l_password@;`apg -n1 -a0 -m8 -x8`;g" \
         $RPM_BUILD_ROOT%{l_prefix}/etc/tomcat/server.xml
     %{l_shtool} subst \
         -e 's;"$CATALINA_BASE"/temp;%{l_prefix}/var/tomcat/temp;' \