2018-01-01から1年間の記事一覧

terraform AutoScaling

https://christina04.hatenablog.com/entry/2016/01/21/122437 TerraformでのAutoScale時のハマりどこ 端的にいうとこの2つです。Terraform経由で実行した際のLaunchConfiguration(イカLC)とAutoScalingGroup(イカASG)の削除の順番が逆 LC内のuser_data…

aws AutoScaling

スポットインスタンスは、変動価格制のインスタンスで、たいていの時間帯は通常のインスタンスよりも圧倒的に低い価格で起動可能な代わりに、需給が逼迫すると値段が高騰し、もしあらかじめユーザーが指しておいた指値を上回ると突然terminateされる上、stop…

wordpress scale

NFSでドキュメントルートを共有https://www.serverlab.ca/tutorials/linux/web-servers-linux/how-to-scale-wordpress-sites-using-nfs/↓ NFS Replicaパターンhttp://moqrin3.de/2018/02/21/post-47/

AWS 削除

AMI イメージの削除 https://www.ipentec.com/document/amazon-ec2-delete-amiAMI、スナップショットを削除

varnish バックエンドが50xの場合はキャッシュを返す

https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/issues/24 sub vcl_backend_response { if (beresp.status == 500 || beresp.status == 502 || beresp.status == 503 || beresp.status == 504) { return (abandon); }

$_SERVER['SERVER_NAME'] $_SERVER[‘HTTP_HOST’] trailing slash リダイレクト

apache 2.4 mod_dir $_SERVER['SERVER_NAME'] を使用SERVER_NAMEはUseCanonicalName OnでconfのServerNameになる。https://stackoverflow.com/questions/29112786/apache-add-trailing-slash-redirects-to-different-servername wordpress $_SERVER[‘HTTP_HO…

terraform waf

AWS WAFを使うためシステムにCloudFrontを導入した時の注意点まとめ https://dev.classmethod.jp/cloud/aws/setup-amazon-waf-and-cloudfront/Terraform v0.7.8でAWS WAFに対応しました https://dev.classmethod.jp/cloud/aws/terraform-supports-aws-waf-in…

AWS Movable Type

https://www.monster-dive.com/blog/server_network/20130812_000088.phphttps://qiita.com/bezeklik/items/5d6563c865b9c548ed3fhttps://qiita.com/mitzi2funk/items/8f20ca7ebb82590865ca

terraform

事前準備AWS マネジメントコンソールで作業 IAM 管理用ユーザ作成 S3バケット作成 入門 RDS インスタンスの構築があると結構時間がかかります ( 当エントリの構成で約8分程度 ) 。https://tech.recruit-mp.co.jp/infrastructure/post-10665/ tfファイル type…

WordPress のGUID。ドメイン名やURLを変える際にどうするか

たとえば最近ならウェブサイトをSSL化したときですね。この時に URL が HTTP から HTTPS に変わるわけですが、だからといって GUID を https:// にかえるべきではありません。 ...これを変えてしまうとたとえば RSS リーダー等でみなさんのブログを購読して…

wp-cli

wp_cli wordpress DB書き換え サーバ名変更 DBサイズが大きいときは wp-cli の search-replace を使ったほうがよい Search and Replace for WordPress Databases Scriptはメモリ不足になる場合があったhttps://firegoby.jp/archives/6888 マルチサイト By de…

groonga pgroonga lock

FreeBSD /var/log/pgsql/pgroonga.log 2018-06-13 13:57:08.446030|w|92306: [DB Locked] time out(900000): io(base/[database oid]/pgrn) collisions(900000/90) 2018-06-13 13:57:08.446253|e|92306: grn_io_lock failed 2018-06-13 13:57:08.453398|e|92…

Ansible 2.4 から、いままで include が持っていた機能は以下の4つのアクションに分けられました。Action Operation Reusable content import_tasks static task include_tasks dynamic task import_playbook static playbook include_playbook dynamic play…

idle_in_transaction_session_timeout

https://stackoverflow.com/questions/13236160/is-there-a-timeout-for-idle-postgresql-connectionshttps://stackoverflow.com/questions/12391174/how-to-close-idle-connections-in-postgresql-automatically

postgresql.auto.conf ALTER SYSTEM

https://www.postgresql.jp/document/10/html/config-setting.htmlpostgresql.confに加え、PostgreSQLデータディレクトリには postgresql.auto.confというファイルがあります。このファイルは postgresql.conf と同じフォーマットですが、手動では編集しませ…

pgbouncer

https://pgbouncer.github.io/ https://pgbouncer.github.io/usage.htmlhttps://www.pgbouncer.org/config.htmlPgBouncer の設定 | Heroku Dev Center 2023PostgreSQL + Rails へ PgBouncer を導入してDBメモリ使用量を大幅に改善した話 - Hello Tech 2023 F…

postgres log_temp_files

SELECTでディスク書き込みが発生している → log_temp_files で該当クエリを調査する → work_mem 調節する log_temp_files = 0 Tempファイルを作ったらログ出力(単位はkb、デフォルト-1で出力しない work_memの設定値を調節できる 1MBとか設定している人がい…

OpenLDAPバックアップ

https://int128.hatenablog.com/entry/2014/07/27/180143

OpenLDAPクライアント

設定ファイル /etc/ldap.conf pam_ldap、nss_ldap から利用されるファイルです。 nsswitch.conf で 「ldap」 を設定すると、このファイルの内容に従って処理が行われます。/etc/openldap/ldap.conf OpenLDAPに付いている、LDAPコマンドを実行するときに参照…

mysql innodb free tablespace warninghttp://www.goofoo.jp/2012/01/1918

sendmail 再送

https://qiita.com/nntsugu/items/8f721a71c35241e3f2f6 すぐに再配送 sendmail -q -vhttp://www.ksknet.net/sendmail/post_61.html

office365 Too many recipients

(host メールサーバー名.mail.protection.outlook.com [23.xx.xx.xx] said: 452 4.5.3 Too many recipients (xxxxxx)[xxxJPN01.prod.protection.outlook.com] (in reply to RCPT TO command)) という感じでメールキューがたまりまくる。 ニリアコットの仕事:…

wordpress memory

コードをしらべてみると、以下のとおりユーザ権限がmanage_optionsの時に、memory_limitを設定している事がわかりました /wp-admin/admin.php if ( current_user_can( 'manage_options' ) ) { @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit…

CSP

https://developers.google.com/web/fundamentals/security/csp/?hl=ja nginx でCSP sites-available/default server { listen 443 ssl http2 default_server; server_name example.org; # More config here add_header Content-Security-Policy-Report-Only…

Chromeのリダイレクトキャッシュ

301 Moved Permanently 302 Moved Temporarilyhttps://holy-seo.net/blog/seo/seo-301-and-302-understanding/ 上記のnginxの設定では、メンテナンス画面の表示に301リダイレクトを用いているが、Chromeは301リダイレクトのキャッシュを保持する仕様のため、…

ETag Cache-Control max-age HTTP cache

https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=ja#_1https://developer.mozilla.org/ja/docs/Web/HTTP/Cachingキャッシュ制御に関する私的まとめ | SD MILIEU

varnish5 munin 監視

https://github.com/munin-monitoring/contrib/issues/876https://github.com/munin-monitoring/contrib/files/1797128/varnish5_.txt my $configtype = $ASPECTS{$self}{'type'}; to my $configtype = $ASPECTS{$self}{'type'} ? $ASPECTS{$self}{'type'} :…

ansible postgres

ansibleでpostgresqlインストール https://qiita.com/kitaro_tn/items/04aa7279c17be8b9b0ed To achieve your desired functionality add this to your sudoers file %group1 ALL=(user2) NOPASSWD: /full/path/to/script2 This will allow group1 to run sc…

nginx で複数の php_value を設定する

https://coderwall.com/p/gt2g3q/setting-multiple-php_value-in-nginx-config Multiple values, manually line-broken: fastcgi_param PHP_VALUE "sendmail_from=chroot@prout.com precision=42"; https://michaelshadle.com/2011/02/11/setting-php-ini-pa…

php NFS session

対策として, 各 Webサーバの php.ini を session.gc_probability = 0 に変更し, Webサーバ上でガベージコレクションが発生しないようにして, NFSサーバにて cron処理でセッションファイルを削除するようにしました。*4PHP で複数の Webサーバでセッションを…