‘CentOS’ カテゴリーのアーカイブ

webdav SSL設定

2010年7月1日 木曜日

以下コマンドでdav_moduleが読み込まれているか確認
# httpd -M

以下を/var/httpd/conf.d/ssl.confに挿入

### DAV 有効化 ###
Dav On
### IP 制限 ###
Order allow,deny
Allow from 192.168.0.100
### 基本認証 ###
AuthType Basic
AuthBasicProvider file
AuthUserFile /var/www/dav/conf/.htpasswd
AuthGroupFile /dev/null
AuthName “Please enter your ID and password”
Require user username

参考サイト:
http://c-brains.jp/blog/wsg/10/05/20-091807.php
http://kajuhome.com/webdav.shtml

phpmyadminインストール

2010年6月11日 金曜日

yum install phpmyadmin

続く………予定

Logwatch 自作スクリプト

2010年6月8日 火曜日

Logwatch自身のconfファイルとディレクトリ:
/usr/share/logwatch/script/default.conf/logwatch.conf

Script File Directory: /usr/share/logwatch/script/services/File_Name
(ここに自作シェルスクリプトを置く)

Config File Directory: /usr/share/logwatch/Default.conf/services/File_Name.conf
(ここにはconfファイル、今回はzz-disk_space.confをコピーし編集)

上記2つのファイルがあればLogwatchとして機能する。

参考サイト:
http://jviz.research.iat.sfu.ca/wiki/index.php?title=Customizing_Logwatch

http://www.atmarkit.co.jp/fsecurity/rensai/iprotect06/iprotect02.html

http://www.gobu.jp/osfc4_3.php

Daylight Saving Time対応状況確認コマンド

2010年3月12日 金曜日

# zdump -v /etc/localtime | grep 2010
/etc/localtime Sun Mar 14 07:59:59 2010 UTC = Sun Mar 14 01:59:59 2010 CST isds
/etc/localtime Sun Mar 14 08:00:00 2010 UTC = Sun Mar 14 03:00:00 2010 CDT isds
/etc/localtime Sun Nov 7 06:59:59 2010 UTC = Sun Nov 7 01:59:59 2010 CDT isds
/etc/localtime Sun Nov 7 07:00:00 2010 UTC = Sun Nov 7 01:00:00 2010 CST isds

NTPクライアント設定

2010年3月9日 火曜日

# ntpdate server_name
# chkconfig –list ntpd
# chkconfig ntpd on
# ntpq -p server_name

/etc/ntp.confに以下を残し後はコメント

server -4 server_name1 # Primary NTP Server
server -4 server_name2 # Secondary NTP server
driftfile /var/lib/ntp/drift

その他コマンド:
# clock;date #ClockはBIOS時間、dateはシステム時間を表示
# clock -w #システム時間をBIOS時間に書き込みます

Cron Job設定:(毎日午前0時に正確なシステム時間をBIOSに書き込む)
0 0 * * * /sbin/clock -w

参照サイト:
http://www.oiden.net/Flets/bangai02/
http://sj6.org/ntp_install_for_centos/
http://www.obenri.com/_ntp_sshserver/ntpconf5.html
http://www.obenri.com/_ntp_sshserver/image/ntp_conf5_sample.txt

Logrotation

2010年2月17日 水曜日

/etc/logrotate.d/以下の設定ファイル例:
lastaction~endscript間で、messages.1からmessages.1日遅れの日付でのファイル名messages.${EXT}が作られる。2ヶ月後に/var/log/archives/messages/へgzipされファイル移動される。

/var/log/messages {
daily
rotate 100
missingok
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
lastaction
EXT=`date -d ‘1 day ago’ +%Y%m%d`
ODATE=`date -d ‘2 month ago’ +%Y%m%d`

/bin/mv -f /var/log/messages.1 /var/log/messages.${EXT}

if [ -f /var/log/messages.${ODATE} ];
then
/bin/gzip -9 /var/log/messages.${ODATE}
/bin/mv -f /var/log/messages.${ODATE}.gz /var/log/archives/messages/
fi
endscript
}

参照サイト
http://satospo.sakura.ne.jp/blog_archives/tech/centos/logrotate_conf.html

VNCサーバのインストール

2010年2月12日 金曜日

環境
VNCClient: IE7.0
OS: CentOS5.4

設定したいユーザアカウントでパスワード設定
$ cd ~
$ mkdir .vnc
$ vncpasswd ./.vnc/passwd

VNCを利用するユーザを登録
# cp -ip /etc/sysconfig/vncservers /etc/sysconfig/vncservers.org

以下に変更(複数登録の場合)
# vi /etc/sysconfig/vncservers
VNCSERVERS=”1:username1 2:username2″
VNCSERVERARGS[1]=”-geometry 1280×960 -depth 16″
VNCSERVERARGS[2]=”-geometry 800×600 -depth 16″

サービススタート
# service vncserver start

サーバ起動時に立ち上がるよう設定
# chkconfig –level 5 vncserver on
# chkconfig –list vncserver
vncserver 0:off 1:off 2:off 3:off 4:off 5:on 6:off

xstartupの編集
$defaultXStartup
  = (“#!/bin/sh\n\n”.
    “# Uncomment the following two lines for normal desktop:\n”.
    “unset SESSION_MANAGER\n”.
    “exec /etc/X11/xinit/xinitrc\n\n”.
    “#[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n”.
    “#xsetroot -solid grey\n”.
    “#vncconfig -iconic &\n”.
    “#xterm -geometry 80×24+10+10 -ls -title \”\$VNCDESKTOP Desktop\” &\n”.
    “#twm &\n”);

参照サイト
http://www.obenri.com/_vnc/vnc_control.html
http://pocketstudio.jp/linux/?FC4%2FVNC%A4%CB%A4%E8%A4%EB%A5%EA%A5%E2%A1%BC%A5%C8%A4%AB%A4%E9%A4%CE%20X%20Window%20%C1%E0%BA%EE