kobapan@wiLiki
Login
Gauche

Gauche:GaucheをCGIとして使う

目次

.htaccessを置いている場合

/home/[USERNNAME]/www/.htaccessに

 DirectoryIndex index.cgi

を追加

動かしてみる

hello.cgi を作成。755にする。

#!/home/hogehoge/bin/gosh
(use www.cgi)
(use text.html-lite)

(cgi-main
 (lambda (params)
   (list
    (cgi-header)
    (html-doctype)
    (html:html
     (html:body
      (html:p "Hello, Gauche!"))))))

ブラウザで見てみて、Hello, Gauche!と表示されれば完了

拡張子.scmで動かしたい場合

/home/USERNNAME/www/.htaccessを以下のように変更

<Files ~ "^.(htaccess|htpasswd)$">
deny from all
</Files>
AddHandler cgi-script .cgi .scm
DirectoryIndex index.html index.php index.cgi index.scm .ht

hello.cgi を hello.scm に名前変更してブラウザで見てみる

Gauche ユーザリファレンス

text.html-lite - シンプルなHTMLドキュメントの構築

www.cgiライブラリを利用する - karetta.jp

  Gauche Scheme Lisp

Debian
Emacs
Firefox
Gauche
JavaScript
Linux
Scheme
org-mode/latex

More ...