phpでCGI/CLIモードの場合だけエラー表示
# vi php.ini
; To output errors to STDERR with CGI/CLI:
display_errors = "stderr"
続きを読む >
PHP Mecab Extensionのインストール方法
# cd /usr/local/src
# wget http://page2.xrea.jp/pub/php_mecab-0.2.0.tgz
# tar -xvzf php_mecab-0.2.0.tgz
# cd php_mecab-0.2.0
# /usr/local/bin/phpize
# ./configure --with-php-config=/usr/local/bin/php-config --with-mecab=/usr/bin/mecab-config
# make
# make install
<?php
dl('mecab.so');
$t = new MeCab_Tagger();
$str = 'すもももももももものうち';
echo $t->parse($str);
?>
続きを読む >
Mecab0.97 ユーザ辞書の作成方法
cd /home/xxx/dic
辞書ファイルを設置vi category_dic.csv
単語を追加※活用しない単語のフォーマットは下記の通り
ビジネスシューズ,1285,1285,-800,ファッションカテゴリー,靴,ビジネスシューズ,ビジネスシューズ,2,1
辞書のコンパイル/usr/libexec/mecab/mecab-dict-index -d/usr/lib/mecab/dic/ipadic -u /home/xxx/dic/category_dic.dic -f utf-8 -t utf-8 /home/xxx/dic/category_dic.csv
mecabrcをユーザルートにコピーcp /usr/etc/mecabrc ~/.mecabrc
.mecabrcでユーザ辞書を指定userdic = /home/xxx/dic/category_dic.dic
続きを読む >
Apache2.2.9 インストール
#wget http://ftp.kddilabs.jp/infosystems/apache/httpd/httpd-2.2.9.tar.gz
#tar -xvzf httpd-2.2.9.tar.gz
#cd httpd-2.2.9
#./configure --prefix=/etc/httpd --enable-rewrite --enable-headers --enable-auth-digest --enable-ssl --enable-proxy --enable-proxy-balancer --enable-status
#make
#make install
#vi /etc/init.d/httpd
------------------------------------------------------------
#!/bin/sh
#
# chkconfig: 35 85 15
# description: apache 2.2.3
apachectl="/etc/httpd/bin/apachectl"
case "$1" in
start|stop|restart|fullstatus| \
status|graceful|graceful-stop| \
configtest|startssl)
$apachectl $@
;;
*)
;;
esac
------------------------------------------------------------
#chmod 755 /etc/init.d/httpd
#chkconfig --add httpd
#chkconfig --list httpd
続きを読む >
Apache HTTPヘッダ情報の隠匿
Server: Apache/2.0.52 (CentOS)
↓↓↓↓↓
Server: Apache
ServerSignature Off
ServerTokens ProductOnly
を追加
X-Powered-By: PHP/4.3.9
↓↓↓↓↓
削除
expose_php = On
を
expose_php = Off
に変更
続きを読む >
Mac OSXでSubversion + SSH公開鍵認証の設定
ちなみにCentOSでSubversionをインストールするには
#yum install subversion
だけで簡単にインストールできます。
1.クライアント(MacOSX)にsubversionのインストール
http://www.collab.net/downloads/community/
2.クライアント(MacOSX)にSCPlugin-0.7.1のインストール
http://scplugin.tigris.org/servlets/ProjectDocumentList
SCPluginをインストールした後、一度Macを再起動します。
3.SSH公開鍵認証の設定
[クライアント(MacOSX)]
$cd /Users/hogehoge/.ssh
$ssh-keygen -t dsa
Enter file in which to save the key (/Users/yuji/.ssh/id_dsa):identity
Enter passphrase (empty for no passphrase): 空のまま
Enter same passphrase again: 空のまま
$scp ./identity.pub hogehoge@xxx.xxx.xxx.xxx:/home/hogehoge/.ssh/id_dsa.pub
[サーバ(CentOS5.1)]
$cd /home/hogehoge/.ssh
$su root
#vi /etc/ssh/sshd_config
PermitRootLogin no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
#RhostsRSAAuthentication no
#PasswordAuthentication yes
$chmod 755 ../.ssh
$touch authorized_keys
$chmod 600 authorized_keys
$cat id_dsa.pub >> authorized_keys
$su root
#/sbin/service sshd restart
$ssh hogehoge@xxx.xxx.xxx.xxx
4.最後はチェックアウトできるか確認します。
クライアント(MacOSX)で任意のフォルダに移動して、右クリック
[その他] > [Subversion] > [Checkout]
を選択して下記のように設定して「Checkout」すれば完了!!
レポジトリURL:svn+ssh://hogehoge@xxx.xxx.xxx.xxx/home/hogehoge/svn/repos/trunk
ユーザ:Anonymous
続きを読む >
ベーシック認証(Apache編)
まずは、httpd.confの設定
AllowOverride All
次に.htaccessファイルの作成
AuthUserFile /ルートからのフルパス/.htpasswd
AuthGroupFile /dev/null
AuthName "Please Enter Your Password"
AuthType Basic
Require user ユーザ名
htpasswd -c .htpasswd ユーザ名
以上。続きを読む >
Linux NTPで時刻合わせ
#ntpdate NTPサーバのIPアドレス or ドメイン
# ntpdate eric.nc.u-tokyo.ac.jp
31 May 12:41:16 ntpdate[1303]: step time server 130.69.251.23 offset -86599.332503 sec
続きを読む >
C++ 文字コード関連ライブラリ icu4c
#wget http://download.icu-project.org/files/icu4c/4.0/icu4c-4_0_d01-src.tgz
#tar -xvzf icu4c-4_0_d01-src.tgz
#cd icu/source/
#./configure
#make
#make install
続きを読む >
C++ XMLパーサー Xerces-C++のインストール
#cd /usr/local/lib
#wget http://ftp.kddilabs.jp/infosystems/apache/xerces/c/sources/xerces-c-src_2_8_0.tar.gz
#tar -xvzf xerces-c-src_2_8_0.tar.gz
#cd xerces-c-src_2_8_0/src/xercesc/
#export XERCESCROOT=/usr/local/lib/xerces-c-src_2_8_0
#./runConfigure -p linux -c gcc -x g++
#make
#make install
続きを読む >
Categories
latest entries
Copyright © 2008 hidamari.biz All Rights Reserved.
