REL-0.12 Use custom doc root directory in Intranet

This commit is contained in:
cytopia 2017-09-28 16:30:00 +02:00
parent bf0bc75b90
commit 32add6d2a0
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
3 changed files with 15 additions and 8 deletions

View File

@ -351,6 +351,14 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL);
<th>gid</th> <th>gid</th>
<td><?php echo loadClass('Php')->getGid(); ?></td> <td><?php echo loadClass('Php')->getGid(); ?></td>
</tr> </tr>
<tr>
<th>vHost docroot dir</th>
<td><?php echo loadClass('Helper')->getEnv('HTTPD_DOCROOT_DIR'); ?></td>
</tr>
<tr>
<th>vHost config dir</th>
<td><?php echo loadClass('Helper')->getEnv('HTTPD_TEMPLATE_DIR'); ?></td>
</tr>
<tr> <tr>
<th>vHost TLD</th> <th>vHost TLD</th>
<td>*.<?php echo loadClass('Httpd')->getTldSuffix(); ?></td> <td>*.<?php echo loadClass('Httpd')->getTldSuffix(); ?></td>
@ -762,8 +770,8 @@ $HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL);
</tr> </tr>
<tr> <tr>
<th>httpd</th> <th>httpd</th>
<td>-</td> <td>./cfg/<?php echo loadClass('Helper')->getEnv('HTTPD_SERVER'); ?></td>
<td>-</td> <td>/etc/httpd-custom.d</td>
</tr> </tr>
<?php if ($avail_mysql): ?> <?php if ($avail_mysql): ?>
<tr> <tr>

View File

@ -39,7 +39,7 @@
<?php foreach ($vHosts as $vHost): ?> <?php foreach ($vHosts as $vHost): ?>
<tr> <tr>
<td><?php echo $vHost['name'];?></td> <td><?php echo $vHost['name'];?></td>
<td><?php echo loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR');?>/<?php echo $vHost['name'];?>/htdocs</td> <td><?php echo loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR');?>/<?php echo $vHost['name'];?>/<?php echo loadClass('Helper')->getEnv('HTTPD_DOCROOT_DIR');?></td>
<td class="text-xs-center text-xs-small" id="valid-<?php echo $vHost['name'];?>">&nbsp;&nbsp;&nbsp;</td> <td class="text-xs-center text-xs-small" id="valid-<?php echo $vHost['name'];?>">&nbsp;&nbsp;&nbsp;</td>
<td id="href-<?php echo $vHost['name'];?>"><?php echo $filler;?></td> <td id="href-<?php echo $vHost['name'];?>"><?php echo $filler;?></td>
</tr> </tr>
@ -80,12 +80,10 @@
error = this.responseText; error = this.responseText;
if (error.length && error.match(/^error/)) { if (error.length && error.match(/^error/)) {
console.log(error);
el_valid.className += ' bg-danger'; el_valid.className += ' bg-danger';
el_valid.innerHTML = 'ERR'; el_valid.innerHTML = 'ERR';
el_href.innerHTML = error; el_href.innerHTML = error;
} else if (error.length && error.match(/^warning/)) { } else if (error.length && error.match(/^warning/)) {
console.log(error);
el_valid.className += ' bg-warning'; el_valid.className += ' bg-warning';
el_valid.innerHTML = 'WARN'; el_valid.innerHTML = 'WARN';
el_href.innerHTML = error.replace('warning', ''); el_href.innerHTML = error.replace('warning', '');

View File

@ -23,15 +23,16 @@ class Httpd extends BaseClass implements BaseInterface
*/ */
public function checkVirtualHost($vhost) 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(); $domain = $vhost . '.' . $this->getTldSuffix();
$url = 'http://'.$domain; $url = 'http://'.$domain;
$error = array(); $error = array();
// 1. Check htdocs folder // 1. Check htdocs folder
if (!$this->_is_valid_dir($htdocs)) { if (!$this->_is_valid_dir($docroot)) {
$error[] = 'error'; $error[] = 'error';
$error[] = 'Missing <strong>htdocs</strong> directory in: <strong>'.loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vhost.'/</strong>'; $error[] = 'Missing <strong>'.$htdocs.'</strong> directory in: <strong>'.loadClass('Helper')->getEnv('HOST_PATH_HTTPD_DATADIR').'/'.$vhost.'/</strong>';
} }
// 2. Check internal DNS server // 2. Check internal DNS server