How To Set up Erubis

  • Download Erubis from http://www.kuwata-lab.com/erubis/.
  • Install Erubis by following the installation instructions.
  • Copy the Erubis executable to the cgi-bin directory of your web site, you need to make sure all files under the cgi-bin directory run as a CGI script. To configure cgi-bin native with the LSWS console, you need to add a CGI context with URI “/cgi-bin/”, location is the cgi-bin directory. If you access URL /cgi-bin/erubis directly, you should get an error page “500 Internal server error”, this is normal.
  • Add the follow rewrite rule at vhost level or in a .htaccess
RewriteRule (.*\.rhtml)$ /cgi-bin/erubis/$1
  • Create a test Erubis script, for example test.rhtml under the document root.
  • Access the test script from your browser: http://your.site/test.rhtml , the rhtml file will be parsed and rendered with /cgi-bin/erubis.

If this does not work, most likely your rewrite rule has not been configured properly. Your browser may cache the response so you will need to clear your browser cache after changing LSWS configuration.

  • Admin
  • Last modified: 2017/04/21 13:03
  • by Michael Alegre