From 32add6d2a001712b4718ecb020152c5a42c48b99 Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 28 Sep 2017 16:30:00 +0200 Subject: [PATCH] REL-0.12 Use custom doc root directory in Intranet --- .devilbox/www/htdocs/index.php | 12 ++++++++++-- .devilbox/www/htdocs/vhosts.php | 4 +--- .devilbox/www/include/lib/container/Httpd.php | 7 ++++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.devilbox/www/htdocs/index.php b/.devilbox/www/htdocs/index.php index b9f0c212..11fc9d14 100644 --- a/.devilbox/www/htdocs/index.php +++ b/.devilbox/www/htdocs/index.php @@ -351,6 +351,14 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL); gid getGid(); ?> + + vHost docroot dir + getEnv('HTTPD_DOCROOT_DIR'); ?> + + + vHost config dir + getEnv('HTTPD_TEMPLATE_DIR'); ?> + vHost TLD *.getTldSuffix(); ?> @@ -762,8 +770,8 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL); httpd - - - - + ./cfg/getEnv('HTTPD_SERVER'); ?> + /etc/httpd-custom.d diff --git a/.devilbox/www/htdocs/vhosts.php b/.devilbox/www/htdocs/vhosts.php index 70c4f90c..75b94052 100644 --- a/.devilbox/www/htdocs/vhosts.php +++ b/.devilbox/www/htdocs/vhosts.php @@ -39,7 +39,7 @@ - getEnv('HOST_PATH_HTTPD_DATADIR');?>//htdocs + getEnv('HOST_PATH_HTTPD_DATADIR');?>//getEnv('HTTPD_DOCROOT_DIR');?>     @@ -80,12 +80,10 @@ error = this.responseText; if (error.length && error.match(/^error/)) { - console.log(error); el_valid.className += ' bg-danger'; el_valid.innerHTML = 'ERR'; el_href.innerHTML = error; } else if (error.length && error.match(/^warning/)) { - console.log(error); el_valid.className += ' bg-warning'; el_valid.innerHTML = 'WARN'; el_href.innerHTML = error.replace('warning', ''); diff --git a/.devilbox/www/include/lib/container/Httpd.php b/.devilbox/www/include/lib/container/Httpd.php index b92c5710..a8209430 100644 --- a/.devilbox/www/include/lib/container/Httpd.php +++ b/.devilbox/www/include/lib/container/Httpd.php @@ -23,15 +23,16 @@ class Httpd extends BaseClass implements BaseInterface */ public function checkVirtualHost($vhost) { - $htdocs = $this->_docRoot . DIRECTORY_SEPARATOR . $vhost . DIRECTORY_SEPARATOR . 'htdocs'; + $htdocs = loadClass('Helper')->getEnv('HTTPD_DOCROOT_DIR'); + $docroot = $this->_docRoot . DIRECTORY_SEPARATOR . $vhost . DIRECTORY_SEPARATOR . $htdocs; $domain = $vhost . '.' . $this->getTldSuffix(); $url = 'http://'.$domain; $error = array(); // 1. Check htdocs folder - if (!$this->_is_valid_dir($htdocs)) { + if (!$this->_is_valid_dir($docroot)) { $error[] = 'error'; - $error[] = 'Missing htdocs directory in: '.loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vhost.'/'; + $error[] = 'Missing '.$htdocs.' directory in: '.loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vhost.'/'; } // 2. Check internal DNS server