LoginSignup
2
2

More than 3 years have passed since last update.

AMIMOTO AMI でアップロードファイルの上限サイズを変更する

Last updated at Posted at 2017-07-31

0.はじめに

以前、

AMIMOTO AMI を使って WordPress を立ち上げたんですが、

その続きというか、なんというか…

1.AMIMOTO AMI でアップロードファイルの上限サイズを変更する

  1. 以下のサイトを参考に、関係する chef のファイルを探します。

    すると、
    以下のものが引っかかりました。

    • /opt/local/chef-repo/cookbooks/amimoto/attributes/
    01_web_server.rb.ORG:default[:nginx][:config][:client_max_body_size] = '4M'
    03_php.rb:default[:php][:config][:upload_max_filesize] = node[:nginx][:config][:client_max_body_size]
    03_php.rb:default[:php][:config][:post_max_size] = node[:php][:config][:upload_max_filesize]
    
    • /opt/local/chef-repo/cookbooks/amimoto/templates/default/php/php.ini.erb


     

  2. chef 関連の設定ファイルを修正します。

    • /opt/local/chef-repo/cookbooks/amimoto/attributes/01_web_server.rb
    $ diff 01_web_server.rb.ORG 01_web_server.rb
    29c29
    < default[:nginx][:config][:client_max_body_size] = '4M'
    ---
    > default[:nginx][:config][:client_max_body_size] = '10M'
    
    • /opt/local/chef-repo/cookbooks/amimoto/templates/default/php/php.ini.erb
    $ diff php.ini.erb.ORG php.ini.erb
    52c52
    < upload_max_filesize = 4M
    ---
    > upload_max_filesize = 10M
    


  3. 現状の各種設定ファイルを修正します。

    • /etc/nginx/nginx.conf
    $ diff /etc/nginx/nginx.conf.ORG /etc/nginx/nginx.conf
    43c43
    <     client_max_body_size    4M;
    ---
    >     client_max_body_size    10M;
    
    • /etc/php.ini
    $ diff /etc/php.ini.bak201707281842 /etc/php.ini
    52c52
    < upload_max_filesize = 4M
    ---
    > upload_max_filesize = 10M
    


  4. 以下のコマンドを実行し、でサービスを再起動します。

$ nginx -s stop
$ service httpd stop
$ service nginx stop
$ nginx
$ service httpd start
$ service nginx start

99.ハマりポイント

  • chef の設定の反映タイミングがよくわからないので、ちょっと調べないといけないかな、と思っています。サーバの再起動時は必ず反映されると思うんですが、それ以外にも反映されたりする気がするんですよね…。ちょっとよくわからないので、どこかで調べて投稿しようかと思っています。

XX.まとめ

特に無いです。

ありがとうございました。

2
2
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
2
2