2020年7月3日 星期五

Xpra + Apache2 proxy (Debian 10.4)

1.安裝 XPRA
echo "deb https://xpra.org/ buster main" >/etc/apt/sources.list.d/xpra.list

apt-get install apt-transport-https
wget -q https://xpra.org/gpg.asc -O- | sudo apt-key add -
apt-get update
apt-get install xpra

2.Apache2 載入模組
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_html
a2enmod proxy_wstunnel

3.修改 Apache2 設定檔,加入
<Location "/xpra">
  RewriteEngine on
  RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
  RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
  RewriteRule .* ws://localhost:14500/%{REQUEST_URI} [P]

  ProxyPass ws://localhost:14500
  ProxyPassReverse ws://localhost:14500

  ProxyPass http://localhost:14500
  ProxyPassReverse http://localhost:14500
</Location>

4.xpra 執行方式
xpra start :100 --start-child=xterm --bind-tcp=0.0.0.0:14500

沒有留言: