Skip to content

Commit

Permalink
Merge pull request #58 from cytopia/release-0.9
Browse files Browse the repository at this point in the history
Release 0.9
  • Loading branch information
cytopia authored May 21, 2017
2 parents 4c0ec7d + 7330852 commit 0c643f3
Show file tree
Hide file tree
Showing 316 changed files with 7,104 additions and 3,816 deletions.
30 changes: 0 additions & 30 deletions .devilbox/bin/apache-2.2/splitlogs.php

This file was deleted.

30 changes: 0 additions & 30 deletions .devilbox/bin/apache-2.4/splitlogs.php

This file was deleted.

2 changes: 1 addition & 1 deletion .devilbox/etc/apache-2.2/00-php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5-fcgi
Alias /php5-fcgi /usr/local/bin/php-fcgi
FastCgiExternalServer /usr/local/bin/php-fcgi -host 172.16.238.11:9000 -pass-header Authorization
FastCgiExternalServer /usr/local/bin/php-fcgi -host php:9000 -pass-header Authorization
15 changes: 12 additions & 3 deletions .devilbox/etc/apache-2.2/01-vhost-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ NameVirtualHost *:80

<VirtualHost _default_:80>
ServerName localhost
ServerAlias 127.0.0.1
ServerAlias 172.16.238.*
ServerAlias httpd

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

Expand All @@ -25,7 +29,12 @@ NameVirtualHost *:80
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<Location /devilbox-httpd-status>
SetHandler server-status

Order allow,deny
Allow from all
</Location>

</VirtualHost>
19 changes: 10 additions & 9 deletions .devilbox/etc/apache-2.2/02-vhost-mass.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
UseCanonicalName Off

ServerName localhost
ServerAlias *.loc
ServerAlias *.*
ServerAdmin root@localhost

# splitlogs.php is a custom script, which will filter the domain
# and create separate logfiles per domain.
LogFormat "%V;%h;%l;%u;%t;\"%r\";%>s;%b;\"%{Referer}i\";\"%{User-agent}i\"" vcommon
CustomLog "|/opt/bin/splitlogs.php" vcommon
# 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

ErrorLog /var/log/apache-2.2/other-error.log
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

DirectoryIndex index.php index.html

Expand All @@ -25,6 +26,9 @@
VirtualDocumentRoot /shared/httpd/%-2+/htdocs/
php_admin_value auto_prepend_file /opt/bin/fix-virtual-docroot.php

# Devilbox API endpoint
Alias "/devilbox-api" "/var/www/default/api/devilbox-api"

<Directory "/shared/httpd/*/htdocs/">
DirectoryIndex index.php index.html

Expand All @@ -38,6 +42,3 @@
Allow from all
</Directory>
</VirtualHost>



14 changes: 7 additions & 7 deletions .devilbox/etc/apache-2.4/00-php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# If you have enough idle workers, this would only improve the performance marginally
#
# enablereuse requires Apache 2.4.11 or later
#<Proxy "fcgi://172.16.238.11:9000/" enablereuse=on max=10></Proxy>
#<Proxy "fcgi://php:9000/" enablereuse=on max=10></Proxy>
<FilesMatch "\.php$">
Require all granted
# Pick one of the following approaches
# Use the standard TCP socket
SetHandler "proxy:fcgi://172.16.238.11:9000"
# If your version of httpd is 2.4.9 or newer (or has the back-ported feature), you can use the unix domain socket
#SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/:9000"
Require all granted
# Pick one of the following approaches
# Use the standard TCP socket
SetHandler "proxy:fcgi://php:9000"
# If your version of httpd is 2.4.9 or newer (or has the back-ported feature), you can use the unix domain socket
#SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/:9000"
</FilesMatch>
16 changes: 13 additions & 3 deletions .devilbox/etc/apache-2.4/01-vhost-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@

<VirtualHost _default_:80>
ServerName localhost
ServerAlias 127.0.0.1
ServerAlias 172.16.238.*
ServerAlias httpd

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

Expand All @@ -26,7 +30,13 @@
Allow from all
Require all granted
</Directory>
</VirtualHost>

<Location /devilbox-httpd-status>
SetHandler server-status

Order allow,deny
Allow from all
Require all granted
</Location>

</VirtualHost>
19 changes: 10 additions & 9 deletions .devilbox/etc/apache-2.4/02-vhost-mass.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
UseCanonicalName Off

ServerName localhost
ServerAlias *.loc
ServerAlias *.*
ServerAdmin root@localhost

# splitlogs.php is a custom script, which will filter the domain
# and create separate logfiles per domain.
LogFormat "%V;%h;%l;%u;%t;\"%r\";%>s;%b;\"%{Referer}i\";\"%{User-agent}i\"" vcommon
CustomLog "|/opt/bin/splitlogs.php" vcommon
# 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

ErrorLog /var/log/apache-2.4/other-error.log
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

DirectoryIndex index.php index.html

Expand All @@ -25,6 +26,9 @@
VirtualDocumentRoot /shared/httpd/%-2+/htdocs/
php_admin_value auto_prepend_file /opt/bin/fix-virtual-docroot.php

# Devilbox API endpoint
Alias "/devilbox-api" "/var/www/default/api/devilbox-api"

<Directory "/shared/httpd/*/htdocs/">
DirectoryIndex index.php index.html

Expand All @@ -39,6 +43,3 @@
Require all granted
</Directory>
</VirtualHost>



Empty file.
5 changes: 1 addition & 4 deletions .devilbox/etc/nginx-mainline/00-defaults.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
access_log /var/log/nginx-mainline/access.log main;
error_log /var/log/nginx-mainline/error.log warn;

charset utf-8;

send_timeout 60;
keepalive_timeout 10;

sendfile on;
sendfile off;
tcp_nopush on;
tcp_nodelay on;
27 changes: 24 additions & 3 deletions .devilbox/etc/nginx-mainline/01-vhost-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,35 @@
server {
listen 80 default_server;
server_name _;
server_name localhost;
server_name 127.0.0.1;
server_name httpd;
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;

# Devilbox httpd info/status
location /devilbox-httpd-status {
stub_status on;
access_log off;
}

# Devilbox API endpoint
location ~ /devilbox-api/ {
root /var/www/default/api/;
index status.json;

# Allow cross-domain requests to this domain
# Used to validate if client DNS is setup correctly
if ( $http_origin ~* (https?://(localhost|127\.0\.0\.1|httpd)$) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
}
}

# Front-controller pattern as recommended by the nginx docs
location / {
Expand All @@ -35,7 +56,7 @@ server {
fastcgi_split_path_info ^(.+\.php)(.*)$;

#### FPM Server
fastcgi_pass 172.16.238.11:9000;
fastcgi_pass php:9000;

fastcgi_index index.php;
fastcgi_intercept_errors on;
Expand Down
23 changes: 17 additions & 6 deletions .devilbox/etc/nginx-mainline/02-vhost-mass.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@

server {
listen 80;
server_name ~^(?<domain>.+)\.loc$;
server_name ~^(?<domain>.+)\.[a-zA-Z]+$;

# Root directive
root /shared/httpd/$domain/htdocs/;
index index.php;

access_log /var/log/nginx-mainline/$domain-access.log main;
error_log /var/log/nginx-mainline/other-error.log warn;
access_log /var/log/nginx-mainline/projects-access.log main;
error_log /var/log/nginx-mainline/projects-error.log warn;

# Devilbox API endpoint
location ~ /devilbox-api/ {
root /var/www/default/api/;
index status.json;
access_log off;

# Allow cross-domain requests to this domain
# Used to validate if client DNS is setup correctly
if ( $http_origin ~* (https?://(localhost|127\.0\.0\.1|httpd)$) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
}
}

# Front-controller pattern as recommended by the nginx docs
location / {
Expand All @@ -21,6 +33,7 @@ server {

# PHP FPM
location ~ \.php?$ {

# PHP.INI:
# ---------------------------
# // Find this:
Expand All @@ -35,14 +48,12 @@ server {
fastcgi_split_path_info ^(.+\.php)(.*)$;

#### SOCKET
fastcgi_pass 172.16.238.11:9000;
fastcgi_pass php:9000;

fastcgi_index index.php;
fastcgi_intercept_errors on;
}



# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
Expand Down
5 changes: 1 addition & 4 deletions .devilbox/etc/nginx-stable/00-defaults.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
access_log /var/log/nginx-stable/access.log main;
error_log /var/log/nginx-stable/error.log warn;

charset utf-8;

send_timeout 60;
keepalive_timeout 10;

sendfile on;
sendfile off;
tcp_nopush on;
tcp_nodelay on;
Loading

0 comments on commit 0c643f3

Please sign in to comment.