summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormakoto kuwata <kwa@kuwata-lab.com>2011-03-22 17:27:38 +0900
committermakoto kuwata <kwa@kuwata-lab.com>2011-03-22 17:27:38 +0900
commit3c73ad5758a35a728efc15479e7ed8091b9c51cb (patch)
tree9d853b9b75443101f21e4e7e6c525c4101d5c6f5
parent160257124c780014f9b19fed76c3b3412e332d49 (diff)
downloaderubis-3c73ad5758a35a728efc15479e7ed8091b9c51cb.tar.gz
[add] 'public_html/README.txt'
-rw-r--r--Rookbook.yaml2
-rw-r--r--public_html/README.txt54
2 files changed, 55 insertions, 1 deletions
diff --git a/Rookbook.yaml b/Rookbook.yaml
index 33df4a9..39d1e06 100644
--- a/Rookbook.yaml
+++ b/Rookbook.yaml
@@ -133,7 +133,7 @@ recipes:
end
rm_f "#{dir}/test/Rookbook.yaml", "#{dir}/test/test.log"
#
- store 'public_html/{index.cgi,index.rhtml,_htaccess}', dir
+ store 'public_html/{index.cgi,index.rhtml,_htaccess,README.txt}', dir
#
store 'benchmark/{bench.rb,bench_context.yaml}',
'benchmark/templates/*', 'benchmark/Makefile', dir
diff --git a/public_html/README.txt b/public_html/README.txt
new file mode 100644
index 0000000..0fcedd1
--- /dev/null
+++ b/public_html/README.txt
@@ -0,0 +1,54 @@
+======
+README
+======
+
+This directory contains helper CGI script and files for Apache web server.
+Using these files, it is able to publish *.rhtml as *.html under Apache.
+
+* index.cgi : CGI script
+* _htaccess : .htaccess file for Apache
+* index.rhtml : Example eRuby script
+
+
+Installation
+------------
+
+Steps to install:
+
+ ### install Erubis
+ $ tar xzf erubis-X.X.X.tar.gz
+ $ cd erubis-X.X.X/
+ $ ruby setup.py install
+ ### copy files to ~/public_html
+ $ mkdir -p ~/public_html
+ $ cp public_html/_htaccess ~/public_html/.htaccess
+ $ cp public_html/index.cgi ~/public_html/
+ $ cp public_html/index.rhtml ~/public_html/
+ ### add executable permission to index.cgi
+ $ chmod a+x ~/public_html/index.cgi
+ ### edit .htaccess
+ $ vi ~/public_html/.htaccess
+ ### (optional) edit index.cgi to configure
+ $ vi ~/public_html/index.cgi
+
+
+Edit ~/public_html/.htaccess and modify user name.
+
+~/public_html/.htaccess:
+
+ ## enable mod_rewrie
+ RewriteEngine on
+ ## deny access to *.rhtml and *.cache
+ #RewriteRule \.(rhtml|cache)$ - [R=404,L]
+ RewriteRule \.(rhtml|cache)$ - [F,L]
+ ## rewrite only if requested file is not found
+ RewriteCond %{SCRIPT_FILENAME} !-f
+ ## handle request to *.html and directories by index.cgi
+ RewriteRule (\.html|/|^)$ /~{{*username*}}/index.cgi
+ #RewriteRule (\.html|/|^)$ index.cgi
+
+
+After these steps, *.rhtml will be published as *.html.
+For example, if you access to http:host.domain/~username/index.html
+(or http://host.domain/~username/), file ~/public_html/index.rhtml
+will be displayed.