diff --git a/.devilbox/etc/apache-2.2/01-vhost-default.conf b/.devilbox/etc/apache-2.2/01-vhost-default.conf index d0b297c4..ce722d1e 100644 --- a/.devilbox/etc/apache-2.2/01-vhost-default.conf +++ b/.devilbox/etc/apache-2.2/01-vhost-default.conf @@ -11,8 +11,8 @@ NameVirtualHost *:80 ServerAdmin root@localhost - ErrorLog /var/log/apache-2.2/localhost-error.log - CustomLog /var/log/apache-2.2/localhost-access.log combined + ErrorLog /var/log/apache-2.2/devilbox-error.log + CustomLog /var/log/apache-2.2/devilbox-access.log combined DirectoryIndex index.php index.html diff --git a/.devilbox/etc/apache-2.2/02-vhost-mass.conf b/.devilbox/etc/apache-2.2/02-vhost-mass.conf index 6e809cd2..c18ac2dc 100644 --- a/.devilbox/etc/apache-2.2/02-vhost-mass.conf +++ b/.devilbox/etc/apache-2.2/02-vhost-mass.conf @@ -11,6 +11,10 @@ ServerAlias *.* ServerAdmin root@localhost + # Required for DNS checking + SetEnvIf Origin "http(s)?://(domain1.org|localhost|127.0.0.1|httpd)$" AccessControlAllowOrigin=$0$1 + Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin + LogFormat "%V;%h;%l;%u;%t;\"%r\";%>s;%b;\"%{Referer}i\";\"%{User-agent}i\"" vcommon CustomLog "/var/log/apache-2.2/projects-access.log" vcommon ErrorLog /var/log/apache-2.2/projects-error.log diff --git a/.devilbox/etc/apache-2.4/01-vhost-default.conf b/.devilbox/etc/apache-2.4/01-vhost-default.conf index d607737f..0a899c9b 100644 --- a/.devilbox/etc/apache-2.4/01-vhost-default.conf +++ b/.devilbox/etc/apache-2.4/01-vhost-default.conf @@ -11,8 +11,8 @@ ServerAdmin root@localhost - ErrorLog /var/log/apache-2.4/localhost-error.log - CustomLog /var/log/apache-2.4/localhost-access.log combined + ErrorLog /var/log/apache-2.4/devilbox-error.log + CustomLog /var/log/apache-2.4/devilbox-access.log combined DirectoryIndex index.php index.html diff --git a/.devilbox/etc/apache-2.4/02-vhost-mass.conf b/.devilbox/etc/apache-2.4/02-vhost-mass.conf index a797d622..c8fe32bb 100644 --- a/.devilbox/etc/apache-2.4/02-vhost-mass.conf +++ b/.devilbox/etc/apache-2.4/02-vhost-mass.conf @@ -11,6 +11,10 @@ ServerAlias *.* ServerAdmin root@localhost + # Required for DNS checking + SetEnvIf Origin "http(s)?://(domain1.org|localhost|127.0.0.1|httpd)$" AccessControlAllowOrigin=$0$1 + Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin + LogFormat "%V;%h;%l;%u;%t;\"%r\";%>s;%b;\"%{Referer}i\";\"%{User-agent}i\"" vcommon CustomLog "/var/log/apache-2.4/projects-access.log" vcommon ErrorLog /var/log/apache-2.4/projects-error.log diff --git a/.devilbox/etc/nginx-mainline/00-defaults.conf b/.devilbox/etc/nginx-mainline/00-defaults.conf index bd16e922..f4c3c90f 100644 --- a/.devilbox/etc/nginx-mainline/00-defaults.conf +++ b/.devilbox/etc/nginx-mainline/00-defaults.conf @@ -1,6 +1,3 @@ -access_log /var/log/nginx-mainline/access.log main; -error_log /var/log/nginx-mainline/error.log warn; - charset utf-8; send_timeout 60; diff --git a/.devilbox/etc/nginx-mainline/01-vhost-default.conf b/.devilbox/etc/nginx-mainline/01-vhost-default.conf index 2dc74075..1296b88c 100644 --- a/.devilbox/etc/nginx-mainline/01-vhost-default.conf +++ b/.devilbox/etc/nginx-mainline/01-vhost-default.conf @@ -6,17 +6,17 @@ server { listen 80 default_server; server_name _; server_name localhost; - server_name 127\.0\.0\.1; + server_name 127.0.0.1; server_name httpd; - server_name 172\.16\.238\..*; + server_name 172.16.238.*; # Root directive root /var/www/default/htdocs; index index.php; - access_log /var/log/nginx-mainline/localhost-access.log main; - error_log /var/log/nginx-mainline/localhost-error.log warn; + access_log /var/log/nginx-mainline/devilbox-access.log main; + error_log /var/log/nginx-mainline/devilbox-error.log warn; # Front-controller pattern as recommended by the nginx docs diff --git a/.devilbox/etc/nginx-mainline/02-vhost-mass.conf b/.devilbox/etc/nginx-mainline/02-vhost-mass.conf index e9ae4629..5de8e293 100644 --- a/.devilbox/etc/nginx-mainline/02-vhost-mass.conf +++ b/.devilbox/etc/nginx-mainline/02-vhost-mass.conf @@ -21,6 +21,12 @@ server { # PHP FPM location ~ \.php?$ { + + # Required for DNS checking + if ( $http_origin ~* (https?://(localhost|127\.0\.0\.1|httpd)$) ) { + add_header "Access-Control-Allow-Origin" "$http_origin"; + } + # PHP.INI: # --------------------------- # // Find this: diff --git a/.devilbox/etc/nginx-stable/00-defaults.conf b/.devilbox/etc/nginx-stable/00-defaults.conf index 5ac4551b..f4c3c90f 100644 --- a/.devilbox/etc/nginx-stable/00-defaults.conf +++ b/.devilbox/etc/nginx-stable/00-defaults.conf @@ -1,6 +1,3 @@ -access_log /var/log/nginx-stable/access.log main; -error_log /var/log/nginx-stable/error.log warn; - charset utf-8; send_timeout 60; diff --git a/.devilbox/etc/nginx-stable/01-vhost-default.conf b/.devilbox/etc/nginx-stable/01-vhost-default.conf index ad9f45a9..1fb0720f 100644 --- a/.devilbox/etc/nginx-stable/01-vhost-default.conf +++ b/.devilbox/etc/nginx-stable/01-vhost-default.conf @@ -6,16 +6,16 @@ server { listen 80 default_server; server_name _; server_name localhost; - server_name 127\.0\.0\.1; + server_name 127.0.0.1; server_name httpd; - server_name 172\.16\.238\..*; + server_name 172.16.238.*; # Root directive root /var/www/default/htdocs; index index.php; - access_log /var/log/nginx-stable/localhost-access.log main; - error_log /var/log/nginx-stable/localhost-error.log warn; + access_log /var/log/nginx-stable/devilbox-access.log main; + error_log /var/log/nginx-stable/devilbox-error.log warn; # Front-controller pattern as recommended by the nginx docs diff --git a/.devilbox/etc/nginx-stable/02-vhost-mass.conf b/.devilbox/etc/nginx-stable/02-vhost-mass.conf index a237a137..d4625c57 100644 --- a/.devilbox/etc/nginx-stable/02-vhost-mass.conf +++ b/.devilbox/etc/nginx-stable/02-vhost-mass.conf @@ -21,6 +21,12 @@ server { # PHP FPM location ~ \.php?$ { + + # Required for DNS checking + if ( $http_origin ~* (https?://(localhost|127\.0\.0\.1|httpd)$) ) { + add_header "Access-Control-Allow-Origin" "$http_origin"; + } + # PHP.INI: # --------------------------- # // Find this: diff --git a/.devilbox/www/htdocs/index.php b/.devilbox/www/htdocs/index.php index d6d4161f..9bbf8c19 100644 --- a/.devilbox/www/htdocs/index.php +++ b/.devilbox/www/htdocs/index.php @@ -53,7 +53,7 @@ $connection['Httpd'][$host] = array( 'host' => $host, 'succ' => $succ ); -$host = 'random.loc'; +$host = 'random.'.loadClass('Php')->getTldSuffix(); $succ = \devilbox\Httpd::testConnection($error, $host); $connection['Httpd'][$host] = array( 'error' => $error, @@ -406,7 +406,7 @@ function getCirle($name) {
Simply create a folder in getEnv('HOST_PATH_TO_WWW_DOCROOTS');?> (on your host computer - not inside the docker).
-Example:
getEnv('HOST_PATH_TO_WWW_DOCROOTS');?>/my_project
Simply create a folder in getEnv('HOST_PATH_HTTPD_DATADIR');?> (on your host computer - not inside the docker).
+Example:
getEnv('HOST_PATH_HTTPD_DATADIR');?>/my_project
127.0.0.1 '+vhost+'.getTldSuffix();?>
';
+ }
+ //xhttp.abort = function(e) {
+ // el_valid.className += ' bg-danger';
+ // el_valid.innerHTML = 'ERR';
+ // el_href.innerHTML = 'No DNS record found: 127.0.0.1 '+vhost+'.getTldSuffix();?>
';
+ //}
+ xhttp.open('GET', 'http://'+vhost+'.getTldSuffix();?>', true);
+ xhttp.send();
+ // Timeout to abort in 1 second
+ //var xmlHttpTimeout=setTimeout(ajaxTimeout,20000);
+ //function ajaxTimeout(){
+ // xhttp.abort();
+ //}
+ }
+
var vhosts = document.getElementsByName('vhost[]');
diff --git a/.devilbox/www/include/lib/Docker.php b/.devilbox/www/include/lib/Docker.php
index 3df5db97..94a82790 100644
--- a/.devilbox/www/include/lib/Docker.php
+++ b/.devilbox/www/include/lib/Docker.php
@@ -47,13 +47,6 @@ class Docker
*/
private $_env = array();
- /**
- * Domain suffix.
- *
- * @var string
- */
- private $_tld = 'loc';
-
/**
* Document root path in PHP docker
@@ -83,12 +76,6 @@ class Docker
$tmp = explode('=', $var);
$this->_env[$tmp[0]] = $tmp[1];
}
-
- // Set the TLD suffix (domain ending) for virtual hosts
- // Note: If this is changed it currently also needs to be changed
- // in each webserver's configuration file in .devilbox/