Fedora Core 8にJDK1.6のインストール
#chmod 755 jdk-6u7-linux-i586-rpm.bin
#./jdk-6u7-linux-i586-rpm.bin
#cd /usr/local
#ln -s /usr/java/jdk1.6.0_07 ./java
#vi ~/.bash_profile
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin:$PATH
以上
続きを読む >
Linux(CentOS 5.1)でのNFS設定
NFSを正常に動作させる為には、サーバとクライアントで使用するユーザIDおよびグループIDが一致する必要があります。まずは、サーバ側のユーザIDとグループIDを変更します。
hogeユーザの現状を確認
# id -a hoge
uid=500(hoge) gid=500(hoge) 所属グループ=500(hoge)
クライアント側で500番は使用されている可能性が高いので、これを2000に変更します。
まずはhogeグループのグループIDを変更します。
# groupmod -g 2000 hoge
次にhogeユーザのユーザIDを変更します。
# usermod -u 2000 hoge -g hoge
設定が正常に反映したか確認します。
# id -a hoge
uid=2000(hoge) gid=2000(hoge) 所属グループ=2000(hoge)
上記のように500番だったIDが2000番に変更されていれば、設定は完了です
次に、NFSサーバ設定ファイルを編集します。
# vi /etc/exports
/home/hoge 192.168.11.2(rw)
設定の変更を反映します。
# exportfs -ra
/home/hoge:マウントの対象となるディレクトリ
192.168.11.2(rw):マウントを許可するIPおよびその権限
次に、NFSサーバを起動します。
# /etc/rc.d/init.d/nfs start
NFSサーバマシンを起動する際に自動的にNFSを起動するには、下記のコマンドを使用します。
# chkconfig nfs on
これでサーバの設定は完了です。
サーバ側と同様に、ユーザIDおよびグループIDを200番に合わせます。
まずは、サーバ側と同じhogeユーザを作成します。
# adduser hoge
# passwd hoge
hogeユーザの現状を確認
# id -a hoge
uid=518(hoge) gid=518(hoge) 所属グループ=518(hoge)
まずはhogeグループのグループIDを変更します。
# groupmod -g 2000 hoge
次にhogeユーザのユーザIDを変更します。
# usermod -u 2000 hoge -g hoge
設定が正常に反映したか確認します。
# id -a hoge
uid=2000(hoge) gid=2000(hoge) 所属グループ=2000(hoge)
次に、Linuxクライアントを起動する際に自動的にマウントするようにします。
# vi /etc/fstab
192.168.11.201(サーバのIP):/home/hoge(サーバのマウント対象) /home/hoge nfs rw 0 0
上記の記述を追加します。
続きを読む >
Apache mod_pythonをインストール
# cd /usr/local/src
# wget http://ftp.riken.jp/net/apache/httpd/modpython/mod_python-3.3.1.tgz
#tar -xvzf mod_python-3.3.1.tgz
#cd mod_python-3.3.1
#./configure --with-apxs=/etc/httpd/bin/apxs
#make
#make install
#vi /etc/httpd/conf/httpd.conf LoadModule python_module modules/mod_python.so #/etc/init.d/httpd restart
続きを読む >
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 ユーザ名
以上。続きを読む >
Categories
latest entries
Copyright © 2008 hidamari.biz All Rights Reserved.
