Public Repository

Last pushed: 2 years ago
Short Description
Debian - Linux Apache Php5 Stack (LAPS) HTTP 200 OK Application - No Error Documents
Full Description

#Debian Linux Apache PH5 Stack (LAPS) Docker

200 OK - App

Simple docker.io Dockerfile (Debian:Wheezy 7.7) PHP template (index.php) with .htaccess. An unconditional HTTP 200 OK response is always provided for any request using FallbackResource in .htaccess to index.php; both files are in-lined described within Dockerfile:

##//------------------------------------------------
##// Inject default 200 app with .htaccess
##//------------------------------------------------
RUN rm /var/www/index.html && \
echo "<?php \$_S=&\$_SERVER; if (isset(\$_GET['!_debug'])) phpinfo(); else if (isset(\$_GET['!_who'])) { echo 'IAM:'.\$_S['SERVER_NAME'].' - OF:'.\$_S['SERVER_ADDR'].'<br>-UR:'.\$_S['REMOTE_ADDR'].' - YOF:'.\$_S['HTTP_USER_AGENT']; } else http_response_code(200); ?>" > /var/www/index.php && \
echo "FallbackResource /index.php\n#//^ requests all to index.php, otherwise use targeted ErrorDocumentscodes:\n#//ErrorDocument 404 /index.php" > /var/www/.htaccess
##//------------------------------------------------

Additional GET-Parameters: _!_debug_ (php5info) & _!_who_ (IP & hostname) can be passed in the URL for additional debugging - eg:

http://127.0.0.1/?!_who
http://127.0.0.1/this_is_404/no_path/?!_debug 

Dockerfile is standalone containing all build & run instructions:

cat Dockferfile
# build: docker build -t aphorise/debian-laps200app .
# run: docker run -p 80:80 -p 443:443 -it --detach --name=laps200app aphorise/debian-laps200app
# cli: docker run -p 80:80 -p 443:443 -it --rm --name=laps200app aphorise/debian-laps200app

Adjust leftmost -p numbers if local ports: 80 (http) & 443 (https) are in use on testing machine - for example:

docker run -p 81:80 -p 444:443 -it --rm --name=laps200app aphorise/debian-laps200app

Default /var paths used for apache2 with default /var/www/index.php

To shell into image via /bin/bash simply append instruction to run command eg:

docker run -p 81:80 -p 444:443 -it --rm --name=laps200app aphorise/debian-laps200app /bin/bash

See lapsdev for a fully functioning version in verbose mode.

docker images of build should resemble:

REPOSITORY                 TAG      IMAGE ID   CREATED    VIRTUAL SIZE
aphorise/debian-lap200app  ...         ...       ...       183.1 MB

SEE GITHUB PAGE FOR COMPLETE DETAILS

Docker Pull Command
Owner
aphorise