続いてrootに関する設定を行います。 以下ではrootになれるユーザーおよびsudoコマンドの実行ユーザーの設定を行っています。 # vim /etc/pam.d/su # 以下の行のコメントを外す auth required pam_wheel.so use_uid # visudo # 以下の行のコメントを外す %wheel ALL=(ALL) ALL
Ruby on RailsでDev環境は使ったことあるけど、test・prod環境を考慮した環境構築をしたことがない人にお勧めの内容です。 サーバー構成図 サーバーの役割 リバースプロキシサーバー(ホスト名:rp01) ロードバランサ機能を使ってWEBサーバ二台に処理を振り分け、アクセスを1台のサーバーに集中させない WEBサーバーを外部から隠せることでセキュリティ面の向上 WEBサーバー(web01、web02) webサーバーを2台用意することでアクセスが1つのサーバーに集中しないため、レスポンスを早くできる マスターDBサーバー(db01m) DB内容をもう1台のDBサーバー(スレーブ)へリアルタイムにコピーし、障害でマスターが停止したときはスレーブに切り替える スレーブDBサーバー(db01s) 読み込み専用のサーバー。書き込みをしない分レスポンスが早くなる マスターの内容を常にコ
今からでも間に合うDockerの基礎。コンテナとは何か、Dockerfileとは何か。Docker Meetup Tokyo #2 コンテナ型仮想化の技術として注目されているDockerの勉強会「Docker Meetup Tokyo #2」が4月11日にグーグル東京オフィスで開催されました。 この勉強会には定員100名のところへ400名を超える申し込みがあり、参加できなかった方も多かったと思います。本記事では、最初のセッションとして行われた森和之氏による「今からでも間に合うDocker基礎+Docker 0.9概要」をダイジェストで紹介しましょう。 参考記事 2013年のDocker登場から現在(2018年)までを振り返り、その次の段階を展望した記事もご参照ください。 Dockerコンテナ時代の第一章の終わり、そして第二章の展望など 今からでも間に合うDocker基礎 株式会社トップゲー
HTTPレスポンスヘッダにサーバのバージョンの表示を消す なぜ必要? 潜在攻撃者への情報提供になることも。 もし使用中バージョンの脆弱性が明らかになった時、恰好の標的になるとか。 対応 nginx.confのhttpディレクティブに server_tokens off; を追加。
(2014-07-06 追記してます) (2014-05-11 追記してます) (2014-04-24 追記してます) ついにリリースされましたね.Ubuntu の新しい LTS.これを目標に LXC 1.0 の開発は進められてきたわけで,きっと特に苦労する事もなく一般ユーザでのコンテナの作成と実行が出来るのだろうなあと思って試してみました.結論から言うと出来ました.なので特にこのブログエントリを読む事なく作る事が出来るのでお急ぎの方はこの後読まずにさっさとやってしまいましょう :-D 過去,Ubuntu 上で 一般ユーザでの lxc コンテナの実行 - TenForwardの日記 LXCの非特権コンテナ 〜 Ubuntu Trusty 編 - TenForwardの日記 と 2 度ほどためしていますが,徐々に簡単になって,ついに完成型になりました. まず Ubuntu 14.04 LTS
いつもお世話になっているtmuxについて改めてまとめてみました。 ターミナル・マルチプレクサ 「tmux」では何ができるのか ・ターミナルの状態を維持しつつ、セッションの切断、再開ができる。 ・1つのターミナル上に複数のターミナルを表示できる。 とかとか 導入するメリット ・ssh の接続が切れても tmux のセッションが裏で動いているので作業を再開できる。 ・別の端末から同じ作業ができる。 ・タブをいっぱい開かなくてもいい。 とかとか インストールする Homebrew(Mac) でインストールする $ brew install tmux yum でインストールする $ sudo yum install tmux apt-get でインストールする $ sudo apt-get install tmux 設定ファイル $ vim .tmux.conf ※コマンドは以下のように省略できる
普段はサーバのメトリクス可視化のためにcloudforecastを使っていますが、某案件用に数秒単位で数十台のサーバのメトリクスを表示したいので、記事タイトルのような構成を作ってみた。 dstatでとった各種値の他に、nginxとmemcachedの情報も合わせて表示させています。 セットアップ もろもろのセットアップのメモ 監視サーバ まず、監視サーバにElasticsearchとkibanaをいれる。環境はCentOS6 $ sudo yum install java-1.7.0-openjdk $ sudo rpm -Uvh https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.x.x.noarch.rpm Elasticsearchは特に設定なく起動 $ sudo service
fluentdと定番プラグインのインストール:今さら聞けないfluentd~クラウド時代のログ管理入門(2)(1/2 ページ) 前回の記事「増えるログ、多様化するログをどう効率的に運用するか」では、fluentdの大まかなアーキテクチャについてご紹介しました。第2回では、fluentdがどういったものであるかをもう少し具体的に理解するために、実際の利用までの流れを紹介します。 fluentdの使い方 fluentdを利用するには、各サーバーにfluentdをインストールし、どのプラグインを使って処理を行うかについての設定が必要になります。 インストール手順 fluentdはさまざまな方法でインストールできます。例えば、 rpmパッケージによるインストール(CentOS、Red Hat Enterprise LinuxなどのOS向け) debパッケージによるインストール(Ubuntu、Deb
cron周りのベストプラクティス読んだ - $shibayu36->blog; 上の記事を読んで興味を惹かれたので、『WEB+DB PRESS Vol.79』 の 「cron 周りのベストプラクティス」 を読んだ。 Web 上でも公開されている。 (2014-06-23 追記。) 第25回 cron周りのベストプラクティス(1):Perl Hackers Hub|gihyo.jp … 技術評論社 そこでは cron 設定 (crontab) ファイルの記述方法として crontab コマンドを使用する方法が書かれていた *1。 で、記事を見てるうちに、以前 crontab コマンドやら /etc/cron.d やらの違いがよくわからずに調べて社内日記に書き残しておいたことを思いだしたのでブログで公開しておこうと思う。 ちなみに man の内容などは Debian 7 で見てるので、別ディス
昨年からImmutable Infrastructureという言葉が出始めて、サーバーを簡単に作って壊すという潮流が出始めました。また、サーバー管理を簡単にするツールとしてDockerというものが脚光を浴びており、いまどきのサーバー管理者に受け入れられてきました。 今回は、そのDockerをインストールしてLAMP環境を構築するステップを見ていきたいと思います。 Immutable Infrastructureとは? IaaS型のクラウドやVPSの台頭によって、簡単に仮想サーバーが立ち上げられる環境が整ってきました。 とはいえ、サーバーの立ち上げをするのはシステム構築時と、システム規模を大きくする時に限られ、サーバーの動作を変えたり、アプリケーションのアップデートをするときは、稼働しているサーバーの中身を修正するというのが従来のやり方でした。 しかしImmutable Infrastruc
定期的にこういう内容を書いて公開している気がする。昔の記事もあるのでそちらを読めばいいのだが、また書く必要性が生じてきたのであらためて書きます。 現代では AWS のようなクラウドや VPS など格安で手軽にインターネット上にサーバーを持てるようになった。しかしインターネットで誰でもアクセスできる環境でサーバーを稼働させるということは、常に人間やロボットの攻撃に晒されるということを同時に意味している。したがって初心者だからだとか、会社の中ではこうやって仕事をしているからといった言い訳は一切通用しない。セキュリティ設定をきちんとしなければ内部への侵入をたやすく許し、思わぬデータの漏洩につながるのである。とはいえセキュリティというのはトレードオフを考慮しなければいくらでも強化できるものでありキリがない。ここでは最低限これだけはやっておこうという現実的な落とし所を提示し、人々への啓蒙をはかるもの
スクリプトで一発簡単!iPhone/Android/Mac/Windowsから接続可能なL2TP/IPSecなVPN環境を構築する 2014/01/06 技術ネタ CentOS, L2TP/IPSec, VPN L2TP/IPSecサーバ構築の忘備録 喫茶店や街角の無料WiFiが信用出来ない時や海外での接続時など、 「悪い人が沢山いるインターネッツ怖い!」「今すぐVPNが使いたい!」 って時。意外とあると思います。 自分自身何度かそんな目にあった結果、何も考えずにコマンド一発でL2TP/IPSecなクライアントVPN環境を構築するスクリプトを紹介します。 (画像はイメージですが、オフィス内や自宅内に構築する事で、オフィスや自宅に安心して接続出来る環境を作る事もできます。) 最後に一応スクリプトの解説も載せておきます。 出先からの使い捨て用VPNではなく、長期で利用を検討している人は一部設定
900万を超えるユーザー数を抱え、日本を代表するイラスト投稿SNSに育った「pixiv(ピクシブ)」。長らくサービスを社屋の自作サーバーとIDCフロンティアの新宿データセンターで運用していたpixivのインフラを、新たに白河データセンターにまで拡げた背景をピクシブの方々に聞いた。 開始1週間後にサーバーを落とす イラスト投稿に特化したユニークなSNSであるpixivは、イラスト好きなプログラマーである上谷隆宏氏の思いから生まれた。ピクシブ 代表取締役社長の片桐孝憲氏は、「上谷が、イラストを描いている人同士が気軽に交流できるSNSとギャラリーを混ぜたようなサービスを作りたいと話していた。正直、特定のユーザーに特化したSNSでうまくいっている事例を知らなかったので、特定の分野に限定したものはあまり受けないと思っていたが、pixivという名前はカッコイイと思った(笑)」と振り返る。 こうして生ま
Varnish を CentOS にインストールする 1 minute read Published: 7 Feb, 2013 今回は こちら で紹介したリバースプロキシである Varnish のインストール手順を紹介します。 Varnish を CentOS にインストールする CentOS 5系で試したインストール方法です。 # rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm # yum install varnish
RubyのウェブアプリケーションフレームワークRamazeがとってもとっても素敵なので、ただいま実験としてささいなものを作成しております。HTTPdには今話題のthinを使おうかな、と思っているのですが、こうなると考えなければならないのがリバースプロキシですよね。"reverse proxy rails" あたりで検索すると真っ先にapacheの設定方法が出てくるわけですが、なんでもapacheというのもどうかな、と思いました。設定が煩雑になりますしね。そこでリバースプロキシである varnish を試してみました。varnishに関するドキュメントはあまり多くないのですが、varnish はとっても簡単なので素晴しいと思います。せっかくですから、varnishに関する設定方法などを簡単にまとめておきたいと思います。なお、私はサーバであっても ubuntu を使っておりますので(手抜き!)
Shin x blog Advent Calendar 2013 の 6 日目です。 とあるサイトに、Varnish をリバースプロキシとして導入して、半年が経過しました。 導入した経緯やその効果など書いてみたいと思います。 Varnish とは Varnish は、HTTP アクセラレータです。Web サーバのリバースプロキシとして動作し、キャッシュを生かして高いパフォーマンスを発揮するのが特徴です。また、VCL という独自の設定言語を持ち、これにより状況に応じた設定を柔軟に行うことができます。 導入の経緯 このサイトでは LAMP 構成の CMS を利用しており、インフラには AWS を利用しています。基本、閲覧が中心なのですが、イベント時に多数のアクセスがあります。S3 や CloudFront も検討したのですが、コンテンツを数分おきに更新する必要があるので今回は採用しませんでした
Nginx 1.4.2で試しました。 ネームサーバーは、ローカルのunboundをlocal-zone, local-dataを使って簡易コンテンツサーバーにして試しました。 local-zone: "oreno." static local-data: "api.oreno. 30 IN A 192.0.2.11" # local-data: "api.oreno. 30 IN A 192.0.2.12" proxy_passにホスト名を書くと→名前解決は一度だけ このように Nginx の設定を書いた場合、 location /api { proxy_pass http://api.oreno:9999; } 「api.oreno」の名前解決は、nginxの起動時に行われます 名前解決できない場合は、nginxは起動しません 名前解決できた場合は、ずっとそのIPアドレスにreverse
背景 自前のサービスでhttps通信をサポートするには、SSL証明書が必要になります。 自分で使用するだけなら、SSL証明書も自前で作成するいわゆるオレオレ証明書を用いても良いのですが、外部に公開するサービスの場合そうとも行きません。 SSL証明書というと値段が高い印象がありましたが、StartSSLというサービスで無料でSSL証明書の発行を受けられると言うことで試してみました。 StartSSLにユーザー登録する 証明書の発行を行う前に、StartSSLにユーザー登録する必要があります。 StartSSLから、"StartSSL Free (Class1)"を選択します。 Certificate Control Panelを選択。 Sign-upに進みます。 名前、住所、メールアドレスなど 個人情報の登録を行います。 登録したメールアドレスに本人確認のメールが届くので、受信したメールのa
こんにちは。斎藤です。 ITインフラの障害は、多くの場合「予期せぬ」タイミングで発生します。特に、CPUリソースを多量に消費したり、Disk I/Oが輻輳している場合、その切り分けは困難な状況に陥りやすいものです。 そこで、本日はITインフラ、特にOS・ミドルウェアを支えるにあたって、問題解決を助けてくれるであろう12個のコマンドを取り上げてみます。「必ず押さえておきたい」5つのものと「更に覚えると便利なコマンド」7つの2節に分けてお話しします。 ※CentOS 6.4 (64bit)を前提に取り上げます 必ず押さえておきたいコマンド もしITインフラ管理者になりたてな方はぜひ サーバサイドのプログラマをやっていたのだけれど、ある日突然「君、サーバ管理担当ね!」と、バトンを渡される方っていらっしゃると思います。私も以前はそのクチでした...。そうなってしまったとき、まずは覚えておきたい5つ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く