diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 346b62b9abe3d4c84fbe94715a0d4cb0a9fdbae7..e5ac1428d8f7cc817c6a36f3f274c020b4ed7af3 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -2478,24 +2478,13 @@ class installer_base {
 		//* copy the ISPConfig security part
 		$command = 'cp -rf ../security '.$install_dir;
 		caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
-		
-		//* Apply changed security_settings.ini values to new security_settings.ini file
-		if(is_file('/usr/local/ispconfig/security/security_settings.ini~')) {
-			$security_settings_old = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini~'));
-			$security_settings_new = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini'));
-			if(is_array($security_settings_new) && is_array($security_settings_old)) {
-				foreach($security_settings_new as $section => $sval) {
-					if(is_array($sval)) {
-						foreach($sval as $key => $val) {
-							if(isset($security_settings_old[$section]) && isset($security_settings_old[$section][$key])) {
-								$security_settings_new[$section][$key] = $security_settings_old[$section][$key];
-							}
-						}
-					}
-				}
-				file_put_contents('/usr/local/ispconfig/security/security_settings.ini',array_to_ini($security_settings_new));
-			}
+	
+		$configfile = 'security_settings.ini';
+		if(is_file($install_dir.'/security/'.$configfile)) {
+			copy($install_dir.'/security/'.$configfile, $install_dir.'/security/'.$configfile.'~');
 		}
+		$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
+		wf($install_dir.'/security/'.$configfile, $content);	
 
 		//* Create a symlink, so ISPConfig is accessible via web
 		// Replaced by a separate vhost definition for port 8080
diff --git a/security/security_settings.ini b/install/tpl/security_settings.ini.master
similarity index 100%
rename from security/security_settings.ini
rename to install/tpl/security_settings.ini.master
diff --git a/interface/lib/classes/listform_actions.inc.php b/interface/lib/classes/listform_actions.inc.php
index e0ffb628ee8adad78aaba3cd35747f6e19c09976..86eebd3d6465922cca3f236e2dd5123209674b80 100644
--- a/interface/lib/classes/listform_actions.inc.php
+++ b/interface/lib/classes/listform_actions.inc.php
@@ -189,6 +189,7 @@ class listform_actions {
 		//* substitute value for select fields
 		if(is_array($app->listform->listDef['item']) && count($app->listform->listDef['item']) > 0) {
 			foreach($app->listform->listDef['item'] as $field) {
+				if($rec['active'] == 'n') $rec['warn_inactive'] = 'y';
 				$key = $field['field'];
 				if(isset($field['formtype']) && $field['formtype'] == 'SELECT') {
 					if(strtolower($rec[$key]) == 'y' or strtolower($rec[$key]) == 'n') {
diff --git a/interface/web/admin/lib/lang/de_server_php.lng b/interface/web/admin/lib/lang/de_server_php.lng
index 67dad7064ae56db3e87a1e8e2885dcaee572ffe2..f43e79b4af19076cf177201298c3b6988e959b48 100644
--- a/interface/web/admin/lib/lang/de_server_php.lng
+++ b/interface/web/admin/lib/lang/de_server_php.lng
@@ -14,4 +14,6 @@ $wb['php_fpm_init_script_txt'] = 'Pfad zum PHP-FPM Init Script';
 $wb['php_fpm_ini_dir_txt'] = 'Pfad zum php.ini Verzeichnis';
 $wb['php_fpm_pool_dir_txt'] = 'Pfad zum PHP-FPM Pool Verzeichnis';
 $wb['active_txt'] = 'Aktiv';
+$wb['php_in_use_error'] = 'Diese PHP-Version wird noch benutzt.';
+$wb['php_name_in_use_error'] = 'Der Name kann nicht geändert werden.';
 ?>
diff --git a/interface/web/admin/lib/lang/en_server_php.lng b/interface/web/admin/lib/lang/en_server_php.lng
index 179a8fc357142ea401cd663697ef817237957d10..9d322804bb689273678d0733d9ba6e23c738b6c6 100644
--- a/interface/web/admin/lib/lang/en_server_php.lng
+++ b/interface/web/admin/lib/lang/en_server_php.lng
@@ -14,4 +14,6 @@ $wb['php_fpm_init_script_txt'] = 'Path to the PHP-FPM init script';
 $wb['php_fpm_ini_dir_txt'] = 'Path to the php.ini directory';
 $wb['php_fpm_pool_dir_txt'] = 'Path to the PHP-FPM pool directory';
 $wb['active_txt'] = 'Active';
+$wb['php_in_use_error'] = 'This PHP-Version is in use.';
+$wb['php_name_in_use_error'] = 'The name can not be changed.';
 ?>
diff --git a/interface/web/admin/server_php_del.php b/interface/web/admin/server_php_del.php
index 6848eea8d472a0c787e011558b7429375fc7965e..f160c1b2d93e89db8899b97cb31364f0811d7cd1 100644
--- a/interface/web/admin/server_php_del.php
+++ b/interface/web/admin/server_php_del.php
@@ -46,7 +46,39 @@ require_once '../../lib/app.inc.php';
 $app->auth->check_module_permissions('admin');
 $app->auth->check_security_permissions('admin_allow_server_php');
 
-$app->uses("tform_actions");
-$app->tform_actions->onDelete();
+$app->uses('tpl,tform,tform_actions');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+
+	function onBeforeDelete() {
+		global $app; $conf;
+
+		$check = array();
+
+		// fastcgi
+		if(!empty(trim($this->dataRecord['php_fastcgi_binary']))) $check[] = trim($this->dataRecord['php_fastcgi_binary']);
+		if(!empty(trim($this->dataRecord['php_fastcgi_ini_dir']))) $check[] = trim($this->dataRecord['php_fastcgi_ini_dir']);
+		if(!empty($check)) $fastcgi_check = implode(':', $check);
+		unset($check);
+
+		// fpm
+		if(!empty(trim($this->dataRecord['php_fpm_init_script']))) $check[] = trim($this->dataRecord['php_fpm_init_script']);
+		if(!empty(trim($this->dataRecord['php_fpm_ini_dir']))) $check[] = trim($this->dataRecord['php_fpm_ini_dir']);
+		if(!empty(trim($this->dataRecord['php_fpm_pool_dir']))) $check[] = trim($this->dataRecord['php_fpm_pool_dir']);
+		if(!empty($check)) $fpm_check = implode(':', $check);
+
+ 		$sql = 'SELECT domain_id FROM web_domain WHERE server_id = ? AND fastcgi_php_version LIKE ?';
+ 		if(isset($fastcgi_check)) $web_domains_fastcgi = $app->db->queryAllRecords($sql, $this->dataRecord['server_id'], '%:'.$fastcgi_check);
+		if(isset($fpm_check)) $web_domains_fpm = $app->db->queryAllRecords($sql, $this->dataRecord['server_id'], '%:'.$fpm_check);
+
+		if(!empty($webdomains_fastcgi) || !empty($web_domains_fpm))	$app->error($app->tform->lng('php_in_use_error'));
+
+	}
+
+}
+
+$page = new page_action;
+$page->onDelete();
 
 ?>
diff --git a/interface/web/admin/server_php_edit.php b/interface/web/admin/server_php_edit.php
index 12aacf60b92a687c75c71f33fad9abe5b83cad5a..c200b25bae2a72a7d60a3afe17d425b83b2e5282 100644
--- a/interface/web/admin/server_php_edit.php
+++ b/interface/web/admin/server_php_edit.php
@@ -50,7 +50,35 @@ $app->uses('tpl,tform,tform_actions');
 $app->load('tform_actions');
 
 class page_action extends tform_actions {
+	function onSubmit() {
+		global $app;
+
+		if(isset($this->id) && $this->id > 0 && $app->tform->getCurrentTab() == 'php_name') {
+			$rec = $app->db->queryOneRecord('SELECT * FROM server_php WHERE server_php_id = ?', $this->id);
+			if($rec['name'] != $this->dataRecord['name']) {
+				$check = array();
+				// fastcgi
+				if($rec['php_fastcgi_binary'] != '') $check[] = $rec['php_fastcgi_binary'];
+				if($rec['php_fastcgi_ini_dir'] != '') $check[] = $rec['php_fastcgi_ini_dir'];
+				if(!empty($check)) $fastcgi_check = implode(':', $check);
+				unset($check);
+				// fpm
+				if($rec['php_fpm_init_script'] != '') $check[] = $rec['php_fpm_init_script'];
+				if($rec['php_fpm_ini_dir'] != '') $check[] = $rec['php_fpm_ini_dir'];
+				if($rec['php_fpm_pool_dir'] != '') $check[] = $rec['php_fpm_pool_dir'];
+				if(!empty($check)) $fpm_check = implode(':', $check);
+
+ 				$sql = 'SELECT domain_id FROM web_domain WHERE server_id = ? AND fastcgi_php_version LIKE ?';
+		 		if(isset($fastcgi_check)) $web_domains_fastcgi = $app->db->queryAllRecords($sql, $this->dataRecord['server_id'], '%:'.$fastcgi_check);
+				if(isset($fpm_check)) $web_domains_fpm = $app->db->queryAllRecords($sql, $this->dataRecord['server_id'], '%:'.$fpm_check);
+
+				if(!empty($webdomains_fastcgi) || !empty($web_domains_fpm))	$app->error($app->tform->lng('php_in_use_error').' '.$app->tform->lng('php_name_in_use_error'));
+			}
+		}
 
+		parent::onSubmit();
+
+	}
 	function onBeforeUpdate() {
 		global $app, $conf;
 
diff --git a/interface/web/sites/templates/web_vhost_domain_admin_list.htm b/interface/web/sites/templates/web_vhost_domain_admin_list.htm
index 20be5a359f6b902876dc022c8e6787c911428df0..85458f732958708bdce17444655dafa331b8bc09 100644
--- a/interface/web/sites/templates/web_vhost_domain_admin_list.htm
+++ b/interface/web/sites/templates/web_vhost_domain_admin_list.htm
@@ -37,7 +37,7 @@
                 </thead>
                 <tbody>
                 <tmpl_loop name="records">
-                    <tr>
+						<tr <tmpl_if name="warn_inactive"> class="danger" </tmpl_if> >
                     	<tmpl_if name="vhostdomain_type" value="domain"><td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="domain_id"}</a></td></tmpl_if>
                         <td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="active"}</a></td>
                         <tmpl_if name="vhostdomain_type" value="domain"><td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="sys_groupid"}</a></td></tmpl_if>
diff --git a/interface/web/sites/templates/web_vhost_domain_list.htm b/interface/web/sites/templates/web_vhost_domain_list.htm
index 4cdde852a3c5bbb2a503b281d74982295111ab3a..3726a707f4d067ab84f2a6d02b698f2332a23155 100644
--- a/interface/web/sites/templates/web_vhost_domain_list.htm
+++ b/interface/web/sites/templates/web_vhost_domain_list.htm
@@ -52,7 +52,7 @@
                 </thead>
                 <tbody>
                 <tmpl_loop name="records">
-                    <tr>
+					<tr <tmpl_if name="warn_inactive"> class="danger" </tmpl_if> >
                     	<tmpl_if name="vhostdomain_type" value="domain"><td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="domain_id"}</a></td></tmpl_if>
                         <td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="active"}</a></td>
                         <td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}" data-toggle="tooltip" data-placement="bottom" title="{tmpl_var name='server_id'}">{tmpl_var name="server_id"}</a></td>