Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts

Nov 16, 2011

CentOS に 最新版の munin をインストール

epel の リポジトリがない場合は追加
rpm --import http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL
rpm -ivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
※ 上記は64bitマシン

epel の enabled を 0 にする。(お好みで)
# vi /etc/yum.repo.d/epel.repo

[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

dag の リポジトリがない場合は追加
# vi /etc/yum.repo.d/dag.repo

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=0

yum でインストール
yum --enablerepo=dag --enablerepo=epel install munin munin-node
※ munin, munin-node はそれぞれ必要に応じて



参考サイト
http://munin-monitoring.org/wiki/LinuxInstallation

Nov 15, 2011

Exim で SMTP ゲートウェイ の設定

/etc/exism/exim.conf の ROUTERS セクションの一番初めに以下の要領で記述します。

send_to_gateway:
  driver = manualroute
  domains = !+local_domains
  transport = remote_smtp
  route_list = * ispgw.smtp.host

これ、ROUTERS セクションの一番最後に追記して、全然設定が反映されず、数時間ハマってしまいました。。

参考サイト

http://www.hserus.net/wiki/index.php/Exim

Aug 19, 2011

Ant の native2ascii で「Couldn't load Kaffe's Native2Ascii class」

Ant のバージョンを上げると、解決するかもです。

以下のバージョンを、
ant-1.6.5

ant-nodeps-1.6.5


jpackageリポジトリの最新版、
ant-1.7.1

ant-nodeps-1.7.1

にアップデートすることで解決しました。


参考サイト

http://osdir.com/ml/java.ejbca.devel/2007-02/msg00007.html


Aug 18, 2011

CentOS 5.5 に、mercurial のインストール

rpmforge のリポジトリにあるのをインストール。

rpmforge のインストールはこちら

yum --enablerepo=rpmforge install mercurial



参考サイト

http://d.hatena.ne.jp/red_snow/20100428/1272423744


Aug 13, 2011

centos 5.5 に、Apache + Tomcat6 な環境を作る

httpd のインストール
sudo yum install httpd


Tomcat のインストール
※ Jpackage のリポジトリを追加しておく。
※ webapps は必要に応じて。
sudo yum --enablerepo=jpackage-generic install tomcat6 tomcat6-webapps


ここで、以下のようなエラーが出る場合がある。
Missing Dependency: /usr/bin/rebuild-security-providers is needed


その場合は、jpackage-utils 5.0 を手動でインストールする。
sudo rpm -Uvh http://plone.lucidsolutions.co.nz/linux/centos/images/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm



参考サイト

http://wiki.hillockhosting.com/yum/usrbinrebuild-security-providers-is-needed/

yum Jpackage リポジトリの追加

su -
rpm --import http://www.jpackage.org/jpackage.asc
wget http://www.jpackage.org/jpackage50.repo -O /etc/yum.repos.d/jpackage.repo
perl -p -i.old -e 's/enabled=1/enabled=0/' /etc/yum.repos.d/jpackage.repo

# 問題なければ
rm /etc/yum.repos.d/jpackage.repo.old


参考サイト

http://www.jpackage.org/

Jan 28, 2011

yum 設定

yum-priorities のインストール

# yum install yum-priorities


公式リポジトリの優先度を1にしておく。

/etc/yum.repos.d/CentOS-Base.repo を編集し priority=1 を追加する。
base, uploads, addons, extras, centosplus, contrib の各リポジトリに設定を追加する。

# vi /etc/yum.repos.d/CentOS-Base.repo

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
...



RPMforge のリポジトリをインストール

# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
# rpm -K rpmforge-release-0.5.2-2.el5.rf.i386.rpm
# rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm


※ デフォルトではOFFにして、-enablerepo=rpmforge のオプションをつけて利用する。

# vi /etc/yum.repos.d/rpmforge.repo

enabled=0



参考サイト



VMware Fusion3: /dev/hdc open failed

Setting up Logical Volume Management: /dev/hdc open failed: no medium found

仮想マシンの設定「CDとDVD」で、CD/DVDの接続のチェックを外していると上記エラーが出る。

特に無害なのでこのままでも問題ない。

VMware Fusion3: starging udev error

起動時に以下のエラーが発生する場合の対応。
基本的に無害なので未対応でもOK。

Starting udev:
udevd[572]: add_to_rules: unknown key 'SUBSYSTEMS'
udevd[572]: add_to_rules: unknown key 'ATTRS{vendor}'
udevd[572]: add_to_rules: unknown key 'ATTRS{model}'
udevd[572]: add_to_rules: unknown key 'SUBSYSTEMS'
udevd[572]: add_to_rules: unknown key 'ATTRS{vendor}'
udevd[572]: add_to_rules: unknown key 'ATTRS{model}'


/etc/udev/rules.d/99-vmware-scsi-udev.rule を編集し、未使用の行はコメントアウト、
RedHat系の場合は以下のように書き換える。

# vi /etc/udev/rules.d/99-vmware-scsi-udev.rule

ACTION=="add", BUS=="scsi", SYSFS{vendor}=="VMware, " , SYSFS{model}=="VMware Virtual S", RUN+="/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'"

To:

ACTION=="add", BUS=="scsi", SYSFS{vendor}=="VMware " , SYSFS{model}=="Virtual disk ", RUN+="/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'"

参考サイト

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1023898

CD-ROMのマウント

手動

$ mount -t iso9660 -o ro /dev/cdrom /media


fstabに記述

# vi fstab

/dev/cdrom /media iso9660 noauto,owner,ro 0 0

CentOS 5.5 i386 on VMware Fusion3 インストール

OSインストール

とりあえずネットワークの設定だけして他は何も入れない。

http://www.centos.org/

最新の状態にアップデート

# yum check-update
# yum update


ntpのインストールと設定

# yum install ntp
# cp -a /etc/ntp.conf /etc/ntp.conf.org
# cat <<INPUT > /etc/ntp.conf
server 210.173.160.57
server 133.100.9.2
restrict default ignore
restrict 127.0.0.1
restrict 210.173.160.57 mask 255.255.255.255 noquery nomodify notrap notrust
restrict 133.100.9.2 mask 255.255.255.255 noquery nomodify notrap notrust
driftfile /etc/ntp/drift
authenticate no
INPUT

※ 上記 NTPサーバのIPアドレスは必要に応じて変更

参考サイト
http://www.ipa.go.jp/security/awareness/administrator/secure-web/chap4/4_ntpd.html
http://www.venus.dti.ne.jp/~yoshi-o/NTP/NTP-Table.html


時刻合わせ

# ntpdate 210.173.160.57


/etc/skel/ に設定追加

# cat <<INPUT >> /etc/skel/.bashrc
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias vi='vim'
INPUT

.vimrc も作成 .vimrcサンプル


ユーザー作成

# groupadd -g gid groupname
# useradd -u uid -g groupname username
# passwd username


/etc/ssh/sshd_config の設定

# vi /etc/ssh/sshd_config

PermitRootLogin no


/etc/inittab の設定

# vi /etc/inittab

tty2-6をコメントアウト


SELinux の無効化

# vi /etc/selinux/config

SELINUX=disabled


ホスト名の変更

# vi /etc/sysconfig/network

HOSTNAME=xxx.xxx.xxx


開発用ツールのインストール

# yum install kernel-headers
# yum install kernel-devel
# yum install gcc


サービス自動起動設定

// ON
# chkconfig ntpd on

// 状況に応じて
# chkconfig autofs off
# chkconfig iptables off
# chkconfig ip6tables off
# chkconfig irqbalance off
# chkconfig messagebus off

# chkconfig netfs off
# chkconfig nfslock off
# chkconfig portmap off
# chkconfig rpcgssd off
# chkconfig rpcidmapd off

# chkconfig anacron off
# chkconfig acpid off
# chkconfig apmd off
# chkconfig atd off
# chkconfig auditd off
# chkconfig avahi-daemon off
# chkconfig bluetooth off
# chkconfig cpuspeed off
# chkconfig --level 1 cpuspeed off
# chkconfig cups off
# chkconfig firstboot off
# chkconfig gpm off
# chkconfig haldaemon off
# chkconfig hidd off
# chkconfig isdn off
# chkconfig kudzu off
# chkconfig lvm2-monitor off
# chkconfig --level 1 lvm2-monitor off
# chkconfig mcstrans off
# chkconfig mdmonitor off
# chkconfig microcode_ctl off
# chkconfig pcscd off
# chkconfig rawdevices off
# chkconfig readahead_early off
# chkconfig readahead_later off
# chkconfig restorecond off
# chkconfig xfs off
# chkconfig sendmail off

# chkconfig smartd off

# chkconfig yum-updatesd off