Skip to content
This repository has been archived by the owner on Mar 6, 2021. It is now read-only.

Small improvement: client_max_body_size >> 2MB #89

Open
dereuromark opened this issue Nov 7, 2017 · 11 comments
Open

Small improvement: client_max_body_size >> 2MB #89

dereuromark opened this issue Nov 7, 2017 · 11 comments

Comments

@dereuromark
Copy link
Contributor

the default client_max_body_size is way too low for any development.

It would be nice if we could ship with

client_max_body_size 50M;

inside each generated sites-available conf file inside server{} block

@bravo-kernel
Copy link
Contributor

I can easily agree to your proposed modifications. There are two ways to make (default) file changes:

  1. using bash scripts from the cakebox project
  2. using the UpdateShell from the cakebox-console project, https://github.com/alt3/cakebox-console/blob/dev/src/Shell/UpdateShell.php

I forgot about the second option to be honest but we added that to make PR'ing these sort of system tweaks easier, no bash skills needed. I think you will be able to propose a PR with your eyes closed.

Running a vagrant reload --provision already runs the UpdateShell so it should just work.

@bravo-kernel
Copy link
Contributor

IIRC the UpdateShell is launched here

# Run cakebox self-update

@bravo-kernel
Copy link
Contributor

@dereuromark the Bake template for the generated vhosts is found here. Feel free to PR your update (and other tunes you might find useful).

https://github.com/alt3/cakebox-console/blob/dev/src/Template/Bake/vhost_nginx.ctp

@dereuromark
Copy link
Contributor Author

Yeah https://github.com/alt3/cakebox-console/blob/dev/src/Template/Bake/vhost_nginx.ctp#L29 needs to be switched over to 7.2 once the upgrade is complete for example.

@bravo-kernel
Copy link
Contributor

Not really, it is already handled during the upgrade (e.g. 5 ref replaced by either 7.1 or 7.2).

I was hinting at the 2MB request.

@dereuromark
Copy link
Contributor Author

Gotcha

PS: Interesting, why it didnt fix it for me. But all right, I will retry.

@bravo-kernel
Copy link
Contributor

Probably due to a f** up on my behalf during progress but it is 100% reproducable for me now, works every single time.

If you have other improvements besides the 2MB feel free to stick them in the template.

@dereuromark
Copy link
Contributor Author

dereuromark commented Mar 3, 2018

Well, the defaults for session and php post limit size in general are bad for developing :)
I have to adjust them every time too, but maybe out of scope.

sudo sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 128M|g' /etc/php/7.2/fpm/php.ini
sudo sed -i 's|post_max_size = 8M|post_max_size = 128M|g' /etc/php/7.2/fpm/php.ini
sudo sed -i 's|session.gc_maxlifetime = 1440|session.gc_maxlifetime = 1440000|g' /etc/php/7.2/fpm/php.ini
sudo sed -i 's|memory_limit = 128M|memory_limit = 256M|g' /etc/php/7.2/fpm/php.ini

The 128M is important and useful if you use phpmyadmin and need to import a bigger SQL dump.
And it doesn't hurt to have it on such a high level anyway.

@bravo-kernel
Copy link
Contributor

I see, do these setting work on the (per) vhost level as well? If so it would be nice to add them all there. If people don't like them they can easily adjust per site.

@dereuromark
Copy link
Contributor Author

I dont think so, those need to be in the main php.ini for both CLI and WEB to work.

@bravo-kernel
Copy link
Contributor

OK, I will put this on the list for the next fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants