Skip to content

Instantly share code, notes, and snippets.

@remie
Created June 30, 2018 12:24
Show Gist options
  • Save remie/6fe5c2987374bdaafb265ef3d11fc8bb to your computer and use it in GitHub Desktop.
Save remie/6fe5c2987374bdaafb265ef3d11fc8bb to your computer and use it in GitHub Desktop.
#!/bin/bash
## Add an additional configuration file to Apache for testing purposes
echo "Include /usr/local/apache2/conf.d/redirect-test.conf" >> /usr/local/apache2/conf/httpd.conf;
cat >> /usr/local/apache2/conf.d/redirect-test.conf <<EOF
RewriteCond %{HTTP_HOST} ^example.org$ [NC]
RewriteRule ^/(.*)$ http://mydomain.com/$1 [R=302,L]
EOF
## Start Httpd
httpd
## Run tests
npm install
exec node_modules/.bin/mocha
## Cleanup additional Apache configuration file
echo '' > /usr/local/apache2/conf.d/redirect-test.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment