Lighttpd - the fastcgi-backend /ffp/bin/php-cgi failed to start - telnet

I've been trying to make my lighttpd work for almost two weeks now, but without any luck.
I have a Zyxcel 310 with FFP 0.7 running on a stick. I have transmission working on it just fine (witch includes the "curl" install) but Lighttpd will not work.
This is the error I keep getting. (If I disable fastcgi I just get 503 forbidden).
2013-07-02 21:12:22: (log.c.166) server started
2013-07-02 21:12:22: (mod_fastcgi.c.1103) the fastcgi-backend /ffp/bin/php-cgi failed to start:
2013-07-02 21:12:22: (mod_fastcgi.c.1107) child exited with status 16 /ffp/bin/php-cgi
2013-07-02 21:12:22: (mod_fastcgi.c.1110) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2013-07-02 21:12:22: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed.
2013-07-02 21:12:22: (server.c.945) Configuration of plugins failed. Going down.
I have searched al over and nobody really seems to know what is up. Some fixed the issue but there fix didn't help me.
This is what some one suggested but I also get an error here:
root#nsa310:~# php -i
php: can't load library 'libxml2.so.2'
I bought a new website last week after months of building/testing it on localhost. It is far from done yet but I tought buying it would atleast be a start. The website would be www.volunteeringnews.com "sadly still empty now".
So if someone might have an idea or an error log where I might find some more information I would be very thankfull. Anyway, here are my conf settings. (Part of it, the beginning).
# lighttpd configuration file
#
# use it as a base for lighttpd 1.0.0 and above
#
# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
############ Options you really have to take care of ####################
## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules = (
# "mod_rewrite",
"mod_redirect",
"mod_alias",
"mod_access",
# "mod_cml",
# "mod_trigger_b4_dl",
# "mod_auth",
# "mod_status",
# "mod_setenv",
"mod_fastcgi",
# "mod_proxy",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
"mod_cgi",
"mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog" )
server.modules += ( "mod_fastcgi" )
## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/mnt/HD_a2/public/website/www/"
server.upload-dirs = ( "/mnt/HD_a2/tmp" )
## where to send error-messages to
server.errorlog = "/mnt/HD_a2/public/website/logs/error.log"
# files to check for if .../ is requested
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )
## php support
## uncomment the following lines and the mod_fastcgi module above
fastcgi.server = ( ".php" => ((
"bin-path" => "/ffp/bin/php-cgi",
"socket" => "/tmp/php-cgi.socket",
"max-procs" => 2
)))

I fixed this by installing FFP 0.7 on my NAS direcly. :)

Related

pdf.js incompatible with nuxt 2.15.8

I was using pdfjs-dist v2.5.207 with nuxt v2.4.5 and it was working perfectly fine. Now, that I am trying to upgrade my application to nuxt v2.15.8, the server build is failing because of pdfjs. I tried upgrading pdfjs-dist to v2.14.305 but it's not helping.
The build error log is not giving any useful information. It seems like a build compatibility issue, can someone please suggest a solution here?
I was using worker-loader v3.0.3, which I tried upgrading to v3.0.8, but that also didn't solve the problem.
********************************************************/ /******/ // The module cache
| /******/var __webpack_module_cache__={};/******/ /******/ // The require function
| /******/function __w_pdfjs_require__(moduleId){/******/ // Check if module is in cache
# ./node_modules/pdfjs-dist/webpack.js 14:28-53
# ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/components/PDFDocument.vue?vue&type=script&lang=js&
# ./resources/components/PDFDocument.vue?vue&type=script&lang=js&
# ./resources/components/PDFDocument.vue
# ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/components/preview-documents.vue?vue&type=script&lang=js&
# ./resources/components/preview-documents.vue?vue&type=script&lang=js&
# ./resources/components/preview-documents.vue
# ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/pages/create-report/upload-documents.vue?vue&type=script&lang=js&
# ./resources/pages/create-report/upload-documents.vue?vue&type=script&lang=js&
# ./resources/pages/create-report/upload-documents.vue
# ./.nuxt/router.js
# ./.nuxt/index.js
# ./.nuxt/server.js
# multi ./.nuxt/server.js

Chef, Apache2 cookbook ressource fails to find service[apache2] when called from a custom resource

In my custom chef cookbook (located at https://github.com/sanguis/chef-omeka/tree/lwrp).
I am calling the Apache2 resource web_app from inside a custom resource (LWRP) that is being called from the custom solo.rb recipe.
include_recipe 'apache2'
web_app url do
server_name url
server_aliases aliaes
cookbook_name 'apache2'
docroot dir
allow_override 'All'
directory_index 'false'
# notifies :reload, 'service[apache2]', :delayed
end
This this returns an error:
[#] [2016-02-23T23:02:31+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[#] [2016-02-23T23:02:31+00:00] ERROR: instanceomeka.dev had an error: Chef::Exceptions::ResourceNotFound: resource execute[a2enmod headers] is configured to notify resource service[apache2] with action reload, but service[apache2] cannot be found in the resource collection. execute[a2enmod headers] is defined in /tmp/kitchen/cache/cookbooks/apache2/definitions/apache_module.rb:35:in `block in from_file'
However when I call the same resource from directly inside of a custom recipe here (line 126) it works.
My run list is bellow
# - recipe[build-essential]
- recipe[php::default]
- recipe[apache2]
- recipe[apache2::mod_rewrite]
# - recipe[apache2::mod_expires]
- recipe[apache2::mod_ssl]
- recipe[apache2::mod_php5]
- recipe[omeka::default]
- recipe[omeka::solo]
attributes: # - recipe[build-essential]
- recipe[php::default]
- recipe[apache2]
- recipe[apache2::mod_rewrite]
# - recipe[apache2::mod_expires]
- recipe[apache2::mod_ssl]
- recipe[apache2::mod_php5]
- recipe[omeka::default]
- recipe[omeka::solo]
attributes:
machine_fqdn: omeka.dev
machine_fqdn_as_hostname: true
apache2:
listen_ports: ["80", "443"]
machine_fqdn: omeka.dev
machine_fqdn_as_hostname: true
apache2:
listen_ports: ["80", "443"]
This fails on both ubuntu 14.04 and centos7.
This is a known issue with few workarounds for the moment. The issue is that using the new custom resource system enforces use_inline_resources mode, which is 99% a great idea except for this. That mode creates an isolated run context inside the custom resource so it can't see "out" to the other resources for the purposes of notifications. The Poise helper library offers some tools to get around this, but with Chef core the only major workaround is the super-unsupported (i.e. this might break without a major release):
web_app url do
# ...
notifies :reload, Chef.run_context.resource_collection.find('service[apache2]')
end

Perl cgi compilation error in autovivication.pm

I'm using a perl cgi script that uses our own libraries, which use the "no autovivification" pragma. E.g.
/usr/lib/company/mysim.cgi:
#!/usr/bin/perl -w
use strict;
# ... other use
use Company::Module1;
/usr/lib/perl5/Company/Module1.pm
package Company::Module1;
no autovivification;
use strict;
use warnings;
Approximately 50% of the time, when accessing the URL to reach the cgi script the compilation fails with...
[Fri Dec 04 15:40:10.744901 2015] [:error] [pid 30455:tid 2961136448] Bareword "A_HINT_STRICT" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_WARN" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_FETCH" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_STORE" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_EXISTS" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nBareword "A_HINT_DELETE" not allowed while "strict subs" in use at /usr/lib/i386-linux-gnu/perl5/5.20/autovivification.pm line 144.\nCompilation failed in require at /usr/lib/company/mysim.cgi line 14.\nBEGIN failed--compilation aborted at /usr/lib/company/mysim.cgi line 14.\n
(taken from /var/log/apache2/ssl/error.log as this script sits on the https port).
My environment is:
- debian jessie (8.2)
- tomcat7
- apache2 (2.4)
- perl 5.20.2
- libautovivification-perl 0.12-1+b1
My questions are:
Has anyone seen this before? It seems odd that the autovivification module fails to compile due to a "use strict" pragma.
Can anyone explain the intermittent nature of the compilation error? Even more odd, the cgi fails to compile ~half the time, and works fine (i.e. runs and returns expected results) the other ~half.
Thanks for your time.
09/12/2015: Some additional information...
Thanks all for the feedback.
There's no explicit creation of threads, though this is in the context of apache so there's presumably threading of requests.
The root cause does seem to be a failure in the XSLoader. At least this minimal working example...
package autovivification;
use 5.008_003;
use strict;
use warnings;
our $VERSION;
BEGIN {
$VERSION = '0.12';
}
BEGIN {
require XSLoader;
XSLoader::load(__PACKAGE__, $VERSION);
}
my %bits = (
strict => A_HINT_STRICT,
warn => A_HINT_WARN,
fetch => A_HINT_FETCH,
store => A_HINT_STORE,
exists => A_HINT_EXISTS,
delete => A_HINT_DELETE,
);
compiles, whereas this
package autovivification;
use 5.008_003;
use strict;
use warnings;
our $VERSION;
BEGIN {
$VERSION = '0.12';
}
#BEGIN {
# require XSLoader;
# XSLoader::load(__PACKAGE__, $VERSION);
#}
my %bits = (
strict => A_HINT_STRICT,
warn => A_HINT_WARN,
fetch => A_HINT_FETCH,
store => A_HINT_STORE,
exists => A_HINT_EXISTS,
delete => A_HINT_DELETE,
);
fails with the same error.
So, I'll go a-poking around for a load error in the apache logs.... somewhere.
Thanks again for your time.
16/12/2015: Update - Fixed
The root cause was mod_perl, combined with a (possible) change between apache 2.2 and 2.4. The apache configuration for the script, which gives it a ScriptAlias URI of /cgi-bin/script, occurs before setting up the URI /cgi-bin to be handled by mod_perl. In apache 2.2, this ordering seems to be important and the script was not handled by mod_perl. However, in apache 2.4 the ordering does not seem to be important and the script is now handled by mod_perl.
The error arose because this script was not (and never meant to be) handled by mod_perl. The fix was to change the URI for the script to /somethingelse/script.
Thanks to everyone for the comments.
The root cause was mod_perl, combined with a (possible) change between apache 2.2 and 2.4. The apache configuration for the script, which gives it a ScriptAlias URI of /cgi-bin/script, occurs before setting up the URI /cgi-bin to be handled by mod_perl. In apache 2.2, this ordering seems to be important and the script was not handled by mod_perl. However, in apache 2.4 the ordering does not seem to be important and the script is now handled by mod_perl.
The error arose because this script was not (and never meant to be) handled by mod_perl. The fix was to change the URI for the script to /somethingelse/script.
– HalfOpenedEye

Jasmine runner at '/specs' returned a 302 error: Found

I'm using jasmine-rails-0.4.5 and devise-2.2.3 in a standard rails-3.2 app. When I run bundle exec rake spec:javascript, in order to run the jasmine specs, I'm getting the following message: "Jasmine runner at '/specs' returned a 302 error: Found"
Since I'm using devise any request against the server that is not authenticated yet, it's being redirected to the log-in page. So far so good, that is the expected behavior from devise, but jasmine-rails need to access the /specs url in order to run the tests, so when it tries to access this it, it's getting this error: "Jasmine runner at '/specs' returned a 302 error: Found"
In my routes.rb file I added this line: "*mount JasmineRails::Engine => "/my_specs" if defined?(JasmineRails)*"
Any clue?
Thanks
This is what it fixed the issue (I did an upgrade for a newer version):
update your js libraries
get rid of all the entries under the section "src_files" except for "assets/application.js" on the spec/javascripts/support/jasmine.yml file
Add this file:
+++ b/spec/javascripts/support/jasmine_helper.rb
## -0,0 +1,13 ##
+#Use this file to set/override Jasmine configuration options
+#You can remove it if you don't need it.
+#This file is loaded *after* jasmine.yml is interpreted.
+#
+#Example: using a different boot file.
+#Jasmine.configure do |config|
+# #config.boot_dir = '/absolute/path/to/boot_dir'
+# #config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] }
+#end
+#
+
+Rails.application.config.action_controller.asset_host = "//localhost:8888"
+Rails.application.config.base_url = ENV['BASE_URL'] || "http://localhost:8888"
Get rid of this file: spec/javascripts/support/jasmine_runner.rb
Hope this helps

Recreate versions using Carrierwave with Ruby

The website I am working on is going through a redesign and as such, our user images need to be re-sized. The website is currently using carrierwave gem to handle all image and video processing, and each image has a original file with a unique file name based on the following:
def filename
if original_filename
if model && model.read_attribute(:user_image).present?
model.read_attribute(:user_image)
else
#name ||= "#{secure_token}.#{file.extension}" if original_filename.present?
end
end
end
and secure_token be generated by
def secure_token
var = :"##{mounted_as}_secure_token"
model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
end
The task that is created to do this is:
##
# CarrierWave Amazon S3 File Reprocessor Rake Task
#
# Written (specifically) for:
# - CarrierWave
# - Ruby on Rails 3
# - Amazon S3
#
# Works with:
# - Any server of which you have write-permissions in the Rails.root/tmp directory
# - Works with Heroku
#
# Not tested with, but might work with:
# - Ruby on Rails 2
#
# Might work with, after a couple of tweaks:
# - File System Storage
# - Cloud Files Storage
# - GridFS
#
# Examples:
#
# Reprocess all versions of User#avatar
# rake carrierwave:reprocess class=User mounted_uploader=avatar
#
# Reprocess the versions: thumb, small, medium for User#avatar
# rake carrierwave:reprocess class=User mounted_uploader=avatar versions='thumb, small, medium'
#
# Reprocess for an underlying association, for things like Embedded MongoDB Documents
# which are models you cannot access directly, but rather through a regular Document
#
# Embeds One (picture) Association
# rake carrierwave:reprocess class=User association=picture mounted_uploader=image versions='thumb, small, medium'
#
# Embeds Many (pictures) Association
# rake carrierwave:reprocess class=User association=pictures mounted_uploader=image versions='thumb, small, medium'
#
# WARNING
# There is an issue with "Rake", that you cannot name your mounted_uploader "file".
# If you do this, then you will not be able to reprocess images through this rake task
# class User
# include Mongoid::Document
# mount_uploader :file, PictureUploader
# end
#
# This will NOT work with reprocessing through Rake because the mounted_uploader uses the "file" attribute.
namespace :carrierwave do
##
# Only tested with Amazon S3 Storage
# Needs some minor modifications if you want to use this for File System Store, Cloud Files and GridFS probably.
# This should work without Ruby on Rails as well, just set a different TMP_PATH.
desc "Reprocesses Carrier Wave file versions of a given model."
task :reprocess => :environment do
##
# Load in the OPEN URI library to be able
# to pull down and store the original file in a temp directory
require 'open-uri'
##
# Default constants
TMP_PATH = "#{Rails.root}/tmp/carrierwave"
##
# Set environment constants
CLASS = ENV['class'].capitalize
ASSOCIATION = ENV['association'] || nil
MOUNTED_UPLOADER = ENV['mounted_uploader'].to_sym
VERSIONS = ENV['versions'].nil? ? Array.new : ENV['versions'].split(',').map {|version| version.strip.to_sym}
##
# Find the Model
MODEL = Kernel.const_get(CLASS)
##
# Create the temp directory
%x(mkdir -p "#{TMP_PATH}")
##
# Find all records for the provided Model
records = MODEL.all
##
# Output to console
puts "\nCarrier Wave Version Reprocessing!"
puts "======================================="
puts "Model: #{CLASS}"
puts "Mounted Uploader: #{MOUNTED_UPLOADER}"
puts "Association: #{ASSOCIATION}" if ASSOCIATION
puts "Versions: #{VERSIONS.empty? ? "all" : VERSIONS.join(', ')}\n\n"
##
# Run through all records
records.each do |record|
##
# Set the mounted uploader object
# If it has a one-to-one association (singular) then that object
# will be returned and wrapped in an array so we can "iterate" through it below.
#
# If it has a one-to-many association then it will return the array of associated objects
#
# If no association is specified, it assumes the amounted uploader is attached to the specified CLASS
if ASSOCIATION
if ASSOCIATION.singular?
objects = [record.send(ASSOCIATION)]
else
objects = record.send(ASSOCIATION)
end
else
objects = [record]
end
##
# Iterates through the objects
objects.each do |object|
##
# Returns the mounted uploader object
mounted_object = object.send(MOUNTED_UPLOADER)
##
# Retrieve Filename
filename = mounted_object.path.split('/').last
##
# Output to console
puts "Reprocessing: #{filename}"
##
# Read out the original file from the remote location
# and write it out to the temp directory (TMP_PATH)
# This file will be used as the base file to reprocess
# the versions. Once all versions have been processed,
# this temp file will be directly removed.
open(mounted_object.url) do |original_object|
File.open(File.join(TMP_PATH, filename), 'w') do |temp_file|
temp_file.write(original_object.read)
end
end
##
# By default it will add all available versions to the versions variable
# which means that all available versions will be reprocessed.
# If the "versions" argument has been provided, then only the specified
# version(s) will be set to the versions variable, and thus, only these
# will be reprocessed.
versions = mounted_object.versions.map {|version| version[0]}
versions = VERSIONS unless VERSIONS.empty?
##
# Reprocesses the versions
versions.each do |version|
mounted_object.send(version).cache!(File.open(File.join(TMP_PATH, filename)))
mounted_object.send(version).store!
end
##
# Removes the temp file
%x(rm "#{TMP_PATH}/#{filename}")
end
end
end
end
The problem is that while it creates the new images, the files are saved under a new file name rather than following the naming laid out in the image uploader, so the website cannot find them. The following is an example of how the images are stored.
How it should be:
Original file:
fdk392ks93_39ei.png
thumbnail version:
thumb_fdk392ks93_39ei.png
How it is:
Original file:
fdk392ks93_39ei.png
thumbnail version:
thumb_fajeilkadifej_jakdjfi.png
Any help would be very appreciated.
Other info:
Model: User
Uploader: user_image (this is also the column name which stores the folder/file name)
After calling recreate_versions! you have to call save! on the model. You can check out this question where someone asked basically the same thing.
The README clearly states how to recreate Carrierwave versions:
https://github.com/jnicklas/carrierwave/blob/master/README.md
"You might come to a situation where you want to retroactively change a version or add a new one. You can use the recreate_versions! method to recreate the versions from the base file. This uses a naive approach which will re-upload and process the specified version or all versions, if none is passed as an argument.
instance = MyUploader.new
instance.recreate_versions!(:thumb, :large)
Or on a mounted uploader:
User.all.each do |user|
user.avatar.recreate_versions!
end