User Tools

Site Tools


vps:vps4th2nd_10

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
vps:vps4th2nd_10 [2019/04/21 18:29]
vps:vps4th2nd_10 [2019/04/21 18:54]
hoge@hoge [apache 設定]
Line 1: Line 1:
 +====== ブラウザでの desktop 接続 ======
 +prisoner desktop にブラウザで接続する。
 +
 +===== desktop 設定 =====
 +==== pkg ====
 +pkgにて以下を導入。
 +  * xdm
 +  * xsm
 +
 +==== xdm ====
 +prisner desktop 起動時に xdm を起動する。
 +  * /​usr/​local/​etc/​rc.d/​xdm 作成<​code>​
 +#!/bin/sh
 +#
 +
 +# PROVIDE: xdm
 +# REQUIRE: DAEMON ldconfig
 +
 +. /​etc/​rc.subr
 +
 +name="​xdm"​
 +rcvar="​xdm_enable"​
 +command="/​usr/​local/​bin/​xdm"​
 +start_cmd="​xdm_start"​
 +
 +xdm_start()
 +{
 + ${command}
 +}
 +
 +
 +load_rc_config $name
 +run_rc_command "​$1"</​code>​
 +  * /​etc/​rc.conf 編集<​code>​
 +xdm_enable="​YES"​
 +</​code>​
 +  * /​usr/​local/​lib/​X11/​xdm/​Xaccess 編集<​code>​
 +*   #any host can get a login window
 +</​code>​
 +
 +
 +
 +
 +
 +==== TigerVNC ​ ====
 +TigerVNC を inetd で制御する。
 +
 +  * /​etc/​services 編集<​code>​
 +vnc     ​5901/​tcp
 +</​code>​
 +  * /​etc/​inetd.conf 編集<​code>​
 +vnc stream tcp nowait nobody /​usr/​local/​bin/​Xvnc Xvnc -inetd -query localhost -once -geometry 1440x900 -securitytypes=none
 +</​code>​
 +  * /​etc/​rc.conf 編集<​code>​
 +inetd_enable="​YES"​
 +</​code>​
 +
 +
 +===== web 設定 =====
 +==== pkg ====
 +pkgにて、以下を導入。
 +  * novnc
 +  * bash
 +  * git
 +
 +==== WebSockify 設定 ====
 +WebSockify のダウンロードと設定する。
 +  * websockify をダウンロードするため、launch.sh を一度実行する。<​code>​
 +# cd /​usr/​local/​libexec/​novnc/​utils
 +# chmod 744 launch.sh
 +# ./launch.sh
 +<​中略>​
 +Filed to start WebSockets proxy
 +#
 +</​code>​
 +  * /​usr/​local/​libexec/​novnc/​utils/​websockify/​run 修正<​code>​
 +#​!/​usr/​bin/​env python3.6 (python を python3.6 に修正)
 +</​code>​
 +
 +==== novnc 設定 ====
 +novnc 向け設定を行う。
 +  * /​usr/​local/​etc/​rc.d/​novnc を作成する。<​code>​
 +#!/bin/sh
 +#
 +
 +# PROVIDE: novnc
 +
 +PATH=$PATH:/​usr/​local/​bin
 +. /​etc/​rc.subr
 +
 +name="​novnc"​
 +rcvar="​novnc_enable"​
 +command="/​usr/​local/​libexec/​novnc/​utils/​websockify/​run"​
 +command_args=${novnc_options}
 +
 +start_cmd="​novnc_start"​
 +
 +novnc_start()
 +{
 + ${command} ${command_args}
 +}
 +
 +
 +load_rc_config $name
 +run_rc_command "​$1"​
 +</​code>​
 +  * /​etc/​rc.conf を編集する。<​code>​
 +novnc_enable="​YES"​
 +novnc_options="​--daemon 6080 192.168.100.2:​5901"​
 +</​code>​
 +
 +==== apache 設定 ====
 +  * /​usr/​local/​etc/​apache24/​httpd.conf 設定<​code>​
 +LoadModule proxy_module libexec/​apache24/​mod_proxy.so
 +LoadModule proxy_http_module libexec/​apache24/​mod_proxy_http.so
 +LoadModule proxy_wstunnel_module libexec/​apache24/​mod_proxy_wstunnel.so
 +</​code>  ​
 +  * /​usr/​local/​etc/​apache24/​extra/​httpd-ssl.conf 設定<​code>​
 +ProxyRequests Off
 +ProxyPass /websockify ws://​localhost:​6080/​websockify retry=3
 +ProxyPassReverse /websockify ws://​localhost:​6080/​websockify retry=3
 +RedirectMatch permanent /<​パス>​$ /<​パス>/​
 +Alias /<​パス>​ /​usr/​local/​libexec/​novnc
 +<​Directory /​usr/​local/​libexec/​novnc>​
 +    AllowOverride all
 +    Order allow,deny
 +    Allow from all
 +    Require all granted
 +</​Directory>​
 +</​code>​
 +    * /websockify へは reverse proxy 設定
 +    * /​usr/​local/​libexec/​novnc へは alias 設定
 +    * <​パス>​ は推測しにくいものにしたほうが良い?
 +
  
vps/vps4th2nd_10.txt · Last modified: 2019/10/20 23:30 by hoge@hoge