authPage(); ?>
isAvailable();
$avail_dns = loadClass('Dns')->isAvailable();
$avail_httpd = loadClass('Httpd')->isAvailable();
$avail_mysql = loadClass('Mysql')->isAvailable();
$avail_pgsql = loadClass('Pgsql')->isAvailable();
$avail_redis = loadClass('Redis')->isAvailable();
$avail_memcd = loadClass('Memcd')->isAvailable();
$avail_mongo = loadClass('Mongo')->isAvailable();
/*************************************************************
* Test Connectivity
*************************************************************/
$connection = array();
$error = null;
// ---- HTTPD (required) ----
$host = $GLOBALS['HTTPD_HOST_NAME'];
$succ = loadClass('Httpd')->canConnect($error, $host);
$connection['Httpd'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = loadClass('Httpd')->getIpAddress();
$succ = loadClass('Httpd')->canConnect($error, $host);
$connection['Httpd'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = 'random.'.loadClass('Httpd')->getTldSuffix();
$succ = loadClass('Httpd')->canConnect($error, $host);
$connection['Httpd'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
// ---- MYSQL ----
if ($avail_mysql) {
$host = $GLOBALS['MYSQL_HOST_NAME'];
$succ = loadClass('Mysql')->canConnect($error, $host, array('user' => 'root', 'pass' => loadClass('Helper')->getEnv('MYSQL_ROOT_PASSWORD')));
$connection['MySQL'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = loadClass('Mysql')->getIpAddress();
$succ = loadClass('Mysql')->canConnect($error, $host, array('user' => 'root', 'pass' => loadClass('Helper')->getEnv('MYSQL_ROOT_PASSWORD')));
$connection['MySQL'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = '127.0.0.1';
$succ = loadClass('Mysql')->canConnect($error, $host, array('user' => 'root', 'pass' => loadClass('Helper')->getEnv('MYSQL_ROOT_PASSWORD')));
$connection['MySQL'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
}
// ---- PGSQL ----
if ($avail_pgsql) {
$host = $GLOBALS['PGSQL_HOST_NAME'];
$succ = loadClass('Pgsql')->canConnect($error, $host, array('user' => loadClass('Helper')->getEnv('PGSQL_ROOT_USER'), 'pass' => loadClass('Helper')->getEnv('PGSQL_ROOT_PASSWORD')));
$connection['PgSQL'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = loadClass('Pgsql')->getIpAddress();
$succ = loadClass('Pgsql')->canConnect($error, $host, array('user' => loadClass('Helper')->getEnv('PGSQL_ROOT_USER'), 'pass' => loadClass('Helper')->getEnv('PGSQL_ROOT_PASSWORD')));
$connection['PgSQL'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = '127.0.0.1';
$succ = loadClass('Pgsql')->canConnect($error, $host, array('user' => loadClass('Helper')->getEnv('PGSQL_ROOT_USER'), 'pass' => loadClass('Helper')->getEnv('PGSQL_ROOT_PASSWORD')));
$connection['PgSQL'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
}
// ---- REDIS ----
if ($avail_redis) {
$host = $GLOBALS['REDIS_HOST_NAME'];
$succ = loadClass('Redis')->canConnect($error, $host);
$connection['Redis'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = loadClass('Redis')->getIpAddress();
$succ = loadClass('Redis')->canConnect($error, $host);
$connection['Redis'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = '127.0.0.1';
$succ = loadClass('Redis')->canConnect($error, $host);
$connection['Redis'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
}
// ---- MEMCACHED ----
if ($avail_memcd) {
$host = $GLOBALS['MEMCD_HOST_NAME'];
$succ = loadClass('Memcd')->canConnect($error, $host);
$connection['Memcached'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = loadClass('Memcd')->getIpAddress();
$succ = loadClass('Memcd')->canConnect($error, $host);
$connection['Memcached'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = '127.0.0.1';
$succ = loadClass('Memcd')->canConnect($error, $host);
$connection['Memcached'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
}
// ---- MONGO ----
if ($avail_mongo) {
$host = $GLOBALS['MONGO_HOST_NAME'];
$succ = loadClass('Mongo')->canConnect($error, $host);
$connection['MongoDB'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = loadClass('Mongo')->getIpAddress();
$succ = loadClass('Mongo')->canConnect($error, $host);
$connection['MongoDB'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = '127.0.0.1';
$succ = loadClass('Mongo')->canConnect($error, $host);
$connection['MongoDB'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
}
// ---- BIND (required)----
$host = $GLOBALS['DNS_HOST_NAME'];
$succ = loadClass('Dns')->canConnect($error, $host);
$connection['Bind'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
$host = loadClass('Dns')->getIpAddress();
$succ = loadClass('Dns')->canConnect($error, $host);
$connection['Bind'][$host] = array(
'error' => $error,
'host' => $host,
'succ' => $succ
);
/*************************************************************
* Test Health
*************************************************************/
$HEALTH_TOTAL = 0;
$HEALTH_FAILS = 0;
foreach ($connection as $docker) {
foreach ($docker as $conn) {
if (!$conn['succ']) {
$HEALTH_FAILS++;
}
$HEALTH_TOTAL++;
}
}
$HEALTH_PERCENT = 100 - ceil(100 * $HEALTH_FAILS / $HEALTH_TOTAL);
/*********************************************************************************
*
* H T M L
*
*********************************************************************************/
?>
getHead(true); ?>
getNavbar(); ?>
Base Stack
getCirle('dns'); ?>
getCirle('php'); ?>
getCirle('httpd'); ?>
SQL Stack
getCirle('mysql'); ?>
getCirle('pgsql'); ?>
NoSQL Stack
getCirle('redis'); ?>
getCirle('memcd'); ?>
getCirle('mongo'); ?>
PHP Container Setup
You can also enter the php container and work from inside. The following is available inside the container:
Settings |
uid |
getUid(); ?> |
gid |
getGid(); ?> |
vHost docroot dir |
getEnv('HTTPD_DOCROOT_DIR'); ?> |
vHost config dir |
getEnv('HTTPD_TEMPLATE_DIR'); ?> |
vHost TLD |
*.getTldSuffix(); ?> |
DNS |
EnabledOffline |
Postfix |
getEnv('ENABLE_MAIL') ? 'Enabled' : 'No Disabled';?> |
Tools |
composer |
|
drupal-console |
|
drush |
|
git |
|
Laravel installer |
|
mysqldump-secure |
|
node |
|
npm |
|
Phalcon devtools |
|
Symfony installer |
|
Wordpress cli |
|
PHP Container Status
The PHP Docker can connect to the following services via the specified hostnames and IP addresses.
Service |
Hostname / IP |
$docker): ?>
connect |
'.$conn['host']; ?>
'.$conn['host'].'
'.$conn['error']; ?>
|
|
Networking
Docker |
Hostname |
IP |
php |
|
getIpAddress(); ?> |
httpd |
|
getIpAddress(); ?> |
mysql |
|
getIpAddress(); ?> |
pgsql |
|
getIpAddress(); ?> |
redis |
|
getIpAddress(); ?> |
memcached |
|
getIpAddress(); ?> |
mongo |
|
getIpAddress(); ?> |
bind |
|
getIpAddress(); ?> |
Ports
Docker |
Host port |
Docker port |
php |
- |
9000 |
httpd |
getEnv('LOCAL_LISTEN_ADDR').loadClass('Helper')->getEnv('HOST_PORT_HTTPD');?> |
80 |
mysql |
getEnv('LOCAL_LISTEN_ADDR').loadClass('Helper')->getEnv('HOST_PORT_MYSQL');?> |
3306 |
pgsql |
getEnv('LOCAL_LISTEN_ADDR').loadClass('Helper')->getEnv('HOST_PORT_PGSQL');?> |
5432 |
redis |
getEnv('LOCAL_LISTEN_ADDR').loadClass('Helper')->getEnv('HOST_PORT_REDIS');?> |
6379 |
memcached |
getEnv('LOCAL_LISTEN_ADDR').loadClass('Helper')->getEnv('HOST_PORT_MEMCD');?> |
11211 |
mongo |
getEnv('LOCAL_LISTEN_ADDR').loadClass('Helper')->getEnv('HOST_PORT_MONGO');?> |
27017 |
bind |
getEnv('LOCAL_LISTEN_ADDR').loadClass('Helper')->getEnv('HOST_PORT_BIND');?>/tcp
getEnv('LOCAL_LISTEN_ADDR').loadClass('Helper')->getEnv('HOST_PORT_BIND');?>/udp
|
53/tcp 53/udp |
Data mounts
Docker |
Host path |
Docker path |
php |
getEnv('HOST_PATH_HTTPD_DATADIR'); ?> |
/shared/httpd |
httpd |
getEnv('HOST_PATH_HTTPD_DATADIR'); ?> |
/shared/httpd |
mysql |
getEnv('HOST_PATH_MYSQL_DATADIR').'/'.loadClass('Helper')->getEnv('MYSQL_SERVER'); ?> |
/var/lib/mysql |
pgsql |
getEnv('HOST_PATH_PGSQL_DATADIR').'/'.loadClass('Helper')->getEnv('PGSQL_SERVER'); ?> |
/var/lib/postgresql/data/pgdata |
redis |
- |
- |
memcached |
- |
- |
mongo |
getEnv('HOST_PATH_MONGO_DATADIR'); ?> |
/data/db |
bind |
- |
- |
Config mounts
Docker |
Host path |
Docker path |
php |
./cfg/php-fpm-getEnv('PHP_SERVER'); ?> |
/etc/php-custom.d |
httpd |
./cfg/getEnv('HTTPD_SERVER'); ?> |
/etc/httpd-custom.d |
mysql |
./cfg/getEnv('MYSQL_SERVER'); ?> |
/etc/mysql/conf.d |
pgsql |
- |
- |
redis |
- |
- |
memcached |
- |
- |
mongo |
- |
- |
bind |
- |
- |
Log mounts
Docker |
Host path |
Docker path |
php |
./log/php-fpm-getEnv('PHP_SERVER'); ?> |
/var/log/php |
httpd |
./log/getEnv('HTTPD_SERVER'); ?> |
/var/log/getEnv('HTTPD_SERVER'); ?> |
mysql |
./log/getEnv('MYSQL_SERVER'); ?> |
/var/log/mysql |
pgsql |
./log/pgsql-getEnv('PGSQL_SERVER'); ?> |
/var/log/postgresql |
redis |
./log/redis-getEnv('REDIS_SERVER'); ?> |
/var/log/redis |
memcached |
./log/memcached-getEnv('MEMCD_SERVER'); ?> |
/var/log/memcached |
mongo |
- |
- |
bind |
- |
- |
getFooter(); ?>