Created
June 30, 2018 12:24
-
-
Save remie/6fe5c2987374bdaafb265ef3d11fc8bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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