diff --git a/~dev_rating/deploy.php b/~dev_rating/deploy.php
new file mode 100644
index 0000000000000000000000000000000000000000..bd691ffee9c65058a9da69c1654824366b4d1666
--- /dev/null
+++ b/~dev_rating/deploy.php
@@ -0,0 +1,21 @@
+<?php defined('SYSPATH') OR die('No direct access allowed.');
+
+    if(!is_dir(APPPATH.'config'))
+    {
+        mkdir(APPPATH.'config');
+        if(!copy(CFGPATH.'database.php', APPPATH.'config/database.php'))
+                echo 'Беда!';
+        if(!copy(CFGPATH.'security.php', APPPATH.'config/security.php'))
+                echo 'Беда!';
+        if(!copy(CFGPATH.'twig.php', APPPATH.'config/twig.php'))
+                echo 'Беда!';   
+    }
+    
+    if(!is_dir(APPPATH.'logs/'))
+        mkdir(APPPATH.'logs');
+    
+    if(!is_dir(APPPATH.'cache/'))
+    {
+        mkdir(APPPATH.'cache');
+        mkdir(APPPATH.'cache/twig');
+    }
\ No newline at end of file
diff --git a/~dev_rating/application/config/database.php b/~dev_rating/deployConfig/database.php
similarity index 85%
rename from ~dev_rating/application/config/database.php
rename to ~dev_rating/deployConfig/database.php
index 122322b067ef1e3ef202932f55556c3920fb3270..2636e3a2f99e0f9e14518a3a7c7d8b05da7e0b4d 100644
--- a/~dev_rating/application/config/database.php
+++ b/~dev_rating/deployConfig/database.php
@@ -13,9 +13,9 @@ return array
 			 * string   password    database password
 			 * boolean  persistent  use persistent connections?
 			 */
-			'dsn'        => 'mysql:host=localhost;dbname=kohana_new_db',
-			'username'   => 'root',
-			'password'   => '',
+			'dsn'        => 'mysql:host=localhost;dbname=mmcs_rating',
+			'username'   => 'mmcs_rating',
+			'password'   => 'Pefnesdy',
 			'persistent' => FALSE,
 			 'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')
 		),
diff --git a/~dev_rating/application/config/security.php b/~dev_rating/deployConfig/security.php
similarity index 100%
rename from ~dev_rating/application/config/security.php
rename to ~dev_rating/deployConfig/security.php
diff --git a/~dev_rating/application/config/twig.php b/~dev_rating/deployConfig/twig.php
similarity index 94%
rename from ~dev_rating/application/config/twig.php
rename to ~dev_rating/deployConfig/twig.php
index 7e7ddc2e6b673f7715aab2f65038c7915c0bd90c..3705682b8333792cd15243c60889c5f9ed4ec75b 100644
--- a/~dev_rating/application/config/twig.php
+++ b/~dev_rating/deployConfig/twig.php
@@ -19,7 +19,7 @@ return array(
 		'auto_reload'         => (Kohana::$environment == Kohana::DEVELOPMENT),
 		'autoescape'          => TRUE,
 		'base_template_class' => 'Twig_Template',
-		'cache'               => TWIGPATH.'cache',
+		'cache'               => APPPATH.'cache/twig',
 		'charset'             => 'utf-8',
 		'optimizations'       => -1,
 		'strict_variables'    => FALSE,
diff --git a/~dev_rating/index.php b/~dev_rating/index.php
index 30b21e52dc932485e3ec071da09c15cc717b3a47..82fd3794dcff1df330c5e450a5f17121453bf544 100644
--- a/~dev_rating/index.php
+++ b/~dev_rating/index.php
@@ -23,6 +23,13 @@ $modules = 'modules';
  */
 $system = 'system';
 
+/**
+ * Директория, в которой содержатся конфиги, используемые при деплое.
+ *
+ * @link http://kohanaframework.org/guide/about.install#system
+ */
+$deployConfig = 'deployConfig';
+
 /**
  * The default extension of resource files. If you change this, all resources
  * must be renamed to use the new extension.
@@ -69,13 +76,18 @@ if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
 if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
 	$system = DOCROOT.$system;
 
+// Make the configs relative to the docroot, for symlink'd index.php
+if ( ! is_dir($deployConfig) AND is_dir(DOCROOT.$deployConfig))
+	$deployConfig = DOCROOT.$deployConfig;
+
 // Define the absolute paths for configured directories
 define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
 define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
 define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
+define('CFGPATH', realpath($deployConfig).DIRECTORY_SEPARATOR);
 
 // Clean up the configuration vars
-unset($application, $modules, $system);
+unset($application, $modules, $system, $deployConfig);
 
 if (file_exists('install'.EXT))
 {
@@ -83,6 +95,12 @@ if (file_exists('install'.EXT))
 	return include 'install'.EXT;
 }
 
+if (file_exists('deploy'.EXT))
+{
+	// Load the deploy check
+	include 'deploy'.EXT;
+}
+
 /**
  * Define the start time of the application, used for profiling.
  */
diff --git a/~dev_rating/modules/kotwig/cache/deleteThis.php b/~dev_rating/modules/kotwig/cache/deleteThis.php
deleted file mode 100644
index 3ac00faa65fb817ea29da4755b6c823685234399..0000000000000000000000000000000000000000
--- a/~dev_rating/modules/kotwig/cache/deleteThis.php
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-
-/* 
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-