File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ services :
2
+ # What to call the service hosting the site. Because there is only
3
+ # one service, it is automatically set as the default service, which
4
+ # does a few things
5
+ # 1. Clones the git repository into the service container
6
+ # 2. Exposes port 80 to the Tugboat HTTP proxy
7
+ # 3. Routes requests to the preview URL to this service
8
+ apache :
9
+ # Use the available version of Apache by not specifying a version
10
+ image : tugboatqa/httpd
11
+
12
+ # A set of commands to run while building this service
13
+ commands :
14
+ # Commands that set up the basic preview infrastructure
15
+ init :
16
+ # Turn on URL rewriting.
17
+ - sed -i 's/AllowOverride None/AllowOverride All/' /usr/local/apache2/conf/httpd.conf
18
+ - sed -i 's/#LoadModule rewrite_module modules\/mod_rewrite\.so/LoadModule rewrite_module modules\/mod_rewrite\.so/' /usr/local/apache2/conf/httpd.conf
19
+
20
+ # Set the webroot for the open-requirements-library folder.
21
+ # Change this if you specify a different root for your public site.
22
+ - ln -snf "${TUGBOAT_ROOT}/open-requirements-library" "${DOCROOT}"
23
+
24
+ # Run any commands needed to build the site.
25
+ build :
26
+ # Error occurred when implementing Tugboat preview.
27
+ # Solution: Inject .htaccess file to mimic GitHub pages behavior with URLs.
28
+ # Solution from: https://serverfault.com/questions/989333/using-apache-rewrite-rules-in-htaccess-to-remove-html-causing-a-500-error.
29
+ - echo "RewriteEngine On" > open-requirements-library/.htaccess
30
+ - echo "RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.html -f" >> open-requirements-library/.htaccess
31
+ - echo "RewriteRule "'!'"\.\w{2,4}$ %{REQUEST_URI}.html [L]" >> open-requirements-library/.htaccess
You can’t perform that action at this time.
0 commit comments