Index: lib/metacat.properties.metadata.xml
===================================================================
--- lib/metacat.properties.metadata.xml	(revision 7693)
+++ lib/metacat.properties.metadata.xml	(revision 7694)
@@ -295,6 +295,28 @@
 		<helpFile>docs/metacat-properties.html#replication-logdir</helpFile>
 	</config>
 	
+	<config>
+		<key>index.context</key>
+		<label>Index Context</label>
+		<group>3</group>
+		<index>10</index>
+		<description>
+			The context name for the deployed Metacat index webapp.
+		</description>
+		<helpFile>docs/metacat-properties.html#application-index-context</helpFile>
+	</config>
+	
+	<config>
+		<key>solr.homeDir</key>
+		<label>SOLR Home directory</label>
+		<group>3</group>
+		<index>11</index>
+		<description>
+			The directory where replication log should be located.
+		</description>
+		<helpFile>docs/metacat-properties.html#application-solr-home</helpFile>
+	</config>
+	
 	<!-- START Data Manager configuration -->
 	<config>
 		<key>datamanager.server</key>
Index: lib/metacat.properties
===================================================================
--- lib/metacat.properties	(revision 7693)
+++ lib/metacat.properties	(revision 7694)
@@ -583,13 +583,16 @@
 #guid.ezid.doishoulder.3=doi:10.5072/FK2/PISCO/
 #guid.ezid.doishoulder.6=doi:10.5072/FK2/LTER/
 
+############# Index Section ###########################################
+index.context=metacat-index
+
 ############# SOLR Search Section ###########################################
- #Embedded (default):
- solr.server.classname=org.apache.solr.client.solrj.embedded.EmbeddedSolrServer
- solr.homeDir=/var/metacat/solr-home
- solr.configFileName=solr.xml
- solr.collectionName=collection1
+#Embedded (default):
+solr.server.classname=org.apache.solr.client.solrj.embedded.EmbeddedSolrServer
+solr.homeDir=/var/metacat/solr-home
+solr.configFileName=solr.xml
+solr.collectionName=collection1
   
 #HTTP:
- #solr.server.classname=org.apache.solr.client.solrj.impl.CommonsHttpSolrServer
- solr.endpoint=http://localhost:8080/solr/
+#solr.server.classname=org.apache.solr.client.solrj.impl.CommonsHttpSolrServer
+solr.endpoint=http://localhost:8080/solr/
Index: src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java	(revision 7693)
+++ src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java	(revision 7694)
@@ -27,27 +27,21 @@
 package edu.ucsb.nceas.metacat.admin;
 
 import java.io.File;
+import java.io.FileFilter;
 import java.util.Vector;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.AndFileFilter;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.OrFileFilter;
+import org.apache.commons.io.filefilter.WildcardFileFilter;
 import org.apache.log4j.Logger;
-import org.dataone.client.CNode;
-import org.dataone.client.D1Client;
-import org.dataone.client.auth.CertificateManager;
-import org.dataone.service.exceptions.IdentifierNotUnique;
-import org.dataone.service.exceptions.InvalidRequest;
-import org.dataone.service.exceptions.NotAuthorized;
-import org.dataone.service.exceptions.NotImplemented;
-import org.dataone.service.exceptions.ServiceFailure;
-import org.dataone.service.types.v1.Node;
-import org.dataone.service.types.v1.NodeReference;
-import org.dataone.service.types.v1.Session;
 
 import edu.ucsb.nceas.metacat.MetacatVersion;
 import edu.ucsb.nceas.metacat.database.DBVersion;
-import edu.ucsb.nceas.metacat.dataone.MNodeService;
 import edu.ucsb.nceas.metacat.properties.PropertyService;
 import edu.ucsb.nceas.metacat.service.ServiceService;
 import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
@@ -57,7 +51,6 @@
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 import edu.ucsb.nceas.utilities.PropertiesMetaData;
-import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.SortedProperties;
 import edu.ucsb.nceas.utilities.UtilException;
 
@@ -141,6 +134,8 @@
 						externalDir + FileUtil.getFS() + "temporary");
 				PropertyService.setPropertyNoPersist("replication.logdir",
 						externalDir + FileUtil.getFS() + "logs");
+				PropertyService.setPropertyNoPersist("solr.homeDir",
+						externalDir + FileUtil.getFS() + "solr-home");
 
 				PropertyService.persistProperties();
 
@@ -264,6 +259,34 @@
 					validationErrors.add(errorString);
 				}
 				
+				// Try to create and initialize the solr-home directory if necessary.
+				String solrHomePath = PropertyService.getProperty("solr.homeDir");
+				String indexContext = PropertyService.getProperty("index.context");
+				boolean solrHomeExists = new File(solrHomePath).exists();
+				if (!solrHomeExists) {
+					try {
+						FileUtil.createDirectory(solrHomePath);
+						String metacatWebInf = ServiceService.getRealConfigDir();
+						String metacatIndexSolrHome = metacatWebInf + "/../../" + indexContext + "/WEB-INF/classes/solr-home";
+						OrFileFilter fileFilter = new OrFileFilter();
+						fileFilter.addFileFilter(DirectoryFileFilter.DIRECTORY);
+						fileFilter.addFileFilter(new WildcardFileFilter("*"));
+						FileUtils.copyDirectory(new File(metacatIndexSolrHome), new File(solrHomePath), fileFilter );
+					} catch (Exception ue) {	
+						String errorString = "PropertiesAdmin.configureProperties - Could not initialize directory: " + solrHomePath +
+								" : " + ue.getMessage();
+						logMetacat.error(errorString);
+						validationErrors.add(errorString);
+					}
+				} else {
+					// check it
+					if (!FileUtil.isDirectory(solrHomePath)) {
+						String errorString = "PropertiesAdmin.configureProperties - SOLR home is not a directory: " + solrHomePath;
+						logMetacat.error(errorString);
+						validationErrors.add(errorString);
+					}
+				}
+				
 				// write the backup properties to a location outside the 
 				// application directories so they will be available after
 				// the next upgrade
