Dockerised Apache 2 image with standard modules enabled.
10K+
An Apache image that uses the httpd image with Alpine as the OS.
This list does not include the default loaded modules.
Using this file is easier to configure compared to running it via commands with docker.
version: "3.1"
services:
web:
image: johnnyhuy/apache
ports:
- 80:80
- 443:433
To edit the main configuration file, you must copy the httpd.conf file from the container and mount the file using volumes. Run the following commands:
docker-compose.yml filedocker-compose up -d
docker run -d johnnyhuy/apache
Replace tokens in [] to required information.
docker cp [CONTAINER NAME]:/usr/local/apache2/conf/httpd.conf [DESTINATION]
docker-compose.yml fileAdd the volumes option in the config to mount. Replace tokens in [] to required information.
version: "3.1"
services:
web:
image: johnnyhuy/apache
ports:
- 80:80
- 443:433
volumes:
- [LOCATION OF COPIED .CONF]:/usr/local/apache2/conf/httpd.conf
docker run -d -v [LOCATION OF COPIED .CONF]:/usr/local/apache2/conf/httpd.conf johnnyhuy/apache
Follow the same steps as the Editing httpd.conf section above, but with some additional steps.
Edit the config file to include the httpd-ssl.conf file that includes all SSL related configurations. This file is located at /usr/local/apache2/conf/extra/httpd-ssl.conf on the image. Uncomment the include line as shown:
</IfModule>
...
# Secure (SSL/TLS) connections
# Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
...
...
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
...
Replace /usr/local/apache2/conf/httpd.conf to /usr/local/apache2/conf/extra/httpd-ssl.conf .
Be sure to check where your SSL certificates are located and mount the files using volumes.
Content type
Image
Digest
Size
29.5 MB
Last updated
almost 9 years ago
docker pull johnnyhuy/apache