eoffice server update memo
研究室のサーバーを10.1にアップデートしたときのメモ。完全に自分向け。
unbound
BINDからunboundへ移行する。
% diff /etc/unbound/unbound.conf /etc/unbound/unbound.conf.ORG 3,6d2 < interface: 127.0.0.1 < interface: 192.168.11.10 < access-control: 127.0.0.1/32 allow < access-control: 192.168.11.0/24 allow 11c7 < #auto-trust-anchor-file: /var/unbound/root.key --- > auto-trust-anchor-file: /var/unbound/root.key
自分自身とローカルネットワークからのアクセスを許可する。auto-trust-anchor-file:行は、DNSSECを有効にするもので、これがあると上流に名前が引けなくなったのでコメントアウト。
デフォルトの/etc/unbound/unbound.confでは、
include: /var/unbound/conf.d/*.conf
とあるので、/etc/unbound/conf.dにローカルのデータを置いておいた。
% head -10 /etc/unbound/conf.d/eoffice.lan.conf local-zone: "eoffice.lan." static local-data: "eoffice.lan. NS hermes.eoffice.lan." local-data: "hermes.eoffice.lan. A 192.168.11.10" local-data: "10.11.168.192.in-addr.arpa. PTR hermes.eoffice.lan." local-data: "mercury.eoffice.lan. A 192.168.11.11" local-data: "11.11.168.192.in-addr.arpa. PTR mercury.eoffice.lan." local-data: "venus.eoffice.lan. A 192.168.11.12" local-data: "12.11.168.192.in-addr.arpa. PTR venus.eoffice.lan." local-data: "aphrodite.eoffice.lan. A 192.168.11.13" local-data: "13.11.168.192.in-addr.arpa. PTR aphrodite.eoffice.lan." %
上流は、192.xx.xx.123。
/etc/unbound/forward.conf
% cat /etc/unbound/forward.conf # Generated by local-unbound-setup # Do not edit this file. forward-zone: name: . forward-addr: 192.xx.xx.123 %
/etc/rc.conf
local_unbound_enable="YES"
NIS
/etc/rc.confの中で
# # portmap # rpcbind_enable="YES" # # NIS # nisdomainname="eoffice"
を有効にして、再起動。
/var/yp にmaster.passwdとypserversを作成
% less /var/yp/ypservers hermes.eoffice.lan hermes.eoffice.lan %
このあと、ユーザー関連のgroupを/etc/groupに追加する。
# cd /var/yp # make
最終的な/etc/rc.confは、次のようにする。
# # portmap # rpcbind_enable="YES" # # NIS # nisdomainname="eoffice" nis_client_enable="YES" nis_client_flags="-S eoffice,hermes.eoffice.lan" nis_server_enable="YES" nis_yppasswdd_enable="YES" nis_yppasswdd_flags="-t /var/yp/master.passwd"
NFS
% less /etc/exports /home -alldirs -maproot=root:wheel -network=192.168.11 %
/etc/rc.conf
# # NFS # nfs_client_enable="YES" nfs_server_enable="YES" rpc_lockd_enable="YES" rpc_statd_enable="YES"
NTP
上流は172.xx.xx.1とする。
% diff /etc/ntp.conf /etc/ntp.conf.ORG 22,24c22,24 < #server 0.freebsd.pool.ntp.org iburst < #server 1.freebsd.pool.ntp.org iburst < #server 2.freebsd.pool.ntp.org iburst --- > server 0.freebsd.pool.ntp.org iburst > server 1.freebsd.pool.ntp.org iburst > server 2.freebsd.pool.ntp.org iburst 26,27d25 < server 172.xx.xx.1 iburst < server ntp.nict.jp 71d68 < restrict 192.168.11.0 mask 255.255.255.0 noquery nomodify notrap 83d79 < driftfile /var/db/ntpd.drift %
わかりにくいので有効な行だけを表示すると次のようになる。
% cat /etc/ntp.conf | grep -v '^#' | grep -v '^$' server 172.xx.xx.1 iburst server ntp.nict.jp restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 restrict 127.127.1.0 restrict 192.168.11.0 mask 255.255.255.0 noquery nomodify notrap driftfile /var/db/ntpd.drift %
/etc/rc.conf
ntpd_enable="YES"
Samba
ファイル名をutf-8に変更した。
% diff /usr/local/etc/smb.conf /usr/local/etc/smb.conf.ORG 24,28d23 < # Japanese setting. < < dos charset = CP932 < unix charset = UTF8 < display charset = UTF8 31c26 < workgroup = EOFFICE --- > workgroup = MYGROUP 46c41 < hosts allow = 192.168.11. 127. --- > ; hosts allow = 192.168.1. 192.168.2. 127. 90c85 < passdb backend = smbpasswd --- > ; passdb backend = tdbsam 170c165 < map archive = no --- > ; map archive = no 312,321d306 < # Simple Public Space < [public] < comment = Public Space < path = /home/public < guest ok = yes < read only = no < force group = user < force create mode = 0664 < force directory mode = 0775 < map archive = no %
[global]に、map archive = noを追加した。
# ypcat passwd | make_smbpasswd > /usr/local/etc/samba/smbpasswd # smbpasswd -e username
/etc/rc.conf.local
samba_enable="YES"