Index: src/main/java/org/wso2/esb/ServiceBusConfiguration.java
===================================================================
--- src/main/java/org/wso2/esb/ServiceBusConfiguration.java	(revision 20007)
+++ src/main/java/org/wso2/esb/ServiceBusConfiguration.java	(working copy)
@@ -34,12 +34,12 @@
 public class ServiceBusConfiguration {
 
     private static Log log = LogFactory.getLog(ServiceBusConfiguration.class);
-    private final static String DEF_LOCATION = ServiceBusConstants.ESB_CONF_DIRECTORY  + "server.xml";
 
     private static ServiceBusConfiguration configuration = null;
+    private String esbHome = System.getProperty(ServiceBusConstants.ESB_HOME, ".");
+    private String esbConfigDir = "";
     private ServerConfiguration serverConfiguration = null;
 
-    private String esbHome = null;
     private String serverXml = null;
     private String synapseXml = null;
     private String axis2Xml = null;
@@ -49,7 +49,9 @@
     private String jmxAgentName = ServiceBusConstants.DEFAULT_JMX_AGENT_NAME;
     private int rmiPort = 1099;
 
-    private ServiceBusConfiguration() {}
+    private ServiceBusConfiguration() {
+        init();
+    }
 
     public static ServiceBusConfiguration getInstance() {
         if (configuration == null) {
@@ -58,26 +60,34 @@
         return configuration;
     }
 
+    private void init() {
+        
+        if (System.getProperty(ServiceBusConstants.ESB_CONF_DIR) != null) {
+            File configDir = new File(System.getProperty(ServiceBusConstants.ESB_CONF_DIR));
+            if (!configDir.isAbsolute()) {
+                esbConfigDir = configDir.getAbsolutePath();
+            } else {
+                esbConfigDir = System.getProperty(ServiceBusConstants.ESB_CONF_DIR);
+            }
+            if (!esbConfigDir.endsWith(File.separator)) {
+                esbConfigDir = esbConfigDir + File.separator;
+            }
+        } else {
+            esbConfigDir = esbHome + File.separator + ServiceBusConstants.WEBAPP_CONF_DIR;
+        }
+    }
+
     /**
-     * Load the server XML, requires the esbHome to be valid
+     * Load the server XML
      */
     private void loadServerXML() {
-        if (esbHome == null) {
-            if (System.getProperty(ServiceBusConstants.ESB_HOME) == null) {
-                esbHome = ".";
-            } else {
-                esbHome = System.getProperty(ServiceBusConstants.ESB_HOME);
-            }
-        }
-        String path = esbHome + File.separator + DEF_LOCATION;
-        log.info("Configuration loading from : " + path);
+        
+        log.info("Configuration loading from : " + getServerXml());
         try {
             serverConfiguration = ServerConfiguration.getInstance();
-            serverConfiguration.init(path);
-
-
+            serverConfiguration.init(getServerXml());
         } catch (ServerConfigurationException e) {
-            log.error("Error initalizing ServiceBusConfiguration using : " + DEF_LOCATION);
+            log.error("Error initalizing ServiceBusConfiguration using : " + getServerXml());
         }
     }
 
@@ -213,4 +223,8 @@
     public void setServerName(String serverName) {
         this.serverName = serverName;
     }
+
+    public String getEsbConfigDir() {
+        return esbConfigDir;
+    }
 }
Index: src/main/java/org/wso2/esb/ServiceBusConstants.java
===================================================================
--- src/main/java/org/wso2/esb/ServiceBusConstants.java	(revision 20007)
+++ src/main/java/org/wso2/esb/ServiceBusConstants.java	(working copy)
@@ -68,8 +68,10 @@
     public static final String AXIS2_REPO = "axis2.repo";
     public static final String ESB_SERVER_WEB_XML = "server-web.xml";
     public static final String UI_EXTENSIONS_CONFIG_XML = "conf/ui-extensions-config.xml";
-    public static final String HIBERNATE_CFG_XML = "conf/wso2esb.hibernate.cfg.xml";
-    public static final String ESB_CONF_DIRECTORY = "webapp" + File.separator + "WEB-INF" + File.separator + "classes" + File.separator + "conf" + File.separator;
+    public static final String HIBERNATE_CFG_XML = "wso2esb.hibernate.cfg.xml";
+    public static final String ESB_CONF_DIR = "esb.config.dir";
+    public static final String WEBAPP_CONF_DIR = "webapp" + File.separator + "WEB-INF" + File.separator + "classes"
+        + File.separator + "conf" + File.separator;
     public static final String JMX_AGENT_NAME = "jmx.agent.name";
     public static final String DEFAULT_JMX_AGENT_NAME = "org.wso2.esb";
 
Index: src/main/java/org/wso2/esb/ServiceBusManager.java
===================================================================
--- src/main/java/org/wso2/esb/ServiceBusManager.java	(revision 20007)
+++ src/main/java/org/wso2/esb/ServiceBusManager.java	(working copy)
@@ -130,12 +130,12 @@
         // initialize log4j
         URL log4jURL = null;
         try {
-            log4jURL = new URL("file:" + sbc.getEsbHome() + File.separator
-                + ServiceBusConstants.ESB_CONF_DIRECTORY + ServiceBusConstants.LOG4J_PROPS);
+            log4jURL = new URL("file:" + sbc.getEsbConfigDir() + ServiceBusConstants.LOG4J_PROPS);
             PropertyConfigurator.configure(log4jURL);
         } catch (MalformedURLException ignore) {
             System.out.println("Log4J configuration initialization failure. Using : " + log4jURL);
         }
+        
 
         // register a JVM shutdown hook
         Thread shutdownHook = new Thread() {
Index: src/main/java/org/wso2/esb/services/LogAdmin.java
===================================================================
--- src/main/java/org/wso2/esb/services/LogAdmin.java	(revision 20007)
+++ src/main/java/org/wso2/esb/services/LogAdmin.java	(working copy)
@@ -55,7 +55,6 @@
         loggerMap.put(LOGGER_SERVICE_ID, LOGGER_SERVICE_NAME);
         loggerMap.put(LOGGER_TRACE_ID, LOGGER_TRACE_NAME);
     }
-
     
     /**
      * Get log4j.properties, logger levels
@@ -181,8 +180,7 @@
      * @return
      */
     private String getLogConfigLocation() {
-        return ServiceBusConfiguration.getInstance().getEsbHome() + File.separator
-            + ServiceBusConstants.ESB_CONF_DIRECTORY + ServiceBusConstants.LOG4J_PROPS;
+        return ServiceBusConfiguration.getInstance().getEsbConfigDir() + ServiceBusConstants.LOG4J_PROPS;
     }
 
    
Index: src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java
===================================================================
--- src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java	(revision 20007)
+++ src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java	(working copy)
@@ -34,6 +34,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -45,6 +46,9 @@
 
     private static Log log = LogFactory.getLog(StartUpServlet.class);
     private final static String INITIALIZED = "INITIALIZED";
+    
+    private ServiceBusConfiguration sbc = null;
+    private Map<String, String> customConfigLocations = new HashMap();
 
     public void init() throws ServletException {
         super.init();
@@ -57,17 +61,25 @@
             return;
         }
 
-        // get ServiceBusConfiguration and initialize it using system properties + init parameters
-        ServiceBusConfiguration sbc = ServiceBusConfiguration.getInstance();
+     // get ServiceBusConfiguration and initialize it using system properties + init parameters
+        sbc = ServiceBusConfiguration.getInstance();
 
         sbc.setEsbHome(loadParameter(servletConfig, ServiceBusConstants.ESB_HOME));
-        sbc.setServerXml(loadParameter(servletConfig, ServiceBusConstants.SERVER_XML));
-        sbc.setSynapseXml(loadParameter(servletConfig, ServiceBusConstants.SYNAPSE_XML));
+        sbc.setAxis2Repo(loadParameter(servletConfig, ServiceBusConstants.AXIS2_REPO));
         sbc.setResolveRoot(loadParameter(servletConfig, ServiceBusConstants.RESOLVE_ROOT));
-        sbc.setAxis2Repo(loadParameter(servletConfig, ServiceBusConstants.AXIS2_REPO));
-        sbc.setAxis2Xml(loadParameter(servletConfig, ServiceBusConstants.AXIS2_XML));
         sbc.setServerName(loadParameter(servletConfig, ServiceBusConstants.SERVER_NAME, true));
         
+        // if custom config directory specified, set custom locations
+        if (System.getProperty(ServiceBusConstants.ESB_CONF_DIR) != null) {
+            customConfigLocations.put(ServiceBusConstants.AXIS2_XML, sbc.getEsbConfigDir() + ServiceBusConstants.AXIS2_XML);
+            customConfigLocations.put(ServiceBusConstants.SERVER_XML, sbc.getEsbConfigDir() + ServiceBusConstants.SERVER_XML);
+            customConfigLocations.put(ServiceBusConstants.SYNAPSE_XML, sbc.getEsbConfigDir() + ServiceBusConstants.SYNAPSE_XML);
+        }
+             
+        sbc.setAxis2Xml(loadParameter(servletConfig, ServiceBusConstants.AXIS2_XML));
+        sbc.setServerXml(loadParameter(servletConfig, ServiceBusConstants.SERVER_XML));
+        sbc.setSynapseXml(loadParameter(servletConfig, ServiceBusConstants.SYNAPSE_XML));
+        
         ServiceBusManager serviceBusManager = ServiceBusManager.getInstance();
         try {
             serviceBusManager.start();
@@ -119,22 +131,26 @@
     }
 
     private String loadParameter(ServletConfig servletConfig, String name, boolean optional)
-        throws ServletException {
+    throws ServletException {
 
-        if (System.getProperty(name) == null) {
-
-            String value = servletConfig.getInitParameter(name);
-            log.debug("Init parameter '" + name + "' : " + value);
-
-            if (value == null || value.trim().length() == 0) {
-                if (!optional) {
-                    handleException("A valid system property or init parameter '" + name + "' is required");
-                }
+        // System Properties have precedence over any other config
+        if (System.getProperty(name) != null) {
+            return System.getProperty(name);
+        } else {
+            // prefer custom config locations over init parameters
+            String value = customConfigLocations.get(name);
+            
+            // use init parameter only, if no custom config location are specified
+            if (value == null) {
+                value = servletConfig.getInitParameter(name);
+                log.debug("Init parameter '" + name + "' : " + value);
+            }
+            
+            if ((value == null || value.trim().length() == 0) && !optional) {
+                handleException("A valid system property or init parameter '" + name + "' is required");
             } else {
                 return value;
             }
-        } else {
-            return System.getProperty(name);
         }
         return null;
     }
