Skip to content

Commit be1620e

Browse files
committed
Initial commit
0 parents  commit be1620e

17 files changed

+1865
-0
lines changed

Diff for: .gitignore

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Note:
2+
# To effectively apply the changes you will have
3+
# to re-index the git index (if there are already
4+
# commited files)
5+
#
6+
# $ git rm -r --cached .
7+
# $ git add .
8+
# $ git commit -m ".gitignore index rebuild"
9+
#
10+
11+
12+
######################################
13+
# CUSTOM
14+
######################################
15+
16+
.env
17+
log/
18+
run/
19+
20+
21+
22+
23+
######################################
24+
# GENERIC
25+
######################################
26+
27+
###### std ######
28+
.lock
29+
*.log
30+
31+
###### patches/diffs ######
32+
*.patch
33+
*.diff
34+
*.orig
35+
*.rej
36+
37+
38+
######################################
39+
# Operating Systems
40+
######################################
41+
42+
###### OSX ######
43+
._*
44+
.DS*
45+
.Spotlight-V100
46+
.Trashes
47+
48+
###### Windows ######
49+
Thumbs.db
50+
ehthumbs.db
51+
Desktop.ini
52+
$RECYCLE.BIN/
53+
*.lnk
54+
*.shortcut
55+
56+
######################################
57+
# Editors
58+
######################################
59+
60+
###### Sublime ######
61+
*.sublime-workspace
62+
*.sublime-project
63+
64+
###### Eclipse ######
65+
.classpath
66+
.buildpath
67+
.project
68+
.settings/
69+
70+
###### Netbeans ######
71+
/nbproject/
72+
73+
###### Intellij IDE ######
74+
.idea/
75+
.idea_modules/
76+
77+
###### vim ######
78+
*.swp
79+
*.swo
80+
*~
81+
82+
###### TextMate ######
83+
.tm_properties
84+
*.tmproj
85+
86+
###### BBEdit ######
87+
*.bbprojectd
88+
*.bbproject
89+

Diff for: LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 cytopia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Devilbox
2+
3+
The ultimate Docker LAMP/LEMP Stack for local development.
4+
5+
## Specials
6+
7+
* All logs are available on your Host computer
8+
* MySQL localhost socket is available in PHP container
9+
* MySQL `127.0.0.1:3006` is available in PHP container
10+
* Xdebug is included
11+
12+
## Run-time Matrix
13+
14+
You can choose any combination of the following docker images during run-time:
15+
16+
| Webserver | Database | PHP |
17+
|-----------|----------|-----|
18+
| Apache 2.2 | [MySQL 5.5](https://github.com/cytopia/docker-mysql-5.5) | [PHP 5.5](https://github.com/cytopia/docker-php-fpm-5.5) |
19+
| [Apache 2.4](https://github.com/cytopia/docker-apache-2.4) | MySQL 5.6 | [PHP 5.6](https://github.com/cytopia/docker-php-fpm-5.6) |
20+
| Nginx | MySQL 5.7 | [PHP 7.0](https://github.com/cytopia/docker-php-fpm-7.0) |
21+
| | MariaDB 5 | [PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) |
22+
| | MariaDB 10 | |
23+
24+
25+
## Start
26+
27+
1. Copy `env-example` to `.env`
28+
2. Edit `.env`
29+
3. `docker-compose up`

Diff for: bin/apache-2.4/fix-virtual-docroot.php

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
// Fix DocumentRoot for VirtualDocumentRoot Hosts
3+
$_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME']);

Diff for: bin/apache-2.4/splitlogs.php

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
// TODO: logpath could also be passed via CMD argument
5+
// so this script could be more general
6+
$path = "/var/log/apache-2.4";
7+
$fh_timeout = 30; // 30 sek.
8+
9+
$fd = fopen("php://stdin", "r");
10+
11+
while (!feof($fd)) {
12+
13+
$row = fgets($fd);
14+
15+
list($vhost, $h, $l, $u, $t, $r, $s, $b, $referrer, $ua) = explode(";", $row, 10);
16+
17+
if (!isset(${$vhost})) {
18+
${$vhost} = fopen($path . "/" . $vhost . "_access.log", "a+");
19+
}
20+
$lastwrite[$vhost] = time();
21+
fputs (${$vhost}, "$h $l $u $t $r $s $b $referrer $ua");
22+
23+
foreach ($lastwrite as $vhost => $time) {
24+
if ((time() - ($time+30)) >=0) {
25+
fclose(${$vhost});
26+
unset(${$vhost});
27+
unset($lastwrite[$vhost]);
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)