LoginSignup
4
3

More than 5 years have passed since last update.

オンラインでプログラミングして実行できるwandboxをさくらのVPSで立ち上げる

Last updated at Posted at 2016-05-05

オンラインでプログラミングして実行できるサイトの中でも優れたwandboxを自前で用意する.

使ったのは「さくらのVPS」で,「ubuntu 14.04LTS」をカスタムOSでインストール.
ちなみに,DTIのServerMan@VPSではkernelを変更できないので,setcapが実行できず,cattleshedが動かないため,wandboxには使えない.

wandboxのインストールと設定

sudoできるユーザーで,以下のシェルスクリプトを実行.
https://gist.github.com/tttamaki/658e1e5baf0471b120a67d57736bf45c

基本はwandboxを自前サーバに一般ユーザーで導入する方法を参考.

追加

インデント単位を2にする

--- ./wandbox/kennel2/static/js/root.js.org 2016-05-05 17:24:21.907327940 +0900
+++ ./wandbox/kennel2/static/js/root.js     2016-05-30 17:25:40.712037317 +0900
@@ -365,7 +365,7 @@
   var codemirror = CodeMirror(elem[0], {
     lineNumbers: true,
     theme: 'user',
-    indentUnit: 4,
+    indentUnit: 2,
     extraKeys: {
       'Ctrl-Enter': function() {
         if (self.onrun)

セキュリティ設定

iptables

wandboxがデフォルトでは3500番ポートで待っているので,それを許可

iptabesで設定
sudo iptables -A INPUT -p tcp -m tcp --dport 3500 -j ACCEPT

これ以外は,一般的なiptablesの設定を参考にする

その他

  • rootログイン不許可
  • パスワードログインは不許可,sshは公開鍵で
  • sshポートを変更

情報は検索すれば見つかります.

自動update

unattended-upgradesを利用
sudo apt-get instal unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades

DNS

どこかでDNSを利用したら,kennel.jsonの"domain"に書いておく.

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3