Skip to content
Browse files

OOZIE-1268 Configuring Oozie to use SSL doesn't work if addtowar.sh i…

…s invoked directly (rkanter)

git-svn-id: https://svn.apache.org/repos/asf/oozie/trunk@1457953 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent c3f4bb9 commit dfb2daf3622f970d14c30959a385644ceadb39c3 @rkanter rkanter committed
View
4 distro/pom.xml
@@ -101,6 +101,10 @@
<copy file="src/main/tomcat/server.xml" toDir="target/tomcat/oozie-server/conf"/>
<copy file="src/main/tomcat/logging.properties"
toDir="target/tomcat/oozie-server/conf"/>
+ <mkdir dir="target/tomcat/oozie-server/conf/ssl"/>
+ <copy file="src/main/tomcat/server.xml" toDir="target/tomcat/oozie-server/conf/ssl"/>
+ <copy file="src/main/tomcat/ssl-server.xml" toDir="target/tomcat/oozie-server/conf/ssl"/>
+ <copy file="src/main/tomcat/ssl-web.xml" toDir="target/tomcat/oozie-server/conf/ssl"/>
<copy todir="target/tomcat/oozie-server/webapps/ROOT">
<fileset dir="src/main/tomcat/ROOT"/>
</copy>
View
46 distro/src/main/bin/addtowar.sh
@@ -132,7 +132,7 @@ function printUsage() {
echo " [-hadoopJarsSNAPSHOT] (if Hadoop jars version on system is SNAPSHOT)"
echo " [-extjs EXTJS_PATH] (expanded or ZIP)"
echo " [-jars JARS_PATH] (multiple JAR path separated by ':')"
- echo " [-secure]"
+ echo " [-secureWeb WEB_XML_PATH] (path to secure web.xml)"
echo
}
@@ -154,8 +154,8 @@ extjsHome=""
jarsPath=""
inputWar=""
outputWar=""
-secure=false
-secureConfigsDir="${OOZIE_CONFIG}/ssl"
+secureWeb=false
+secureWebPath=""
while [ $# -gt 0 ]
do
@@ -224,9 +224,17 @@ do
exit -1
fi
outputWar=$1
- elif [ "$1" = "-secure" ]; then
+ elif [ "$1" = "-secureWeb" ]; then
shift
- secure=true
+ if [ $# -eq 0 ]; then
+ echo
+ echo "Missing option value, secure web.xml path"
+ echo
+ printUsage
+ exit -1
+ fi
+ secureWebPath=$1
+ secureWeb=true
fi
shift
done
@@ -262,15 +270,11 @@ if [ "${addJars}" = "true" ]; then
done
fi
-if [ "${secure}" = "true" ]; then
- checkFileExists ${secureConfigsDir}/ssl-server.xml
- checkFileExists ${secureConfigsDir}/ssl-web.xml
+if [ "${secureWeb}" = "true" ]; then
+ checkFileExists ${secureWebPath}
echo
echo "Using SSL (HTTPS)"
echo
-else
- checkFileExists ${secureConfigsDir}/server.xml
- checkFileExists ${secureConfigsDir}/web.xml
fi
#Unpacking original war
@@ -347,14 +351,10 @@ if [ "${addJars}" = "true" ]; then
done
fi
-if [ "${secure}" = "true" ]; then
+if [ "${secureWeb}" = "true" ]; then
#Inject the SSL version of web.xml in oozie war
- cp ${secureConfigsDir}/ssl-web.xml ${tmpWarDir}/WEB-INF/web.xml
- checkExec "injecting secure web.xml file into staging"
-else
- #Inject the regular version of web.xml in oozie war
- cp ${secureConfigsDir}/web.xml ${tmpWarDir}/WEB-INF/web.xml
- checkExec "injecting regular web.xml file into staging"
+ cp ${secureWebPath} ${tmpWarDir}/WEB-INF/web.xml
+ checkExec "Injecting secure web.xml file into staging"
fi
#Creating new Oozie WAR
@@ -372,15 +372,5 @@ echo
echo "New Oozie WAR file with added '${components}' at ${outputWar}"
echo
-if [ "${secure}" = "true" ]; then
- #Inject the SSL version of server.xml in oozie-server
- cp ${secureConfigsDir}/ssl-server.xml ${secureConfigsDir}/../../oozie-server/conf/server.xml
- checkExec "injecting secure server.xml file into oozie-server"
-else
- #Inject the regular version of server.xml in oozie-server
- cp ${secureConfigsDir}/server.xml ${secureConfigsDir}/../../oozie-server/conf/server.xml
- checkExec "injecting regular server.xml file into oozie-server"
-fi
-
cleanUp
exit 0
View
9 distro/src/main/bin/oozie-setup.sh
@@ -73,6 +73,7 @@ inputWar="${OOZIE_HOME}/oozie.war"
outputWar="${CATALINA_BASE}/webapps/oozie.war"
outputWarExpanded="${CATALINA_BASE}/webapps/oozie"
secure=""
+secureConfigsDir="${CATALINA_BASE}/conf/ssl"
while [ $# -gt 0 ]
do
@@ -205,7 +206,13 @@ else
OPTIONS="${OPTIONS} -hadoop ${hadoopVersion} ${hadoopPath}"
fi
if [ "${secure}" != "" ]; then
- OPTIONS="${OPTIONS} -secure"
+ OPTIONS="${OPTIONS} -secureWeb ${secureConfigsDir}/ssl-web.xml"
+ #Use the SSL version of server.xml in oozie-server
+ cp ${secureConfigsDir}/ssl-server.xml ${CATALINA_BASE}/conf/server.xml
+ echo "INFO: Using secure server.xml"
+ else
+ #Use the regular version of server.xml in oozie-server
+ cp ${secureConfigsDir}/server.xml ${CATALINA_BASE}/conf/server.xml
fi
${OOZIE_HOME}/bin/addtowar.sh -inputwar ${inputWar} -outputwar ${outputWar} ${OPTIONS}
View
0 webapp/src/main/webapp/WEB-INF/ssl-web.xml → distro/src/main/tomcat/ssl-web.xml
File renamed without changes.
View
1 docs/src/site/twiki/AG_Install.twiki
@@ -105,6 +105,7 @@ The =addtowar.sh= script options are:
[-hadoop HADOOP_VERSION HADOOP_PATH]
[-extjs EXTJS_PATH]
[-jars JARS_PATH] (multiple JAR path separated by ':')
+ [-secureWeb WEB_XML_PATH] (path to secure web.xml)
</verbatim>
The original =oozie.war= file is in the Oozie server installation directory.
View
1 release-log.txt
@@ -73,6 +73,7 @@ OOZIE-944 Implement Workflow Generator UI Tool (egashira via virag)
-- Oozie 3.3.2 (unreleased)
+OOZIE-1268 Configuring Oozie to use SSL doesn't work if addtowar.sh is invoked directly (rkanter)
OOZIE-1208 Oozie web-console when displaying Coord Job Log for an action gives Format Error (rohini via mona)
OOZIE-1233 Add ability to configure Oozie to use HTTPS (SSL) (rkanter)
OOZIE-1242 Dryrun option for workflows mentions version 3.4 when it should be 3.3.2 (rkanter)
View
18 src/main/assemblies/distro.xml
@@ -165,23 +165,5 @@
<outputDirectory>/</outputDirectory>
<fileMode>0444</fileMode>
</file>
- <!-- Oozie SSL (HTTPS) server.xml -->
- <file>
- <source>${basedir}/../distro/src/main/tomcat/ssl-server.xml</source>
- <outputDirectory>/conf/ssl</outputDirectory>
- </file>
- <file>
- <source>${basedir}/../distro/src/main/tomcat/server.xml</source>
- <outputDirectory>/conf/ssl</outputDirectory>
- </file>
- <!-- Oozie SSL (HTTPS) web.xml -->
- <file>
- <source>${basedir}/../webapp/src/main/webapp/WEB-INF/ssl-web.xml</source>
- <outputDirectory>/conf/ssl</outputDirectory>
- </file>
- <file>
- <source>${basedir}/../webapp/src/main/webapp/WEB-INF/web.xml</source>
- <outputDirectory>/conf/ssl</outputDirectory>
- </file>
</files>
</assembly>

0 comments on commit dfb2daf

Please sign in to comment.
Something went wrong with that request. Please try again.