Skip to content

Matchstic/Apache2-PHP-SSL-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker -- Apache+PHP with SSL via Let's Encrypt

Provides a docker image containing apache2, PHP and SSL certs generated by Let's Encrypt.

Instructions

Run the container via:

docker run --rm \
    -v ${DOCUMENT_ROOT}:/var/www/ \
    -v ${SITES_ENABLED}:/etc/apache2/sites-enabled \
    -p 80:80 \
    -p 443:443 \
    -e "DOMAINS=" \
    -e "WEBMASTER_MAIL=" \
    --name httpd-php-ssl \
    matchstic/httpd-php-ssl:latest

Configuration

  • ${DOCUMENT_ROOT} is the directory on the host containing HTML etc.
  • ${SITES_ENABLED} is a directory containing .conf files detailing virtual hosts for Apache.
  • DOMAINS is a comma-seperated list of domains to fetch SSL certificates for.
  • WEBMASTER_MAIL is self-explanatory.

VirtualHost setup

Each .conf in ${SITES_ENABLED} should follow the template:

<VirtualHost *:80>
    ServerName example.com
    ServerAlias example.com
    DocumentRoot /var/www/
</VirtualHost>

<VirtualHost *:443>
    ServerName example.com
    ServerAlias example.com
    DocumentRoot /var/www/

    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

Extra details

See the following for details (after all, I based this container on them!):

License

Licensed under the MIT license.

About

Docker container providing Apache2 and PHP with SSL support via Let's Encrypt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages