Docker Image with Apache 2.4 and PHP 5.6 on ubuntu:latest
307
This pulls ubuntu:latest, installs apache2.4 and php5.6, gives you volumes for the /var/www/html and /etc/apache2/sites-enabled so you can manage your web content and config files out of the container. Specifically, this is useful for WordPress and custom PHP/MySQL web applications.
It also comes preconfigured with mod_rpaf in case you are running this behind a proxy, so you can log the remote host IP correctly.
Github repository: https://github.com/emcconkey/apache-php56
You should mount a volume at /var/www/html/ and store your html/php files there.
docker run --name apache-php -d -p 8080:8000 \
-v /host/path/to/html:/var/www/html/ \
-v /host/path/to/logs:/var/log/apache2/ \
emcconkey/apache-php
Copy your html/php files to /host/path/to/html and then go to the server:port combination you set up.
If you want to change the apache config, map a volume to /etc/apache2/sites-enabled and put your own apache config file there.
docker run --name apache-php -d -p 8080:8000 \
-v /host/path/to/html:/var/www/html/ \
-v /host/path/to/logs:/var/log/apache2/ \
-v /host/path/to/config:/etc/apache2/sites-enabled \
emcconkey/apache-php
Put as many *.conf files as you want in /host/path/to/config and apache will load them on startup.
Variable: APACHE_RUN_USER Default: webuser (uid 1000)
Variable: APACHE_RUN_GROUP Default: webuser (gid 1000)
Variable: APACHE_LOG_DIR Default: /var/log/apache2
Variable: APACHE_LOCK_DIR Default: /var/lock/apache2
Variable: APACHE_PID_FILE Default: /var/run/apache2.pid
Variable: RPAF_PROXY_SERVER Default: 127.0.0.1
8000 is the default port apache listens on internally.
The following volumes are available to be mapped:
/etc/apache2/sites-enabled/
/var/www/html/
/var/log/apache2/
Unless you need to change the config file for something specific, you may not need to map that. It's recommended that you map the log files so they don't fill up your container.
See https://www.conetix.com.au/blog/docker-basics-linking-and-volumes for a tutorial on how to link your containers.
You should map /var/log/apache2/ to an appropriate location to capture the logfiles outside of the container.
The following PHP extensions are enabled. Output of get_loaded_extensions()
Core
date
ereg
libxml
openssl
pcre
zlib
filter
hash
pcntl
Reflection
SPL
session
standard
mysqlnd
PDO
calendar
ctype
curl
mbstring
fileinfo
ftp
gd
gettext
iconv
json
exif
mcrypt
mongo
mysql
mysqli
pdo_mysql
Phar
posix
readline
shmop
soap
sockets
sysvmsg
sysvsem
sysvshm
tokenizer
mhash
Zend OPcache
The following apache modules are enabled. Output of apache2ctl -M
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php5_module (shared)
remoteip_module (shared)
rewrite_module (shared)
rpaf_module (shared)
setenvif_module (shared)
status_module (shared)
Apache + PHP docker image is open-sourced software licensed under the MIT license
Content type
Image
Digest
Size
107.9 MB
Last updated
over 8 years ago
docker pull emcconkey/apache-php56