Modular Apache httpd configuration.
Created especially for quick and pre-configured Apache deployment across Linux/FreeBSD. Pre-configuration is picked as basic as possible, however with common best practices in mind.
By default includes two virtual hosts with common DocumentRoot
directory: HTTP Virtualhost at localhost:80
with unconditional redirect to the second 'work' HTTPS Virtualhost at localhost:443
.
Some well-tested configuration examples/snippets are included. FCGId module is included as well.
By default deploy/deploy.sh
automatically backups the previous configuration directory with .ORIG
suffix.
IMPORTANT: By default deploy/deploy.sh
generates a PLAIN private key and a 'blank' 3-year self-signed X.509 SSL certificate at /etc/ssl
, so if you'd like to don't do this, update deploy/deploy.sh
at the step 2 below accordingly.
- Download deployment script:
curl -fsSL https://raw.githubusercontent.com/vvvggg/httpd-config/master/deploy/deploy.sh > /tmp/deploy.sh
- Update
/tmp/deploy.sh
Configuration defaults up to your needs:domain_name
,server_admin
,document_root
, maybessl_*
as well. - Run
sudo bash /tmp/deploy.sh
- Place at
$document_root
whatever you want to - Enjoy or raise a GitHub issue
Main configuration parameters (aka constants) are described in conf/httpd.conf
and deploy/deploy.sh
.
By default deploy/deploy.sh
and the tests generate (and leave) files into DocumentRoot
directory, so EVERYTHING there can be easily removed or changed up to you.
To build a Docker image httpd-config-test
and run a container apache-test
based on it, you can do:
curl -fsSL https://raw.githubusercontent.com/vvvggg/httpd-config/master/docker/Dockerfile > /tmp/Dockerfile
docker build --no-cache=true -t httpd-config-test /tmp/
To run the image has being built in a container:
docker run -dit -p 80:80 -p 443:443 httpd-config-test
Or you can get and run the container from the image at Docker Hub Registry:
docker run -dit -p 80:80 -p 443:443 veguss/httpd-config
Finally, check the container running ok and the result:
docker ps
curl -kfsSL localhost
In general, you can use curl -ksSL localhost
to get the result of the default httpd-config
deployment, however, there is more covered automation:
use test/test.sh
for complete out-of-the-box tests run and test/test_custom.sh
for your own ones.
Successfully last tested with:
- Apache httpd 2.4.18-2ubuntu3.5 on Ubuntu 16.04.3 LTS
- Apache httpd 2.4.6-67.el7.centos.6 on CentOS 7.4
- Apache httpd 2.4.29 on FreeBSD 11.1-RELEASE-p6
- Apache httpd 2.4.18 on Docker 17.12.0-ce with ubuntu:16.04
- TravisCI (Ubuntu 14.04 host)