LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2010, 06:39 AM   #1
nonshatter
Member
 
Registered: Aug 2010
Location: Hants
Distribution: SLES, Ubuntu, Centos
Posts: 41

Rep: Reputation: 0
Apache + Perl large file upload problem - Connection Reset


Hey,
I'm having some trouble uploading large log files to our server using perl. We are required to upload files larger than 2GB (regardless of how infeasible that sounds).

I have tried the same thing on two different servers:

Code:
1. Linux 2.6.32-24-generic #39-Ubuntu 10.04 i686 GNU/Linux 
   Server version: Apache/2.2.14 (Ubuntu)
2. Linux 2.6.5-7.244-smp #1 SLES_9 x86_64 x86_64 x86_64 GNU/Linux
   Server version: Apache/2.0.49
Smaller files upload without issue, however when a file larger than 1048576000 bytes is sent to be uploaded, the browser immediately fails, yielding this:

Code:
This web page is not available.

The web page at blah might be temporarily down or it may have moved permanently to a new web address.

Below is the original error message:

Error 101 (net::ERR_CONNECTION_RESET): Unknown error.
The apache log gives some indication of the file size limit:

Code:
Requested content-length of 5954683941 is larger than the configured limit of 1048576000
However, I have looked through the apache config files and can't seem to find where this setting for content-length is. Is there an absolute maximum setting for file uploads in apache? Is it also possible that this is actually caused by a Perl error?

Many thanks
 
Old 11-11-2010, 07:37 AM   #2
nonshatter
Member
 
Registered: Aug 2010
Location: Hants
Distribution: SLES, Ubuntu, Centos
Posts: 41

Original Poster
Rep: Reputation: 0
This is strange... After consulting the apache2 manual, I found that the directive LimitRequestBody controls the size of the request body.

Code:
"This directive specifies the number of bytes from 0 (meaning unlimited) to 2147483647 (2GB) that are allowed in a request body.

The LimitRequestBody directive allows the user to set a limit on the allowed size of an HTTP request message body 
within the context in which the directive is given (server, per-directory, per-file or per-location). 
If the client request exceeds that limit, the server will return an error response instead of servicing the request. 
The size of a normal request message body will vary greatly depending on the nature of the resource and the methods allowed on that resource.
CGI scripts typically use the message body for retrieving form information. 
Implementations of the PUT method will require a value at least as large as any representation that the server wishes to accept for that resource."
This suggests that the maximum file upload allowed should be 2GB.

But after trying a third server configuration, I managed to upload a 5.5GB file without any errors!

Code:
3. Linux 2.6.27.19-5-default #1 SLES_11 x86_64 x86_64 x86_64 GNU/Linux
   Server version: Apache/2.2.10 (Linux/SUSE)
The problem now, is that I need to figure out why it will only work in this configuration, and not the other two. Both of the other servers have different files/file structures, so it's difficult knowing which apache file to edit.

Is anyone able to explain why it may work in the third configuration, but not in the first 2??

Any help appreciated

Last edited by nonshatter; 11-11-2010 at 08:45 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache file upload problem shan_nathan Linux - Server 1 05-21-2008 09:10 PM
perl CGI full path to file for upload GATTACA Programming 1 06-11-2007 11:42 PM
Large file upload - $_POST empty in PHP PsychosisNode Linux - Software 1 01-23-2005 08:32 AM
Parsing large text file with perl smaida Programming 5 09-13-2004 05:33 AM
file upload apache 2.0 scriptjunkie Linux - Newbie 0 08-08-2003 04:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration