Commit 1dbd0e35 authored by Florian Schaal's avatar Florian Schaal

FS#2403 - Disable apps vhost in server config

parent 6495dda1
......@@ -72,6 +72,7 @@ user=www-data
group=www-data
nginx_user=www-data
nginx_group=www-data
apps_vhost_enabled=y
apps_vhost_port=8081
apps_vhost_ip=_default_
apps_vhost_servername=
......
......@@ -1038,6 +1038,12 @@ $form["tabs"]['web'] = array(
1 => 'y'
)
),
'apps_vhost_enabled' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array (0 => 'n', 1 => 'y')
),
'apps_vhost_port' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
......
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -253,5 +253,6 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -266,4 +266,5 @@ $wb['php_ini_check_minutes_info_txt'] = '0 = keine Prüfung';
$wb['php_handler_txt'] = 'Standard-PHP-Handler';
$wb['enable_spdy_txt'] = 'Stellt SPDY zur Verfügung';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -250,4 +250,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -281,4 +281,5 @@ $wb['xmpp_port_https_txt'] = 'HTTPS';
$wb['xmpp_port_pastebin_txt'] = 'Pastebin';
$wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -253,4 +253,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -252,5 +252,6 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -256,6 +256,7 @@ $wb['crontab_dir_error_regex'] = 'Neispravan crontab direktorij.';
$wb['cron_wget_error_regex'] = 'Neispravna cron wget putanja.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -255,4 +255,5 @@ $wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
?>
......@@ -228,6 +228,9 @@
</div>
<div class="col-sm-3"></div><div class="col-sm-9"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-apps_vhost_settings" aria-expanded="false" aria-controls="toggle-apps_vhost_settings">{tmpl_var name='apps_vhost_settings_txt'}</button></div>
<div id="toggle-apps_vhost_settings" class="collapse">
<div class="form-group">
<label for="apps_vhost_enabled" class="col-sm-3 control-label">{tmpl_var name='apps_vhost_enabled_txt'}</label>
<div class="col-sm-9">{tmpl_var name='apps_vhost_enabled'}</div></div>
<div class="form-group">
<label for="apps_vhost_port" class="col-sm-3 control-label">{tmpl_var name='apps_vhost_port_txt'}</label>
<div class="col-sm-9"><input type="text" name="apps_vhost_port" id="apps_vhost_port" value="{tmpl_var name='apps_vhost_port'}" class="form-control" /></div></div>
......
......@@ -119,6 +119,16 @@ class apps_vhost_plugin {
/* end of backwards compatibility section */
$app->system->file_put_contents("$vhost_conf_dir/apps.vhost", $content);
// enabled / disable apps-vhost
$vhost_symlink = escapeshellcmd($web_config['vhost_conf_enabled_dir'].'/000-apps.vhost');
if(is_link($vhost_symlink) && $web_config['apps_vhost_enabled'] == 'n') {
$app->system->unlink($vhost_symlink);
}
if(!@is_link($vhost_conf_enabled_dir.'/000-apps.vhost') && $web_config['apps_vhost_enabled'] == 'y') {
symlink($vhost_conf_dir.'/apps.vhost', $vhost_conf_enabled_dir.'/000-apps.vhost');
}
$app->services->restartServiceDelayed('httpd', 'restart');
}
......@@ -185,6 +195,16 @@ class apps_vhost_plugin {
file_put_contents($web_config['php_fpm_pool_dir'].'/apps.conf', $fpm_content);
file_put_contents("$vhost_conf_dir/apps.vhost", $content);
// enabled / disable apps-vhost
$vhost_symlink = escapeshellcmd($web_config['vhost_conf_enabled_dir'].'/000-apps.vhost');
if(is_link($vhost_symlink) && $web_config['apps_vhost_enabled'] == 'n') {
$app->system->unlink($vhost_symlink);
}
if(!@is_link($vhost_conf_enabled_dir.'/000-apps.vhost') && $web_config['apps_vhost_enabled'] == 'y') {
symlink($vhost_conf_dir.'/apps.vhost', $vhost_conf_enabled_dir.'/000-apps.vhost');
}
$app->services->restartServiceDelayed('httpd', 'reload');
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment