Mention how to change upload size in Nginx.

This commit is contained in:
Zhang Huangbin 2015-03-23 21:15:15 +08:00
parent a588b5046f
commit b1dcfc927b
4 changed files with 46 additions and 17 deletions

View File

@ -32,9 +32,9 @@ __NOTES__:
If you use mail clients such as Outlook, thunderbird to send mails, it's now If you use mail clients such as Outlook, thunderbird to send mails, it's now
ok to sent large attachment with above setting. ok to sent large attachment with above setting.
## Change upload file size in webmail ## Change upload file size in Roundcube webmail
If you have webmail, you have to change two more settings: If you have Roundcube webmail, please change two more settings:
### Change PHP setting to allow to upload large attachment ### Change PHP setting to allow to upload large attachment
@ -63,6 +63,9 @@ Change same settings in file `.htaccess` under roundcube root directory:
* on FreeBSD, it's `/usr/local/www/roundcubemail/.htaccess` * on FreeBSD, it's `/usr/local/www/roundcubemail/.htaccess`
* on OpenBSD, it's `/var/www/roundcubemail/.htaccess` * on OpenBSD, it's `/var/www/roundcubemail/.htaccess`
Note: this `.htaccess` file may not exist on some Linux/BSD distributions,
if it doesn't exist, you can skip this step.
``` ```
php_value memory_limit 200M php_value memory_limit 200M
php_value upload_max_filesize 100M php_value upload_max_filesize 100M
@ -70,3 +73,15 @@ php_value post_max_size 100M
``` ```
Restart Apache or Nginx web server to make it work. Restart Apache or Nginx web server to make it work.
## Change upload size in Nginx
Find setting `client_max_body_size` in Nginx config file
`/etc/nginx/nginx.conf`, change it to a proper value to match your need.
```
http {
...
client_max_body_size 100m;
...
}

View File

@ -15,11 +15,12 @@
<ul> <ul>
<li><a href="#change-mail-attachment-size">Change mail attachment size</a><ul> <li><a href="#change-mail-attachment-size">Change mail attachment size</a><ul>
<li><a href="#change-message-size-limit-in-postfix">Change message size limit in postfix</a></li> <li><a href="#change-message-size-limit-in-postfix">Change message size limit in postfix</a></li>
<li><a href="#change-upload-file-size-in-webmail">Change upload file size in webmail</a><ul> <li><a href="#change-upload-file-size-in-roundcube-webmail">Change upload file size in Roundcube webmail</a><ul>
<li><a href="#change-php-setting-to-allow-to-upload-large-attachment">Change PHP setting to allow to upload large attachment</a></li> <li><a href="#change-php-setting-to-allow-to-upload-large-attachment">Change PHP setting to allow to upload large attachment</a></li>
<li><a href="#change-roundcube-webmail-settings-to-allow-large-attachment">Change Roundcube webmail settings to allow large attachment</a></li> <li><a href="#change-roundcube-webmail-settings-to-allow-large-attachment">Change Roundcube webmail settings to allow large attachment</a></li>
</ul> </ul>
</li> </li>
<li><a href="#change-upload-size-in-nginx">Change upload size in Nginx</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -46,8 +47,8 @@ like below:</p>
</ul> </ul>
<p>If you use mail clients such as Outlook, thunderbird to send mails, it's now <p>If you use mail clients such as Outlook, thunderbird to send mails, it's now
ok to sent large attachment with above setting.</p> ok to sent large attachment with above setting.</p>
<h2 id="change-upload-file-size-in-webmail">Change upload file size in webmail</h2> <h2 id="change-upload-file-size-in-roundcube-webmail">Change upload file size in Roundcube webmail</h2>
<p>If you have webmail, you have to change two more settings:</p> <p>If you have Roundcube webmail, please change two more settings:</p>
<h3 id="change-php-setting-to-allow-to-upload-large-attachment">Change PHP setting to allow to upload large attachment</h3> <h3 id="change-php-setting-to-allow-to-upload-large-attachment">Change PHP setting to allow to upload large attachment</h3>
<p>You should change <code>memory_limit</code>, <code>upload_max_filesize</code> and <code>post_max_size</code> in <p>You should change <code>memory_limit</code>, <code>upload_max_filesize</code> and <code>post_max_size</code> in
PHP config file <code>/etc/php.ini</code></p> PHP config file <code>/etc/php.ini</code></p>
@ -72,12 +73,23 @@ post_max_size = 100M;
<li>on FreeBSD, it's <code>/usr/local/www/roundcubemail/.htaccess</code></li> <li>on FreeBSD, it's <code>/usr/local/www/roundcubemail/.htaccess</code></li>
<li>on OpenBSD, it's <code>/var/www/roundcubemail/.htaccess</code></li> <li>on OpenBSD, it's <code>/var/www/roundcubemail/.htaccess</code></li>
</ul> </ul>
<p>Note: this <code>.htaccess</code> file may not exist on some Linux/BSD distributions,
if it doesn't exist, you can skip this step.</p>
<pre><code>php_value memory_limit 200M <pre><code>php_value memory_limit 200M
php_value upload_max_filesize 100M php_value upload_max_filesize 100M
php_value post_max_size 100M php_value post_max_size 100M
</code></pre> </code></pre>
<p>Restart Apache or Nginx web server to make it work.</p><p style="text-align: center; color: grey;">Document published under a <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">CC BY-ND 3.0</a> license. If you found something wrong, please do <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script> <p>Restart Apache or Nginx web server to make it work.</p>
<h2 id="change-upload-size-in-nginx">Change upload size in Nginx</h2>
<p>Find setting <code>client_max_body_size</code> in Nginx config file
<code>/etc/nginx/nginx.conf</code>, change it to a proper value to match your need.</p>
<p>```
http {
...
client_max_body_size 100m;
...
}</p><p style="text-align: center; color: grey;">Document published under a <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">CC BY-ND 3.0</a> license. If you found something wrong, please do <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

View File

@ -85,18 +85,18 @@ sql&gt; UPDATE mailbox SET password='{SSHA512}FxgXDhBVYmTqoboW+ibyyzPv/wGG7y4VJt
<h3 id="for-ldap-backends">For LDAP backends</h3> <h3 id="for-ldap-backends">For LDAP backends</h3>
<p>User password is stored in attribute <code>userPassword</code> of user object.</p> <p>User password is stored in attribute <code>userPassword</code> of user object.</p>
<ul> <ul>
<li> <li>To store plain password, SSHA, SSHA512 password hash, just store them in
<p>To store plain password, SSHA, SSHA512 password hash, just store them in original format. For example:</li>
original format. For example: </ul>
<code>userPassword: 123456 <pre><code>userPassword: 123456
userPassword: {SSHA}OuCrqL2yWwQIu8a9uvyOQ5V/ZKfL7LJD userPassword: {SSHA}OuCrqL2yWwQIu8a9uvyOQ5V/ZKfL7LJD
userPassword: {SSHA512}FxgXDhBVYmTqoboW+ibyyzPv/wGG7y4VJtuHWrx+wfqrs/lIH2Qxn2eA0jygXtBhMvRi7GNFmL++6aAZ0kXpcy1fxag=</code></p> userPassword: {SSHA512}FxgXDhBVYmTqoboW+ibyyzPv/wGG7y4VJtuHWrx+wfqrs...
</li> </code></pre>
<li>
<p>To store standard MD5 password (salted MD5 hash), please prepend <code>{CRYPT}</code> <ul>
<li>To store standard MD5 password (salted MD5 hash), please prepend <code>{CRYPT}</code>
(case insensitive) in your password hash. For example: (case insensitive) in your password hash. For example:
<code>userPassword: {CRYPT}$1$GfHYI7OE$vlXqMZSyJOSPXAmbXHq250</code></p> <code>userPassword: {CRYPT}$1$GfHYI7OE$vlXqMZSyJOSPXAmbXHq250</code></li>
</li>
</ul> </ul>
<p><strong>IMPORTANT NOTE</strong>: If you want to input password hash with phpLDAPadmin, <p><strong>IMPORTANT NOTE</strong>: If you want to input password hash with phpLDAPadmin,
please choose <code>clear</code> in the password hash list, then input password hash.</p> please choose <code>clear</code> in the password hash list, then input password hash.</p>

View File

@ -77,10 +77,12 @@ User password is stored in attribute `userPassword` of user object.
* To store plain password, SSHA, SSHA512 password hash, just store them in * To store plain password, SSHA, SSHA512 password hash, just store them in
original format. For example: original format. For example:
``` ```
userPassword: 123456 userPassword: 123456
userPassword: {SSHA}OuCrqL2yWwQIu8a9uvyOQ5V/ZKfL7LJD userPassword: {SSHA}OuCrqL2yWwQIu8a9uvyOQ5V/ZKfL7LJD
userPassword: {SSHA512}FxgXDhBVYmTqoboW+ibyyzPv/wGG7y4VJtuHWrx+wfqrs/lIH2Qxn2eA0jygXtBhMvRi7GNFmL++6aAZ0kXpcy1fxag=``` userPassword: {SSHA512}FxgXDhBVYmTqoboW+ibyyzPv/wGG7y4VJtuHWrx+wfqrs...
```
* To store standard MD5 password (salted MD5 hash), please prepend `{CRYPT}` * To store standard MD5 password (salted MD5 hash), please prepend `{CRYPT}`
(case insensitive) in your password hash. For example: (case insensitive) in your password hash. For example: