[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error 404 when accessing logong screen

On Saturday 03 May 2014 09:52:05 RJ Clay wrote:
> On 05/03/2014 08:50 AM, Thierry Chatelet wrote:
> > On Saturday 03 May 2014 12:15:06 Thierry Chatelet wrote:
> >> Hi,
> >> I made a fresh install on a debian testing machine, using package from
> >> sid. I did : chown -R www-data:www-data /usr/share/ledgersmb and I
> >> restarted apache. Apache is working fine.
> >> When trying to connect to the login screen, I get error 404.
> >> Any tips?
> > 
> > I read the Debian documentation a bit more.
>    Which "Debian documentation" ?
> RJ Clay
> ..hidden..

Yes, my explanation was not good. Here is a more detailed explanation:
Trying to install ledgersmb from sid I got error 404: no such file..., when 
doing localhost/ledgersmb/setup.pl 

I read the Debian doc a bit more and I found in file: 
/usr/share/doc/ledgersmb/faq.html the following:

About installation
The easiest is to use the setup.pl script as root. You don't need to 
know very much about....

So I did and got the following error:

perl setup.pl
Error: No workflow script specified
Compilation failed in require at setup.pl line 8.

Setup.pl :


use FindBin;
  lib->import($FindBin::Bin) unless $ENV{mod_perl}

require 'lsmb-request.pl';

So it's calling lsmb-request.pl at  line 8

Here it is:

=head1 NAME

lsmb-request.pl - The LedgerSMB Request Handler

This file receives the web request, instantiates the proper objects, and 
execution off to the appropriate workflow scripts.  This is for use with 
code only and should not be used with old SQL-Ledger(TM) code as it is 
architecturally dissimilar.


Copyright (C) 2007 The LedgerSMB Core Team

This file is licensed under the GNU General Public License (GPL)  version 
2 or 
at your option any later version.  A copy of the GNU GPL has been 
included with
this software.


package LedgerSMB::Handler;

use LedgerSMB::Sysconfig;
use Digest::MD5;
use Error qw(:try);

$| = 1;

binmode (STDIN, ':bytes');
binmode (STDOUT, ':utf8');
use LedgerSMB::User;
use LedgerSMB;
use LedgerSMB::Locale;
use Data::Dumper;
use LedgerSMB::Log;
use LedgerSMB::CancelFurtherProcessing;
use LedgerSMB::App_State;
use strict;

my $logger = Log::Log4perl->get_logger('LedgerSMB::Handler');

# for custom preprocessing logic
eval { require "custom.pl"; };

$logger->debug("getting new LedgerSMB");

my $request = new LedgerSMB;

$logger->debug("Got \$request=$request");

$request->{action} = '__default' if (!$request->{action});

$ENV{SCRIPT_NAME} =~ m/([^\/\\]*.pl)\?*.*$/;
my $script = $1;
\$request->{action}=$request->{action} \$script=$script");

my $locale;

if ($request->{_user}){
    $LedgerSMB::App_State::User = $request->{_user};
    $locale =  LedgerSMB::Locale->get_handle($request->{_user}-
    $LedgerSMB::App_State::Locale = $locale;
} else {
    $locale = LedgerSMB::Locale->get_handle( 
${LedgerSMB::Sysconfig::language} )
       or $request->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: 
$!\n" );
    $LedgerSMB::App_State::Locale = $locale;
if (!$script){
        $request->error($locale->text('No workflow script specified'));
$request->{_locale} = $locale;

$logger->debug("calling $script");

&call_script( $script, $request );
$logger->debug("after calling script=$script action=$request-
>{action} \$request->{dbh}=$request->{dbh}");

# Prevent flooding the error logs with undestroyed connection 
    if defined $request->{dbh};

sub call_script {
  my $script = shift @_;
  my $request = shift @_;

  try {        
    $request->{script} = $script;
    eval { require "scripts/$script" } 
      || $request->error($locale->text('Unable to open script') . ": 
scripts/$script : $!");
    $script =~ s/\.pl$//;
    $script = "LedgerSMB::Scripts::$script";
    $request->{_script_handle} = $script;
      || $request->error($locale->text("Action Not Defined: ") . $request-
    $script->can( $request->{action} )->($request);
  catch CancelFurtherProcessing with {
    my $ex = shift;
    $logger->debug("CancelFurtherProcessing \$ex=$ex");
     $LedgerSMB::App_State::DBH->rollback if 

I put the code returning the error in between 2 lines so you can spot it 
easily. And I am sure it come from these lines as I change the message 
and ran setup.pl again and got my new message as and error. Now my 
understanding of perl script is nowhere good enough for me to known 
what's wrong. 

"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
Ledger-smb-users mailing list