固定IPアドレスの設定 [Debian]
固定IPアドレスに設定した際にDNSサーバーの設定方法を忘れたので、メモ。
IPアドレス(/etc/network/interfaces)
allow-hotplug eth0
iface eth0 inet static
address ***.***.***.***
netmask 255.255.255.0
network ***.***.***.0
broadcast ***.***.***.255
gateway ***.***.***.*** ← デフォルト
dns-nameservers ***.***.***.*** ← "apt-get install resolvconf"実行後設定する
VNCのインストール [Debian]
1.インストール
# apt-get install vnc4server
2.初期設定
VNCで入りたいユーザーでログインし、
# vnc4server
を実行する。
パスワードを聞いてくる。(確認込みで2回)
# vi ~/.vnc/xstartup
で
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
の先頭の#をはずす
3.自動起動の設定
(1) /etc/init.d/vncserverを作成
内容は、以下のとおり
#!/bin/sh -e ### BEGIN INIT INFO # Provides: vncserver # Required-Start: networking # Default-Start: 2 3 4 5 # Default-Stop: 0 6 ### END INIT INFO PATH="$PATH:/usr/X11R6/bin/" # The Username:Group that will run VNC export USER="ユーザー名に変更" #${RUNAS} # The display that VNC will use DISPLAY="1" # Color depth (between 8 and 32) DEPTH="16" # The Desktop geometry to use. #GEOMETRY="<WIDTH>x<HEIGHT>" #GEOMETRY="800x600" GEOMETRY="1024x768" #GEOMETRY="1280x1024" # The name that the VNC Desktop will have. NAME="vnc-server" OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}" . /lib/lsb/init-functions case "$1" in start) log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver ${OPTIONS}" ;; stop) log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}" ;; restart) $0 stop $0 start ;; esac exit 0
(2)実行権限の付加
# chmod +x /etc/init.d/vncserver
(3)自動起動の設定
# insserv -d vncserver
なにか大事なことをメモるのを忘れているような・・・
参考:
(ランレベルに関して)