VagrantのCentOS7でWebサイトの脆弱性の勉強を使用とおもい、環境を用意しています。
とりあえず、PHPを勉強するのは後に回そうと思うので、ERBを使いたいと思うのですが、うまく動きません。
apacheはデフォルトのままです。
下記の.htaccessとeruby.rbを/var/www/htmlにおいています。
http://server_address/index.rhtmlにアクセスしても
<% puts "Hello" %>
こんな感じにそのまま表示されてしまうんです。
何が足りないんでしょうか。。。?
.htaccess
AddType application/x-httpd-eruby .rhtml Action application/x-httpd-eruby /eruby.rb
eruby.rb
#!/usr/local/bin/ruby require 'erb' require 'cgi' puts 'Content-Type: text/html; charset=utf-8' puts ERB.new(IO.read(CGI.new.path_translated)).run
index.rhtml
<% puts "Hello" %>
あなたの回答
tips
プレビュー