
Gopher プロトコルでこのサイトにアクセスできるようにしたかったので、Wordpress の投稿内容を表示するpython で書かれたスクリプトを試してみる。gopher://odorikani.net でブラウザが対応していれば画像のようになるはず。
まず、https://github.com/LawnGnome/wp-gopher からソースを入手して展開する。場所は何処でも良いけど、とりあえず/usr/loca/src とかにする。
# pwd
/usr/local/src/wp-gopher/
# apt-get install xinetd
# apt-get install python-mysqldb
# vi /etc/xinetd.conf
service gopher
{
disable = no
id = gopher
socket_type = stream
port = 70
protocol = tcp
user = nobody
wait = no
server = /usr/local/sbin/wp-gopher.py
}
# cp wp-gopher.ini.dist /etc/wp-gopher.ini
# vi /etc/wp-gopher.ini
//適切に自分の環境に合わせて設定
# cp wp-gopher.py /usr/local/sbin/
# service xinetd stop
# service xinetd start
# tail -f /var/log/syslog
xinetd Version started with libwrap loadavg options compiled in.
Started working: 1 available service
で、ルータのport forwarding などを設定すれば動くはず。一応gopher でアクセスできるようになってるんだが、どうもpython のスクリプトが問題なのか解らないがうまく動いてない。エラーログとかapache じゃないし解らんなぁ。もしかするとUTF-8 で日本語だからかも。一応スクリプト書いた人はUTF-8 でいけるはずって書いてあるんだけど、その場合は無理かも。
I wanted the server is able to access via gopher protocol and show wordpress contents, so that I tried a script written in python. If your browser can handle gopher protocol, then you can see as the image above: gopher://odorikani.net.
First, get a source from https://github.com/LawnGnome/wp-gopher and extract it. The location can be anything, but I just put it at /usr/loca/src .
# pwd
/usr/local/src/wp-gopher/
# apt-get install xinetd
# apt-get install python-mysqldb
# vi /etc/xinetd.conf
service gopher
{
disable = no
id = gopher
socket_type = stream
port = 70
protocol = tcp
user = nobody
wait = no
server = /usr/local/sbin/wp-gopher.py
}
# cp wp-gopher.ini.dist /etc/wp-gopher.ini
# vi /etc/wp-gopher.ini
//set your environment
# cp wp-gopher.py /usr/local/sbin/
# service xinetd stop
# service xinetd start
# tail -f /var/log/syslog
xinetd Version started with libwrap loadavg options compiled in.
Started working: 1 available service
Then, check router(s) of port forwarding, and it should work. At least gopher protocol is working, but the script does not show logs somehow, though seemingly the script does not look at the database. I cannot figure out the problem because there is no clue where the logs are. The problem would be UTF-8 Japanese though the author mentioned using UTF-8, so I suppose it should work. Anyway, in that case, there is hopeless.
