sacss sp5

80
From the Darkside WordPress 運用 での 自動化 とか サーバ でできる 高速化 とか 131214日土曜日

Upload: wataru-okamoto

Post on 29-Nov-2014

1.175 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Sacss sp5

From the DarksideWordPress 運用での自動化とかサーバ側でできる高速化とか

13年12月14日土曜日

Page 2: Sacss sp5

OKAMOTOWataru

@wokamoto13年12月14日土曜日

Page 3: Sacss sp5

13年12月14日土曜日

Page 4: Sacss sp5

13年12月14日土曜日

Page 5: Sacss sp5

13年12月14日土曜日

Page 6: Sacss sp5

13年12月14日土曜日

Page 7: Sacss sp5

Recipe* Tools Chef, Vagrant, WP-CLI* Cloud Design Pattern* More Performance

13年12月14日土曜日

Page 8: Sacss sp5

Tools

13年12月14日土曜日

Page 9: Sacss sp5

Chef

13年12月14日土曜日

Page 10: Sacss sp5

Chef

13年12月14日土曜日

Page 11: Sacss sp5

Chef×13年12月14日土曜日

Page 12: Sacss sp5

ChefInfrastructure as Code

13年12月14日土曜日

Page 13: Sacss sp5

ChefInfrastructure as Code

13年12月14日土曜日

Page 14: Sacss sp5

$ curl -L https://www.opscode.com/chef/install.sh | sudo bash

Chef* Chef Solo Install

13年12月14日土曜日

Page 15: Sacss sp5

* Recipepackage "nginx" do! action :installend

service "nginx" do! action [ :enable , :start ]end

Chef

13年12月14日土曜日

Page 16: Sacss sp5

* 入門 Chef SoloChefhttp://www.amazon.co.jp/dp/B00BSPH158

13年12月14日土曜日

Page 17: Sacss sp5

Vagrant

13年12月14日土曜日

Page 18: Sacss sp5

Vagrant

13年12月14日土曜日

Page 19: Sacss sp5

Vagrant

13年12月14日土曜日

Page 20: Sacss sp5

Mac の場合* Xcodeをインストール (必須ではないけど、いれときましょう。)* VirtualBoxをインストール https://www.virtualbox.org/* Vagrantをインストール http://www.vagrantup.com/

* Vagrant InstallVagrant

13年12月14日土曜日

Page 21: Sacss sp5

$ vagrant up

$ vagrant halt

$ vagrant reload

$ vagrant provision

$ vagrant destroy

commandVagrant

13年12月14日土曜日

Page 22: Sacss sp5

VagrantfileVagrant

13年12月14日土曜日

Page 25: Sacss sp5

WP-CLI

13年12月14日土曜日

Page 26: Sacss sp5

WP-CLI

13年12月14日土曜日

Page 27: Sacss sp5

* WP-CLI InstallWP-CLI

$ curl https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh | bash

13年12月14日土曜日

Page 28: Sacss sp5

WP-CLI$ cd /path/to/wordpress$ wp core download --locale=ja$ wp core config --dbname=wp \ --dbuser=wp_user --dbpass=password \ --dbhost=localhost --locale=ja$ wp core install --url=http://example.com \ --title=test --admin_name=admin \ [email protected] \ --admin_password=test

* WordPress Install

13年12月14日土曜日

Page 29: Sacss sp5

WP-CLI$ cd /path/to/wordpress$ wp plugin install hotfix$ wp plugin activate hotfix$ wp plugin status4 installed plugins: I akismet 2.5.9 I hello 1.6 A hotfix 1.0 A wp-multibyte-patch 1.7 Legend: I = Inactive, A = Active

* WordPress Plugins Install

13年12月14日土曜日

Page 30: Sacss sp5

WP-CLI$ cd /path/to/wordpress$ wp core update$ wp core update-db$ wp core version --extraWordPress version: 3.7.1Database revision: 25824TinyMCE version: 3.59 (359-20131026)

* WordPress Core Update

13年12月14日土曜日

Page 31: Sacss sp5

WP-CLI

$ cd /path/to/wordpress$ wp plugin install hotfix3 installed plugins: I akismet 2.5.9 UA nginx-champuru 1.6.0 I wp-multibyte-patch 1.7

Legend: A = Active, I = Inactive, U = Update$ wp plugin update nginx-champuru$ wp plugin update-all

* WordPress Plugins Update

13年12月14日土曜日

Page 32: Sacss sp5

WP-CLI

$ cd /path/to/wordpress$ wp export$ wp export --post_type=post$ wp export --post_status=publish

$ wp import export.xml$ wp import export.xml --skip=attachment

* WordPress Export & Import

13年12月14日土曜日

Page 33: Sacss sp5

WP-CLI

$ cd /path/to/wordpress$ wp nginx flush$ wp nginx listarray(3291) { [0]=> object(stdClass)#126 (3) { ["cache_id"]=> string(1) "0" ["cache_url"]=> :

* Nginx Cache Controlle

13年12月14日土曜日

Page 34: Sacss sp5

WordPress Cloud Design Pattern

13年12月14日土曜日

Page 35: Sacss sp5

ひとつのインスタンスに Web サーバ、PHP、MySQL を詰め込む

Single Instance

13年12月14日土曜日

Page 36: Sacss sp5

Single Instance

13年12月14日土曜日

Page 37: Sacss sp5

http://ja.megumi-cloud.com/

Single Instance

13年12月14日土曜日

Page 38: Sacss sp5

Web、 DB サーバを分離DB サーバは Amazon RDS

Single Instance + RDS

13年12月14日土曜日

Page 39: Sacss sp5

Single Instance + RDS

13年12月14日土曜日

Page 40: Sacss sp5

DB サーバを2台構成にして読み書きを分離

DB Replication

13年12月14日土曜日

Page 41: Sacss sp5

DB Replication

13年12月14日土曜日

Page 42: Sacss sp5

DB Replicationhttp://wordpress.org/plugins/hyperdb/

13年12月14日土曜日

Page 43: Sacss sp5

Web サーバも2台構成に

Multi Servers

13年12月14日土曜日

Page 44: Sacss sp5

Multi Servers

13年12月14日土曜日

Page 45: Sacss sp5

NFS でソースを共有してスケールアウト

NFS Sharing

13年12月14日土曜日

Page 46: Sacss sp5

NFS Sharing

13年12月14日土曜日

Page 47: Sacss sp5

http://ja.cloudhappy.net/

Cloud Formation

13年12月14日土曜日

Page 48: Sacss sp5

More Speed !

13年12月14日土曜日

Page 49: Sacss sp5

Speed Speed!* HipHop VM for PHP* mod_pagespeed* SPDY over Nginx

13年12月14日土曜日

Page 54: Sacss sp5

* Multiplexed streams* Request prioritization* HTTP header compression* Server push. * Server hint.

13年12月14日土曜日

Page 55: Sacss sp5

Static Press

13年12月14日土曜日

Page 56: Sacss sp5

13年12月14日土曜日

Page 57: Sacss sp5

開発の経緯クライアントからの要望* 公開サーバには静的HTMLのみ* 公開前に記事内容を確認したい → 承認フローを通したい

13年12月14日土曜日

Page 58: Sacss sp5

開発の経緯

13年12月14日土曜日

Page 59: Sacss sp5

開発の経緯

13年12月14日土曜日

Page 60: Sacss sp5

Movable Type で良いんじゃ?開発の経緯

13年12月14日土曜日

Page 61: Sacss sp5

Really Static開発の経緯

13年12月14日土曜日

Page 62: Sacss sp5

開発の経緯

13年12月14日土曜日

Page 63: Sacss sp5

開発の経緯

13年12月14日土曜日

Page 64: Sacss sp5

* WP → 静的サイトに* URL の書き換え* 動的処理不可* BASIC 認証もOK

StaticPress 特徴

13年12月14日土曜日

Page 65: Sacss sp5

* WP → 静的サイトに* URL の書き換え* 動的処理不可* BASIC 認証もOK

StaticPress 特徴

13年12月14日土曜日

Page 66: Sacss sp5

* WP → 静的サイトに!"" index.html# !"" 2013# # !"" 10# # # !"" 13# # # # !"" staticpress# # # # # $"" index.html# # # # $"" index.html# # # $"" index.html# # $"" index.html# !"" author# # $"" admin# # $"" index.html

StaticPress 特徴

13年12月14日土曜日

Page 67: Sacss sp5

* WP → 静的サイトに$ wget -S --spider http://staticpress.netHTTP request sent, awaiting response... HTTP/1.1 200 OK Server: AmazonS3 x-amz-id-2: XmJwDae+xKcaS57kcQ4ryhy0xUval68YA/6dqusSWxX9A/AvAqaxBuyr8Gsubz9Z x-amz-request-id: 386EE47166995D35 Date: Sun, 13 Oct 2013 00:59:56 GMT Last-Modified: Fri, 11 Oct 2013 10:39:25 GMT ETag: "47caefa0d1f863e2f3853f0d4f96089a" Content-Type: text/html Content-Length: 7063Length: 7063 (6.9K) [text/html]Remote file exists and could contain further links,but recursion is disabled -- not retrieving.

StaticPress 特徴

13年12月14日土曜日

Page 68: Sacss sp5

* WP → 静的サイトに* URL の書き換え* 動的処理不可* BASIC 認証もOK

StaticPress 特徴

13年12月14日土曜日

Page 69: Sacss sp5

* WP → 静的サイトに* URL の書き換え* 動的処理不可* BASIC 認証もOK

StaticPress 特徴

13年12月14日土曜日

Page 70: Sacss sp5

* URL の書き換え<link rel="stylesheet" id="wrench-style-css" href="http://localhost/wp-content/themes/wrench/style.min.css?ver=1381485493" type="text/css" media="all">

%<link rel="stylesheet" id="wrench-style-css" href="/wp-content/themes/wrench/style.min.css?ver=1381485493" type="text/css" media="all">

StaticPress 特徴

13年12月14日土曜日

Page 71: Sacss sp5

* URL の書き換え<meta property="og:locale" content="ja_JP"><meta property="og:type" content="website"><meta property="og:site_name" content="StaticPress"><meta property="og:url" content="http://ja.staticpress.net/"><meta property="og:title" content="StaticPress"><meta property="og:image" content="http://ja.staticpress.net/wp-content/uploads/2013/06/staticpress_logo-150x150.png">

StaticPress 特徴

13年12月14日土曜日

Page 72: Sacss sp5

* WP → 静的サイトに* URL の書き換え* 動的処理不可* BASIC 認証もOK

StaticPress 特徴

13年12月14日土曜日

Page 73: Sacss sp5

* WP → 静的サイトに* URL の書き換え* 動的処理不可* BASIC 認証もOK

StaticPress 特徴

13年12月14日土曜日

Page 74: Sacss sp5

* 動的処理不可- コメント欄、pingback、トラックバック設置できない % コメントは Disqus、Facebook コメントなどで

StaticPress 特徴

13年12月14日土曜日

Page 75: Sacss sp5

* 動的処理不可- サイト内検索フォーム設置できない % Google カスタム検索エンジンなどで対応

StaticPress 特徴

13年12月14日土曜日

Page 76: Sacss sp5

* 動的処理不可- UA 切り替えでテーマを変えるプラグインが使えません % レスポンシブなテーマで対応

×

StaticPress 特徴

13年12月14日土曜日

Page 77: Sacss sp5

* WP → 静的サイトに* URL の書き換え* 動的処理不可* BASIC 認証もOK

StaticPress 特徴

13年12月14日土曜日

Page 78: Sacss sp5

* WP → 静的サイトに* URL の書き換え* 動的処理不可* BASIC 認証もOK

StaticPress 特徴

13年12月14日土曜日

Page 79: Sacss sp5

* BASIC 認証もOK- 記事投稿用サイトの隠蔽 % WordPress 全体に BASIC 認証かかっていても OK

StaticPress 特徴

13年12月14日土曜日

Page 80: Sacss sp5

StaticPress 特徴* BASIC 認証もOK

13年12月14日土曜日