2016-02-01から1ヶ月間の記事一覧

CLSQLでMySQLを使う

1. MySQLのユーザとDBの作成# mysql mysql> GRANT ALL PRIVILEGES ON *.* TO testuser@localhost IDENTIFIED BY 'password' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES;mysql> CREATE DATABASE testdb CHARACTER SET utf8;# mysql -p -u testuser testdb※…

CLSQLでPostgreSQLを使う

1. PostgreSQLのユーザとDBの作成# su - postgres $ createuser -P testuser $ createdb -O testuser testdb $ psql -h localhost -U testuser testdb※接続が正常にできることを確認2. ライブラリのシンボリックリンク作成CLSQLで実際にDBに接続するときにli…

Aserveを常駐プロセス(デーモン)にする

main.lispを編集 (ql:quickload "aserve") (ql:quickload :swank) (defpackage cl-web (:use :cl :swank :net.aserve)) (in-package :cl-web) (require :aserve) (NET.aserve:start :port 5000) (swank:create-server :port 4005 :style :spawn :dont-close …

Aserve & CL-EMB

Aserve でテンプレートエンジンの CL-EMB を使ってみました。hello.tmplを作成 <html> <head><title>テストページ</title></head> <body> <% @var name %> </body> </html> Lipsコード (defun to-octets-string (str) (let* ((arr (sb-ext:string-to-octets str :external-format sb-impl::*default-external-format…

Aserve & Swank によるホットデプロイ

サーバ側 (ql:quickload "aserve") (ql:quickload :swank) (defpackage cl-web (:use :cl :swank :net.aserve)) (in-package :cl-web) (require :aserve) (net.aserve:start :port 5000) (net.aserve:publish :path "/" :content-type "text/html; charset=U…

Aserveで日本語(マルチバイト)表示

Aserveで日本語(マルチバイト)を表示しようとするとできなかったのでこちらのサイトを参考にしました。http://hirodanjyuro.blogspot.jp/2010/06/blog-post.html (defun to-octets-string (str) (let* ((arr (sb-ext:string-to-octets str :external-forma…

ApacheとAserveの連携

http://xxx.xxx.xxx/cl/にアクセスしたときにポート5000でリッスンしているAserveと連携するよう設定します。Apacheの設定ファイル /etc/httpd/conf/httpd.conf の最後に以下の2行を追加しApache再起動します。ProxyPass /cl/ http://localhost:5000/ ProxyP…

AserveでHello World!

Aserveを使ってHTMLを生成してページを表示します。 (ql:quickload "aserve") (require :aserve) (net.aserve:start :port 5000) (net.aserve:publish :path "/" :content-type "text/html; charset=UTF-8" :function #'(lambda (req ent) (net.aserve:with-…