diff --git a/configuration.install b/configuration.install
index 7c3befe..7579afb 100644
--- a/configuration.install
+++ b/configuration.install
@@ -59,3 +59,23 @@ function configuration_schema() {
 
   return $schema;
 }
+
+/**
+ * Implements hook_install().
+ */
+function configuration_install() {
+  $directory = variable_get('configuration_config_path', conf_path() . '/files/config');
+  if (!is_dir($directory) && !drupal_mkdir($directory, NULL, TRUE)) {
+    // If the directory does not exists and cannot be created.
+    drupal_set_message(st('The directory %directory does not exist and could not be created.', array('%directory' => $directory)), 'error');
+    watchdog('file system', 'The directory %directory does not exist and could not be created.', array('%directory' => $directory), WATCHDOG_ERROR);
+  }
+  if (is_dir($directory) && !is_writable($directory) && !drupal_chmod($directory)) {
+    // If the directory is not writable and cannot be made so.
+    drupal_set_message(st('The directory %directory exists but is not writable and could not be made writable.', array('%directory' => $directory)), 'error');
+    watchdog('file system', 'The directory %directory exists but is not writable and could not be made writable.', array('%directory' => $directory), WATCHDOG_ERROR);
+  }
+  elseif (is_dir($directory)) {
+    file_create_htaccess($directory);
+  }
+}
