我正在尝试使用 uploadify 将视频上传到我的 ubuntu Aws 服务器,但大多数时候我收到 HTTP 错误 500。
我检查了每个 apache 设置,还尝试将执行时间更改为 1200,上传最大值为 300mb,我将 sizelimit 更改为 200MB,我尝试更改 .htaccess 文件中的 modsecurity,问题不存在。
这个错误不是很频繁。如果我开始收到 500 个内部服务器错误,那么它会在上传视频时不断出现。我访问的大多数网站都陷入了死胡同。我也会检查所有与安全相关的问题。一切正常,然后有时它的行为非常出乎意料。
当我开始使用 Uploadify 上传视频时。视频不断上传,当上传达到 100% 时出现此错误 500 内部服务器错误。在 apache 错误日志中显示此错误
[ pid=5222 thr=139968009692928 file=ext/apache2/Hooks.cpp:884 time=2013-06-05 07:19:29.465 ]:mod_passenger 中出现意外错误:接收 HTTP 上传数据时出错:指定的超时有过期(70007)回溯:(空)
我的服务器和应用程序配置是-:
- Ruby 版本 => 1.93
- 导轨 => 3.28
- 上传 => 3.1
- 阿帕奇=> 2.4.4
- 乘客 => 3.0.19
下面是我的上传脚本:
<% session_key = Rails.application.config.session_options[:key] %>
var uploadify_script_data = {};
var token_id= $(".swingAnalysisBanner").attr("rel");
var csrf_token = $('meta[name=csrf-token]').attr('content');
var csrf_param = $('meta[name=csrf-param]').attr('content');
uploadify_script_data['_http_accept'] = 'application/javascript';
uploadify_script_data[csrf_param] = csrf_token;//encodeURI(encodeURIComponent(csrf_token));
uploadify_script_data['<%= session_key %>'] = '<%= cookies[session_key] %>';
$('#Uploadify').uploadify({
multi : false,
method : 'post',
swf : '<%= asset_path("uploadify-v3.1/uploadify.swf") %>',
uploader : '/token/'+token_id+'/videos.json',
formData : uploadify_script_data,
fileObjName : 'attachment',
fileTypeExts : '*.mov; *.flv; *.mp4; *.avi; *.mkv; *.wmv; *.mpg; *.MOV; *.FLV; *.MP4; *.AVI; *.MKV; *.WMV; *.MPG',
fileSizeLimit : '50MB',
fileTypeDesc : 'Video Files',
wmode : 'transparent',
auto : true ,
buttonText : 'Select',
buttonClass: 'uploadBtn',
width: 320,
height: 75,
onSelect: function(fileObj){
},
onSelectError: function(file, errorCode, errorMsg){
var ext = file.name;
ext = ext.substr(ext.length-4).toLowerCase();
switch(errorCode){
case -130:
this.queueData.errorMsg = "File extension: " + ext + " is not allowed." + '\n' + "Try one of the following file extensions:" + '\n' + "mov, flv, mp4, avi, mkv, wmv, mpg";
}
},
onUploadSuccess : function(file, data, response)
{
},
onUploadStart: function(file){
// this is to show only uploading progress bar when upload gets started
$("#Uploadify").uploadify('disable', true);
if(!(/8.0|9.0|10.0/.test(ieInspector.ieVersion)))
$("#Uploadify").css("visibility", "hidden");
else
$("#Uploadify-button").css("display", "none");
$(".uploadText").css("display","none");
$(".uploadHeading").css("display","none");
$(".mobileView").css("display","none");
},
onCancel : function(file){
// following block cancels the upload
alert('The file ' + file.name + ' was cancelled.');
},
onUploadError : function(file, errorCode, errorMsg, errorString) {
//Only showing following alert if error is other than cancel of file upload
}
});
谢谢