GCPでプロキシサーバ設置squidの導入

Posted on 2017/07/30 in tech • Tagged with proxy, linux, gcp, ubuntu

Webサイトを別サーバーに移転してあるタイミングでサーバーにアクセスできなくなった。社内以外のネットワークだとアクセスできる模様…

結論からいうと、GCEのサーバに何度かsshログインに失敗すると、pingさえ通らないようになるらしい。(リセットすれば治る)

ただ、そのことに気づくまでにあれこれ試して、プロキシまでたてた。今となっては不要だけどメモだけ。

プロキシサーバ

squidを使ったよ

プロキシサーバの設置

以下プロキシサーバ側

構成

  • Google Compute Engine
  • Ubuntu 16.04 LTS

Ubuntu 大好き人間です。はい。

CentOSとかが無難なのかな、とか思いますが、グローバルなシェアでみるとUbuntuの方が今多数派らしい。

squidインストール

$ sudo apt install squid

設定

$ sudo vim /etc/squid/squid.conf

以下コメント。

...
# 1190行目
# http_access deny all
...
# 1599行目 …

Continue reading

Let's Encrypt + nginx + Ubuntu

Posted on 2017/06/05 in tech • Tagged with ssl/tls, nginx, ubuntu

めも。殴り書き。

Let's Encrypt

https://letsencrypt.org/

環境

  • Ubuntu 16.04 LTS
  • nginx 1.10.0

一応確認

  • サーバーに対してドメインが振られDNSでの名前解決ができている
  • 80番ポートにアクセスできる

certbotの導入

$ cd /usr/local/bin
$ sudo git clone https://github.com/certbot/certbot
$ cd certbot
$ sudo ./certbot-auto certonly --standalone -t
  • 依存するライブラリを自動でインストールするか途中訊かれるので、yと入力。
  • メールアドレスの入力
  • (A)gree

あとはよくわからないこと聞かれる

Your account credentials have …


Continue reading

Ubuntu16.04 にPhantomJSをnodeでインストールする際にエラーになる

Posted on 2017/01/01 in tech • Tagged with ubuntu, node, javascript, scraping

詰まったのでメモ。

$ sudo npm install -g phantomjs

実行

> phantomjs@2.1.7 install /usr/local/lib/node_modules/phantomjs\ > node install.js

sh: 1: node: not found\ npm ERR! Linux 4.4.0-51-generic\ npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "-g" "install" "phantomjs"\ npm ERR! node v4.2.6\ npm …


Continue reading