Discussion:
[Catalyst] Canot get application working on IIS7 via FastCGI
Craig Chant
2012-10-17 20:49:13 UTC
Permalink
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 6218 bytes
Desc: image001.png
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20121017/016345c0/image001.png
Tomas Doran
2012-10-18 01:24:16 UTC
Permalink
On 17 Oct 2012, at 16:49, Craig Chant wrote:

> Hi,
>
> I?ve been going round in circles unable to find any help on why my catalyst application won?t work on IIS7 Windows Server 2008 R2
>
> I find all the documentation to be incorrect,, such as setting the path to ?*? stops all static content being served from the root/static directory , I had to put ?*.? For images etc to show.
>

Patch please?

> Now I cannot get any path to be recognised, http://mydomain/mycontroller/mymethod does nothing, and all that will load is the Root.pm -> sub index :Path :Args(0) method.
>

Loading the wrong URI is significantly different to doing nothing, no?

> It doesn?t matter what URL I point my browser to all I ever get is the welcome screen from the Root.pm index method.
>
> If I use localhost for the devel server the app resolves the URL path correctly and the associated action runs from the correct controller.
>
> However, over IIS7 it will not work and I cannot find any resources to explain why.
>
> Please help!
>

You haven't given us anything to help try to explain why!

Please can you give us the debug output from startup of the app + the debug logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one at the start to dump $env, and two near the bottom to dump $c->request->uri and $c->request->base just after they've been assigned to?

Cheers
t0m
Craig Chant
2012-10-18 04:54:35 UTC
Permalink
Hello Tomas,

Many thanks for the quick reply, it really is appreciated.

I'll try to answer your comments as best I can and sorry if I haven't provided enough information or conveyed myself coherently enough.

> Patch please?

Do you mean there is a patch to address the path issue? '*.' vs '*'

Is this for Catalyst, perl, a CPAN module, IIS7?

Or do you mean what patch have I installed, if so, none to my knowledge, though I have installed a few CPAN Catalyst:: modules via perl PPM for DBI, Sessions and the dependencies.

Though while we are on the subject of Catalyst plug-ins, I do get this message in the devel server output when it's started.

[warn] Deprecated 'static' config key used, please use the key 'Plugin::Static::Simple' instead

I've looked at the main application MyApp.pm in the lib folder and the plug-ins loaded are :-

use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
StackTrace
Session
Session::Store::FastMmap
Session::State::Cookie
/;

I've tried putting Plugin::Static::Simple insted but that falls over because it can't locate the plug-in module, I've checked PPM and I have 'Plugin::Static::Simple' Catalyst CPAN module installed so am little stumped especially with the limited beginners knowledge I have of your framework so perhaps you could advise.

> Loading the wrong URI is significantly different to doing nothing, no?

Yes sorry if I gave the wrong impression, perhaps I should have worded it differently as I thought I had implied 'other than', maybe this would have been a better statement...

> "Now I cannot get any path to be recognised, http://mydomain/mycontroller/mymethod does nothing, *other than* load the Root.pm -> sub index :Path :Args(0) method."

Which is what is happening and I hope I've made things clearer as to exactly what I'm experiencing.

>You haven't given us anything to help try to explain why!
>Please can you give us the debug output from startup of the app + the debug logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one at the start to dump $env, and two near the bottom to dump $c->request->uri and $c->request->base just after they've been assigned to?

Sorry again for not providing enough information, I will try to give you what you need but I will need a little help doing that also, can you advise where the logs for the app when running over IIS7-> FastCGI are? Is there a file somewhere that gets written to each time the fastcgi.pl script gets executed with this information in it?

Also can you guide me to where this change needs to be made 'Catalyst::Engine::prepare_path method ' for Data::Dumper:Dumper, where is the file that needs editing located? , Also is there a Catalyst method to spit out the data via Data::Dumper already integrated into the framework, or do I need to import it myself?

I hope you can assist as I've been looking forward to building my next app using your framework.

Many thanks,

Craig.


________________________________________
From: Tomas Doran [***@bobtfish.net]
Sent: 17 October 2012 21:24
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

On 17 Oct 2012, at 16:49, Craig Chant wrote:

> Hi,
>
> I?ve been going round in circles unable to find any help on why my catalyst application won?t work on IIS7 Windows Server 2008 R2
>
> I find all the documentation to be incorrect,, such as setting the path to ?*? stops all static content being served from the root/static directory , I had to put ?*.? For images etc to show.
>

Patch please?

> Now I cannot get any path to be recognised, http://mydomain/mycontroller/mymethod does nothing, and all that will load is the Root.pm -> sub index :Path :Args(0) method.
>

Loading the wrong URI is significantly different to doing nothing, no?

> It doesn?t matter what URL I point my browser to all I ever get is the welcome screen from the Root.pm index method.
>
> If I use localhost for the devel server the app resolves the URL path correctly and the associated action runs from the correct controller.
>
> However, over IIS7 it will not work and I cannot find any resources to explain why.
>
> Please help!
>

You haven't given us anything to help try to explain why!

Please can you give us the debug output from startup of the app + the debug logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one at the start to dump $env, and two near the bottom to dump $c->request->uri and $c->request->base just after they've been assigned to?

Cheers
t0m


_______________________________________________
List: ***@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/***@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Services Authority.
David Schmidt
2012-10-18 11:43:55 UTC
Permalink
> Sorry again for not providing enough information, I will try to give you what you need but I
> will need a little help doing that also, can you advise where the logs for the app when
> running over IIS7-> FastCGI are? Is there a file somewhere that gets written to each time
> the fastcgi.pl script gets executed with this information in it?

I am pretty sure that you have to look where your webserver logs to.
With Apache it is possible to configure the log and errorlog location.
I suppose the same is possible for IIS7
Google it.

> Also can you guide me to where this change needs to be made
> 'Catalyst::Engine::prepare_path method ' for Data::Dumper:Dumper, where is the file that
> needs editing located? , Also is there a Catalyst method to spit out the data via
> Data::Dumper already integrated into the framework, or do I need to import it myself?

Look for the file Catalyst/Engine.pm. then search for "prepare_path"
Craig Chant
2012-10-18 15:48:28 UTC
Permalink
Hi David,

OIC, sorry I thought you were talking about some logs to do with Catalyst other than the standard inetpub W3SVCxxx server logs.

Here is what IIS logs show when I access the application.. (IP's have been obfuscated)

#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2012-10-18 09:44:38
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2012-10-18 09:44:38 xxx.xxx.xxx.xxx GET /static/images/catalyst_logo.png - 80 - xxx.xxx.xxx.xxx Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 200 0 0 125
2012-10-18 09:44:38 xxx.xxx.xxx.xxx GET / - 80 - xxx.xxx.xxx.xxx Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 200 0 0 2937
2012-10-18 09:44:38 xxx.xx.xxx.xxx GET /favicon.ico - 80 - xxx.xxx.xxx.xxx Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 200 0 0 46
2012-10-18 09:45:04 xxx.xxx.xxx.xxx GET /librarydocs - 80 - xxx.xxx.xxx.xxx Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 200 0 0 46

The first 3 GET entries are when I visit the root application URL (which displays the Catalyst welcome page) the 4th is the entry when navigating to the path for the LibraryDocs.pm controller.

As for the Data::Dumper information you requested, you will need to give me more guidance because I can't get it to output anything?

Firstly I cannot find the context variable '$c' , there is a '$ctx' , I assume this is what was meant?

I added

dump($env);
dump($ctx->request->uri);
dump($ctx->request->base);

After each assignment but nothing was displayed in the browser , nor were there any entries in the IIS logs.

I have tried 'print' , in front of those commands, nothing is outputted and nothing appears in the logs.

I've also tried 'die' but all I then get in the browser is a 400 error 'Bad Request'.

I've even outputted a header first with :- print "Content-type: text/html\n\n";

Before trying to output the variables, but again all I get is a 'Bad Request' error in my browser.

In fact I have now removed all added code by myself, the devel server fires up and I can use localhost:3000 to navigate to my application and it works fine.

However, using IE to navigate to the production IIS7 URL, all I get now is 400 Bad Request, so now saying 'nothing works' is an accurate statement?

You really need to give me more guidance if I am to provide any of the information you request.

Kind regards,

Craig.

-----Original Message-----
From: David Schmidt [mailto:***@gmx.at]
Sent: 18 October 2012 07:44
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

> Sorry again for not providing enough information, I will try to give
> you what you need but I will need a little help doing that also, can
> you advise where the logs for the app when running over IIS7-> FastCGI
> are? Is there a file somewhere that gets written to each time the fastcgi.pl script gets executed with this information in it?

I am pretty sure that you have to look where your webserver logs to.
With Apache it is possible to configure the log and errorlog location.
I suppose the same is possible for IIS7
Google it.

> Also can you guide me to where this change needs to be made
> 'Catalyst::Engine::prepare_path method ' for Data::Dumper:Dumper,
> where is the file that needs editing located? , Also is there a
> Catalyst method to spit out the data via Data::Dumper already integrated into the framework, or do I need to import it myself?

Look for the file Catalyst/Engine.pm. then search for "prepare_path"

_______________________________________________
List: ***@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/***@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Services Authority.
Adam Sjøgren
2012-10-18 16:17:21 UTC
Permalink
On Thu, 18 Oct 2012 10:48:19 +0000, Craig wrote:

> dump($env);

Try:

use Data::Dumper;
print STDERR Dumper($your_variable);


Best regards,

Adam

--
Adam Sj?gren
***@novozymes.com
David Schmidt
2012-10-18 16:34:01 UTC
Permalink
> As for the Data::Dumper information you requested, you will need to give me more guidance because I can't get it to output anything?
>
> Firstly I cannot find the context variable '$c' , there is a '$ctx' , I assume this is what was meant?
>
> I added
>
> dump($env);
> dump($ctx->request->uri);
> dump($ctx->request->base);

I am just guessing here but what I think you ought to do is

1)
enable debug output of your application by adding the -Debug flag to
your use Catalyst statement

2)
use Data::Dumper;
$ctx->log->debug(Dumper($ctx->request->uri))
...
Craig Chant
2012-10-18 18:17:08 UTC
Permalink
Hi David / Adam,

In the end I gave up with any of the so far provided suggestion, I've wasted hours hunting for logs that just don't seem to exist.

I'm not sure where you believe any of this output is going, but I've searched every IIS log, windows event viewer, searched any file ending in .log and even searched the entire server for any file modified with today's date. I cannot find any file with the data you seem to think should exist. Where do you believe STDERR goes on Windows IIS7?

In the end I rolled my own 'output to file' handler it was far quicker and easier!

This is output for the standard URL with no path (root)

******* $env

$VAR1 = {
'psgi.multiprocess' => 1,
'SCRIPT_NAME' => '',
'PATH_INFO' => '/',
'HTTP_ACCEPT' => 'text/html, application/xhtml+xml, */*',
'REQUEST_METHOD' => 'GET',
'psgi.multithread' => '',
'SCRIPT_FILENAME' => 'C:\\Websites\\ members\\root',
'INSTANCE_META_PATH' => '/LM/W3SVC/49',
'HTTPS_SERVER_ISSUER' => '',
'APP_POOL_CONFIG' => 'C:\\inetpub\\temp\\apppools\\ Members\\ Members.config',
'SERVER_SOFTWARE' => 'Microsoft-IIS/7.5',
'AUTH_PASSWORD' => '',
'CERT_SERIALNUMBER' => '',
'HTTPS_SECRETKEYSIZE' => '',
'AUTH_TYPE' => '',
'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)',
'QUERY_STRING' => '',
'REMOTE_PORT' => '59984',
'CERT_COOKIE' => '',
'URL' => '/',
'HTTP_ACCEPT_LANGUAGE' => 'en-GB',
'FCGI_ROLE' => 'RESPONDER',
'HTTPS_KEYSIZE' => '',
'CONTENT_TYPE' => '',
'CERT_SUBJECT' => '',
'LOCAL_ADDR' => 'xxx.xxx.xxx.xxx',
'psgi.streaming' => 1,
'IIS_UrlRewriteModule' => '7.1.0871.0',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'psgi.version' => [
1,
1
],
'HTTPS' => 'off',
'DOCUMENT_ROOT' => 'C:\\Websites\\ members\\root',
'REMOTE_HOST' => 'xxx.xxx.xxx.xxx',
'psgi.run_once' => '',
'APPL_PHYSICAL_PATH' => 'C:\\Websites\\ members\\root\\',
'PATH_TRANSLATED' => 'C:\\Websites\\ members\\root',
'CERT_ISSUER' => '',
'SERVER_NAME' => 'mydomain.com',
'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
'HTTP_CONNECTION' => 'Keep-Alive',
'CONTENT_LENGTH' => '0',
'INSTANCE_ID' => '49',
'AUTH_USER' => '',
'APPL_MD_PATH' => '/LM/W3SVC/49/ROOT',
'CERT_FLAGS' => '',
'LOGON_USER' => '',
'REMOTE_USER' => '',
'SERVER_PORT_SECURE' => '0',
'INSTANCE_NAME' => 'MEMBERS',
'SERVER_PORT' => '80',
'REMOTE_ADDR' => 'xxx.xxx.xxx.xxx',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'psgi.errors' => bless( \*Symbol::GEN3, 'IO::Handle' ),
'REQUEST_URI' => '/',
'psgi.nonblocking' => '',
'HTTPS_SERVER_SUBJECT' => '',
'APP_POOL_ID' => 'Members',
'psgi.url_scheme' => 'http',
'psgix.harakiri' => '',
'HTTP_HOST' => 'mydomain.com',
'psgi.input' => bless( \*Symbol::GEN1, 'IO::Handle' )
};

*****->base

$VAR1 = bless( do{\(my $o = 'http://mydomain.com/')}, 'URI::http' );

*****->uri

$VAR1 = bless( do{\(my $o = 'http:// mydomain.com/')}, 'URI::http' );


Here is the output for the /librarydocs path.


******* $env

$VAR1 = {
'psgi.multiprocess' => 1,
'SCRIPT_NAME' => '',
'PATH_INFO' => '/',
'HTTP_ACCEPT' => 'text/html, application/xhtml+xml, */*',
'REQUEST_METHOD' => 'GET',
'psgi.multithread' => '',
'SCRIPT_FILENAME' => 'C:\\Websites\\members\\root\\librarydocs',
'INSTANCE_META_PATH' => '/LM/W3SVC/49',
'HTTPS_SERVER_ISSUER' => '',
'APP_POOL_CONFIG' => 'C:\\inetpub\\temp\\apppools\\Members\\Members.config',
'SERVER_SOFTWARE' => 'Microsoft-IIS/7.5',
'AUTH_PASSWORD' => '',
'CERT_SERIALNUMBER' => '',
'HTTPS_SECRETKEYSIZE' => '',
'AUTH_TYPE' => '',
'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)',
'QUERY_STRING' => '',
'REMOTE_PORT' => '60106',
'CERT_COOKIE' => '',
'URL' => '/librarydocs',
'HTTP_ACCEPT_LANGUAGE' => 'en-GB',
'FCGI_ROLE' => 'RESPONDER',
'HTTPS_KEYSIZE' => '',
'CONTENT_TYPE' => '',
'CERT_SUBJECT' => '',
'LOCAL_ADDR' => 'xxx.xxx.xxx.xxx',
'psgi.streaming' => 1,
'IIS_UrlRewriteModule' => '7.1.0871.0',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'psgi.version' => [
1,
1
],
'HTTPS' => 'off',
'DOCUMENT_ROOT' => 'C:\\Websites\\members\\root',
'REMOTE_HOST' => 'xxx.xxx.xxx.xxx',
'psgi.run_once' => '',
'APPL_PHYSICAL_PATH' => 'C:\\Websites\\members\\root\\',
'PATH_TRANSLATED' => 'C:\\Websites\\members\\root\\librarydocs',
'CERT_ISSUER' => '',
'SERVER_NAME' => 'mydomain.com',
'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
'HTTP_CONNECTION' => 'Keep-Alive',
'INSTANCE_ID' => '49',
'CONTENT_LENGTH' => '0',
'AUTH_USER' => '',
'APPL_MD_PATH' => '/LM/W3SVC/49/ROOT',
'CERT_FLAGS' => '',
'LOGON_USER' => '',
'REMOTE_USER' => '',
'SERVER_PORT_SECURE' => '0',
'INSTANCE_NAME' => 'MEMBERS',
'SERVER_PORT' => '80',
'REMOTE_ADDR' => 'xxx.xxx.xxx.xxx',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'psgi.errors' => bless( \*Symbol::GEN3, 'IO::Handle' ),
'REQUEST_URI' => '/librarydocs',
'psgi.nonblocking' => '',
'HTTPS_SERVER_SUBJECT' => '',
'APP_POOL_ID' => 'Members',
'psgi.url_scheme' => 'http',
'psgix.harakiri' => '',
'HTTP_HOST' => 'mydomain.com',
'psgi.input' => bless( \*Symbol::GEN1, 'IO::Handle' )
};

*****->base

$VAR1 = bless( do{\(my $o = 'http://mydomain.com/')}, 'URI::http' );

*****->uri

$VAR1 = bless( do{\(my $o = 'http:// mydomain.com/')}, 'URI::http' );


Hopefully you now have the information you need to advice on the problem.

Let me know if you need anything else.

Kind regards,

Craig.

-----Original Message-----
From: David Schmidt [mailto:***@gmx.at]
Sent: 18 October 2012 12:34
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

> As for the Data::Dumper information you requested, you will need to give me more guidance because I can't get it to output anything?
>
> Firstly I cannot find the context variable '$c' , there is a '$ctx' , I assume this is what was meant?
>
> I added
>
> dump($env);
> dump($ctx->request->uri);
> dump($ctx->request->base);

I am just guessing here but what I think you ought to do is

1)
enable debug output of your application by adding the -Debug flag to your use Catalyst statement

2)
use Data::Dumper;
$ctx->log->debug(Dumper($ctx->request->uri))
...

_______________________________________________
List: ***@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/***@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Services Authority.
Hugh Barnard
2012-10-18 18:26:31 UTC
Permalink
Hi

I'm not an IIS specialist but this answer, especially the 'middle' one
about turning on, -may- be helpful:
http://stackoverflow.com/questions/6426375/where-do-i-find-the-iis7-logs

I'd expect the equivalent of STDERR to be the error log file, if it's
switched on. Sorry if this uses more time but worth a shot.

Best regards Hugh Barnard


On 18 October 2012 14:15, Craig Chant <***@homeloanpartnership.com> wrote:

> Hi David / Adam,
>
> In the end I gave up with any of the so far provided suggestion, I've
> wasted hours hunting for logs that just don't seem to exist.
>
> I'm not sure where you believe any of this output is going, but I've
> searched every IIS log, windows event viewer, searched any file ending in
> .log and even searched the entire server for any file modified with today=
's
> date. I cannot find any file with the data you seem to think should exist.
> Where do you believe STDERR goes on Windows IIS7?
>
> In the end I rolled my own 'output to file' handler it was far quicker and
> easier!
>
> This is output for the standard URL with no path (root)
>
> ******* $env
>
> $VAR1 =3D {
> 'psgi.multiprocess' =3D> 1,
> 'SCRIPT_NAME' =3D> '',
> 'PATH_INFO' =3D> '/',
> 'HTTP_ACCEPT' =3D> 'text/html, application/xhtml+xml, */*',
> 'REQUEST_METHOD' =3D> 'GET',
> 'psgi.multithread' =3D> '',
> 'SCRIPT_FILENAME' =3D> 'C:\\Websites\\ members\\root',
> 'INSTANCE_META_PATH' =3D> '/LM/W3SVC/49',
> 'HTTPS_SERVER_ISSUER' =3D> '',
> 'APP_POOL_CONFIG' =3D> 'C:\\inetpub\\temp\\apppools\\ Members\\
> Members.config',
> 'SERVER_SOFTWARE' =3D> 'Microsoft-IIS/7.5',
> 'AUTH_PASSWORD' =3D> '',
> 'CERT_SERIALNUMBER' =3D> '',
> 'HTTPS_SECRETKEYSIZE' =3D> '',
> 'AUTH_TYPE' =3D> '',
> 'HTTP_USER_AGENT' =3D> 'Mozilla/5.0 (compatible; MSIE 9.0; Wind=
ows
> NT 6.1; WOW64; Trident/5.0)',
> 'QUERY_STRING' =3D> '',
> 'REMOTE_PORT' =3D> '59984',
> 'CERT_COOKIE' =3D> '',
> 'URL' =3D> '/',
> 'HTTP_ACCEPT_LANGUAGE' =3D> 'en-GB',
> 'FCGI_ROLE' =3D> 'RESPONDER',
> 'HTTPS_KEYSIZE' =3D> '',
> 'CONTENT_TYPE' =3D> '',
> 'CERT_SUBJECT' =3D> '',
> 'LOCAL_ADDR' =3D> 'xxx.xxx.xxx.xxx',
> 'psgi.streaming' =3D> 1,
> 'IIS_UrlRewriteModule' =3D> '7.1.0871.0',
> 'GATEWAY_INTERFACE' =3D> 'CGI/1.1',
> 'psgi.version' =3D> [
> 1,
> 1
> ],
> 'HTTPS' =3D> 'off',
> 'DOCUMENT_ROOT' =3D> 'C:\\Websites\\ members\\root',
> 'REMOTE_HOST' =3D> 'xxx.xxx.xxx.xxx',
> 'psgi.run_once' =3D> '',
> 'APPL_PHYSICAL_PATH' =3D> 'C:\\Websites\\ members\\root\\',
> 'PATH_TRANSLATED' =3D> 'C:\\Websites\\ members\\root',
> 'CERT_ISSUER' =3D> '',
> 'SERVER_NAME' =3D> 'mydomain.com',
> 'HTTP_ACCEPT_ENCODING' =3D> 'gzip, deflate',
> 'HTTP_CONNECTION' =3D> 'Keep-Alive',
> 'CONTENT_LENGTH' =3D> '0',
> 'INSTANCE_ID' =3D> '49',
> 'AUTH_USER' =3D> '',
> 'APPL_MD_PATH' =3D> '/LM/W3SVC/49/ROOT',
> 'CERT_FLAGS' =3D> '',
> 'LOGON_USER' =3D> '',
> 'REMOTE_USER' =3D> '',
> 'SERVER_PORT_SECURE' =3D> '0',
> 'INSTANCE_NAME' =3D> 'MEMBERS',
> 'SERVER_PORT' =3D> '80',
> 'REMOTE_ADDR' =3D> 'xxx.xxx.xxx.xxx',
> 'SERVER_PROTOCOL' =3D> 'HTTP/1.1',
> 'psgi.errors' =3D> bless( \*Symbol::GEN3, 'IO::Handle' ),
> 'REQUEST_URI' =3D> '/',
> 'psgi.nonblocking' =3D> '',
> 'HTTPS_SERVER_SUBJECT' =3D> '',
> 'APP_POOL_ID' =3D> 'Members',
> 'psgi.url_scheme' =3D> 'http',
> 'psgix.harakiri' =3D> '',
> 'HTTP_HOST' =3D> 'mydomain.com',
> 'psgi.input' =3D> bless( \*Symbol::GEN1, 'IO::Handle' )
> };
>
> *****->base
>
> $VAR1 =3D bless( do{\(my $o =3D 'http://mydomain.com/')}, 'URI::http' );
>
> *****->uri
>
> $VAR1 =3D bless( do{\(my $o =3D 'http:// mydomain.com/')<http://mydomain.=
com/%27%29>},
> 'URI::http' );
>
>
> Here is the output for the /librarydocs path.
>
>
> ******* $env
>
> $VAR1 =3D {
> 'psgi.multiprocess' =3D> 1,
> 'SCRIPT_NAME' =3D> '',
> 'PATH_INFO' =3D> '/',
> 'HTTP_ACCEPT' =3D> 'text/html, application/xhtml+xml, */*',
> 'REQUEST_METHOD' =3D> 'GET',
> 'psgi.multithread' =3D> '',
> 'SCRIPT_FILENAME' =3D> 'C:\\Websites\\members\\root\\librarydoc=
s',
> 'INSTANCE_META_PATH' =3D> '/LM/W3SVC/49',
> 'HTTPS_SERVER_ISSUER' =3D> '',
> 'APP_POOL_CONFIG' =3D>
> 'C:\\inetpub\\temp\\apppools\\Members\\Members.config',
> 'SERVER_SOFTWARE' =3D> 'Microsoft-IIS/7.5',
> 'AUTH_PASSWORD' =3D> '',
> 'CERT_SERIALNUMBER' =3D> '',
> 'HTTPS_SECRETKEYSIZE' =3D> '',
> 'AUTH_TYPE' =3D> '',
> 'HTTP_USER_AGENT' =3D> 'Mozilla/5.0 (compatible; MSIE 9.0; Wind=
ows
> NT 6.1; WOW64; Trident/5.0)',
> 'QUERY_STRING' =3D> '',
> 'REMOTE_PORT' =3D> '60106',
> 'CERT_COOKIE' =3D> '',
> 'URL' =3D> '/librarydocs',
> 'HTTP_ACCEPT_LANGUAGE' =3D> 'en-GB',
> 'FCGI_ROLE' =3D> 'RESPONDER',
> 'HTTPS_KEYSIZE' =3D> '',
> 'CONTENT_TYPE' =3D> '',
> 'CERT_SUBJECT' =3D> '',
> 'LOCAL_ADDR' =3D> 'xxx.xxx.xxx.xxx',
> 'psgi.streaming' =3D> 1,
> 'IIS_UrlRewriteModule' =3D> '7.1.0871.0',
> 'GATEWAY_INTERFACE' =3D> 'CGI/1.1',
> 'psgi.version' =3D> [
> 1,
> 1
> ],
> 'HTTPS' =3D> 'off',
> 'DOCUMENT_ROOT' =3D> 'C:\\Websites\\members\\root',
> 'REMOTE_HOST' =3D> 'xxx.xxx.xxx.xxx',
> 'psgi.run_once' =3D> '',
> 'APPL_PHYSICAL_PATH' =3D> 'C:\\Websites\\members\\root\\',
> 'PATH_TRANSLATED' =3D> 'C:\\Websites\\members\\root\\librarydoc=
s',
> 'CERT_ISSUER' =3D> '',
> 'SERVER_NAME' =3D> 'mydomain.com',
> 'HTTP_ACCEPT_ENCODING' =3D> 'gzip, deflate',
> 'HTTP_CONNECTION' =3D> 'Keep-Alive',
> 'INSTANCE_ID' =3D> '49',
> 'CONTENT_LENGTH' =3D> '0',
> 'AUTH_USER' =3D> '',
> 'APPL_MD_PATH' =3D> '/LM/W3SVC/49/ROOT',
> 'CERT_FLAGS' =3D> '',
> 'LOGON_USER' =3D> '',
> 'REMOTE_USER' =3D> '',
> 'SERVER_PORT_SECURE' =3D> '0',
> 'INSTANCE_NAME' =3D> 'MEMBERS',
> 'SERVER_PORT' =3D> '80',
> 'REMOTE_ADDR' =3D> 'xxx.xxx.xxx.xxx',
> 'SERVER_PROTOCOL' =3D> 'HTTP/1.1',
> 'psgi.errors' =3D> bless( \*Symbol::GEN3, 'IO::Handle' ),
> 'REQUEST_URI' =3D> '/librarydocs',
> 'psgi.nonblocking' =3D> '',
> 'HTTPS_SERVER_SUBJECT' =3D> '',
> 'APP_POOL_ID' =3D> 'Members',
> 'psgi.url_scheme' =3D> 'http',
> 'psgix.harakiri' =3D> '',
> 'HTTP_HOST' =3D> 'mydomain.com',
> 'psgi.input' =3D> bless( \*Symbol::GEN1, 'IO::Handle' )
> };
>
> *****->base
>
> $VAR1 =3D bless( do{\(my $o =3D 'http://mydomain.com/')}, 'URI::http' );
>
> *****->uri
>
> $VAR1 =3D bless( do{\(my $o =3D 'http:// mydomain.com/')<http://mydomain.=
com/%27%29>},
> 'URI::http' );
>
>
> Hopefully you now have the information you need to advice on the problem.
>
> Let me know if you need anything else.
>
> Kind regards,
>
> Craig.
>
> -----Original Message-----
> From: David Schmidt [mailto:***@gmx.at]
> Sent: 18 October 2012 12:34
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI
>
> > As for the Data::Dumper information you requested, you will need to give
> me more guidance because I can't get it to output anything?
> >
> > Firstly I cannot find the context variable '$c' , there is a '$ctx' , I
> assume this is what was meant?
> >
> > I added
> >
> > dump($env);
> > dump($ctx->request->uri);
> > dump($ctx->request->base);
>
> I am just guessing here but what I think you ought to do is
>
> 1)
> enable debug output of your application by adding the -Debug flag to your
> use Catalyst statement
>
> 2)
> use Data::Dumper;
> $ctx->log->debug(Dumper($ctx->request->uri))
> ...
>
> _______________________________________________
> List: ***@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/***@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
> This Email and any attachments contain confidential information and is
> intended solely for the individual to whom it is addressed. If this Email
> has been misdirected, please notify the author as soon as possible. If you
> are not the intended recipient you must not disclose, distribute, copy,
> print or rely on any of the information contained, and all copies must be
> deleted immediately. Whilst we take reasonable steps to try to identify a=
ny
> software viruses, any attachments to this e-mail may nevertheless contain
> viruses, which our anti-virus software has failed to identify. You should
> therefore carry out your own anti-virus checks before opening any
> documents. HomeLoan Partnership will not accept any liability for damage
> caused by computer viruses emanating from any attachment or other document
> supplied with this e-mail. HomeLoan Partnership reserves the right to
> monitor and archive all e-mail communications through its network. No
> representative or employee of HomeLoan Partnership has the authority to
> enter into any contract on behalf of HomeLoan Partnership by email.
> HomeLoan Partnership is a trading name of H L Partnership Limited,
> registered in England and Wales with Registration Number 5011722.
> Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership
> Limited is authorised and regulated by the Financial Services Authority.
>
> _______________________________________________
> List: ***@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/***@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>


-- =

http://www.hughbarnard.org
http://www.twitter.com/hughbarnard
http://www.big-wave-heuristics.com/
<http://www.hackney-environment-network.org.uk/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20121018/b8042=
a1f/attachment.htm
Lyle
2012-10-18 18:53:38 UTC
Permalink
On 18/10/2012 14:15, Craig Chant wrote:
> Hi David / Adam,
>
> In the end I gave up with any of the so far provided suggestion, I've wasted hours hunting for logs that just don't seem to exist.
>
> I'm not sure where you believe any of this output is going, but I've searched every IIS log, windows event viewer, searched any file ending in .log and even searched the entire server for any file modified with today's date. I cannot find any file with the data you seem to think should exist. Where do you believe STDERR goes on Windows IIS7?

In my experience, IIS will push STDERR to STDOUT which causes a number
of problems. The best thing it to open STDERR to a file of your choice asap:

open( STDERR, ">>/path/to/log/file.log" );


Lyle
Craig Chant
2012-10-18 19:17:40 UTC
Permalink
Thanks Lyle / Hugh,

I've checked the following folders:-

c:\inetpub\logs\LogFiles
C:\Windows\System32\LogFiles\HTTPERR

Plus :- Turn Windows features on or off

But there isn't any options for :- Internet Information Services\World Wide Web Services\Health and Diagnostics\HTTP Logging

Though It seems logging is on as there are files in HTTPERR folder, but none containing any of the information wanted regarding :- debug or print STDERR

Like you suggested Lyle, I created the files myself for output!

Usually my perl apps run using :-

use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;

So I get errors outputted to the browser. Though I would point out that whatever Active State did to the latest perl release for IIS, 'die' no longer outputs a header first so a lot of my scripts now give '500 Internal Server Error' and I'm having to fix them as I go, which is one of the reasons I want to refactor the app to use Catalyst, apart from gaining MVC cuteness and a better architecture I was hoping for better error handling being sent to the browser which it seems 'die' coupled with ' StackTrace' gives, so I'm moving in the right direction. :-)

Anyways, I got the required info in the end, so let's hope someone can advise on a solution as to why the path mapping isn't working?

Kind regards,

Craig.

-----Original Message-----
From: Lyle [mailto:***@cosmicperl.com]
Sent: 18 October 2012 14:54
To: ***@lists.scsys.co.uk
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

On 18/10/2012 14:15, Craig Chant wrote:
> Hi David / Adam,
>
> In the end I gave up with any of the so far provided suggestion, I've wasted hours hunting for logs that just don't seem to exist.
>
> I'm not sure where you believe any of this output is going, but I've searched every IIS log, windows event viewer, searched any file ending in .log and even searched the entire server for any file modified with today's date. I cannot find any file with the data you seem to think should exist. Where do you believe STDERR goes on Windows IIS7?

In my experience, IIS will push STDERR to STDOUT which causes a number of problems. The best thing it to open STDERR to a file of your choice asap:

open( STDERR, ">>/path/to/log/file.log" );


Lyle


_______________________________________________
List: ***@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/***@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Services Authority.
Tomas Doran
2012-10-22 23:46:32 UTC
Permalink
On 18 Oct 2012, at 14:15, Craig Chant wrote:

> Here is the output for the /librarydocs path.
>
>
> ******* $env
>
> $VAR1 = {
> 'psgi.multiprocess' => 1,
> 'SCRIPT_NAME' => '',
> 'PATH_INFO' => '/',


Right, that's IIS asking for a path of /

Ergo Catalyst serves / :_)

I know other people have got this working on IIS7, so it must be possible to get the correct path passed to your app (but I don't know how)..

Cheers
t0m
Tomas Doran
2012-10-22 23:49:26 UTC
Permalink
On 18 Oct 2012, at 14:15, Craig Chant wrote:
> Here is the output for the /librarydocs path.
>
>
> ******* $env
>
> $VAR1 = {
> 'psgi.multiprocess' => 1,
> 'SCRIPT_NAME' => '',
> 'PATH_INFO' => '/',

<snip>

> 'REQUEST_URI' => '/librarydocs'

Actually, do you you have the 'use_request_uri_for_path' config variable set, or not?

(https://metacpan.org/module/Catalyst#CONFIGURATION)

As setting that to true may fix your issues..

Cheers
t0m
Craig Chant
2012-10-23 15:37:38 UTC
Permalink
Bingo - You are a genius Tom!

Thank you so, so much, I would never have found that switch buried in the documentation for a long, long time!

I cannot thank the Catalyst community enough for bearing with me and taking the time to provide all the suggestions and support I have received!

I was getting very frustrated and disheartened and even popped over to the Mojolicious mailing list to see what they had to offer, but I must confess, the reply I got was obnoxious and rude and am so glad I stuck with Catalyst, I can't stand people who thinks a good reply to anyone's thread is 'Google is your friend', Google is no-one's friend especially not mine as trawling through countless threads with contradicting suggestions does not equate to support or a solution, especially for someone who has a disability and finds reading very difficult!

I know I've got a long way to go and I'm sure the framework has a lot of frustration and hurt waiting in the wings for me, but at least I can now start to develop and see where it takes me.

Oh, I would like to point out for clarity that the '500 Server Error', I reported yesterday after once more reconfiguring the IIS mapping, was due to a keying error on my part and nothing to do with the problem I was experiencing. So apologies if I sent anyone in the wrong direction!

Again, thank you for your support, it really is appreciated.

Regards,

Craig.


-----Original Message-----
From: Tomas Doran [mailto:***@bobtfish.net]
Sent: 22 October 2012 19:49
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI


On 18 Oct 2012, at 14:15, Craig Chant wrote:
> Here is the output for the /librarydocs path.
>
>
> ******* $env
>
> $VAR1 = {
> 'psgi.multiprocess' => 1,
> 'SCRIPT_NAME' => '',
> 'PATH_INFO' => '/',

<snip>

> 'REQUEST_URI' => '/librarydocs'

Actually, do you you have the 'use_request_uri_for_path' config variable set, or not?

(https://metacpan.org/module/Catalyst#CONFIGURATION)

As setting that to true may fix your issues..

Cheers
t0m


_______________________________________________
List: ***@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/***@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Services Authority.
Lyle
2012-10-23 16:05:01 UTC
Permalink
On 23/10/2012 11:37, Craig Chant wrote:
> Bingo - You are a genius Tom!
>
> Thank you so, so much, I would never have found that switch buried in the documentation for a long, long time!

As this is standard behaviour for IIS, Catalyst really should be setting
this by default when it's running under IIS. I didn't realise Catalyst
had missed this, otherwise I probably could have answered the op's
question from the start.

if ( $ENV{'SERVER_SOFTWARE'} =~ /IIS/ ) {
...
}

IIS also doesn't have the pwd as the folder where the script is running.
So you usually need to do:

use FindBin qw ($RealBin $RealScript);
use lib $FindBin::RealBin;
chdir $RealBin;

Otherwise you get issues when people try to open files with a relative path.


Lyle
Craig Chant
2012-10-23 17:01:36 UTC
Permalink
Hey Lyle,

Thanks for the heads up, at least I'm now aware of potential issues for file handling, though I usually wrap it in a Perl module for authentication and deliver them that way, though I believe Catalyst has built in functionality for this.

Still a lot to get my head round for sure.

Regards,

Craig.

-----Original Message-----
From: Lyle [mailto:***@cosmicperl.com]
Sent: 23 October 2012 12:05
To: ***@lists.scsys.co.uk
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

On 23/10/2012 11:37, Craig Chant wrote:
> Bingo - You are a genius Tom!
>
> Thank you so, so much, I would never have found that switch buried in the documentation for a long, long time!

As this is standard behaviour for IIS, Catalyst really should be setting this by default when it's running under IIS. I didn't realise Catalyst had missed this, otherwise I probably could have answered the op's question from the start.

if ( $ENV{'SERVER_SOFTWARE'} =~ /IIS/ ) {
...
}

IIS also doesn't have the pwd as the folder where the script is running.
So you usually need to do:

use FindBin qw ($RealBin $RealScript);
use lib $FindBin::RealBin;
chdir $RealBin;

Otherwise you get issues when people try to open files with a relative path.


Lyle


_______________________________________________
List: ***@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/***@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Services Authority.
Tomas Doran
2012-10-24 01:42:55 UTC
Permalink
On 23 Oct 2012, at 12:04, Lyle wrote:

> On 23/10/2012 11:37, Craig Chant wrote:
>> Bingo - You are a genius Tom!
>>
>> Thank you so, so much, I would never have found that switch buried in the documentation for a long, long time!
>
> As this is standard behaviour for IIS, Catalyst really should be setting this by default when it's running under IIS. I didn't realise Catalyst had missed this, otherwise I probably could have answered the op's question from the start.

The option is on by default in generated skeleton apps, and has been for quite a while (at least 2 years). However we can't set it by default as it breaks back compat (see the extensive explanation of the different strategies for path resolution one can employ next to the option).

This should be done at the Plack middleware level IMO - I.e. there should be middleware to synthesise a sane PATH_INFO - this is generic to anything that uses PATH_INFO (not just Catalyst), and it's where / how we already apply all of this conditional logic.

I'd +1 a patch to add a middleware for this (to Plack).

> IIS also doesn't have the pwd as the folder where the script is running. So you usually need to do:
>
> use FindBin qw ($RealBin $RealScript);
> use lib $FindBin::RealBin;
> chdir $RealBin;
>
> Otherwise you get issues when people try to open files with a relative path.


This is normal in other web servers also.

Doing that is broken, we provide $app->path_to so you don't ever have to do that.

Cheers
t0m
Lyle
2012-10-24 02:03:52 UTC
Permalink
On 23/10/2012 21:42, Tomas Doran wrote:
> On 23 Oct 2012, at 12:04, Lyle wrote:
>> IIS also doesn't have the pwd as the folder where the script is running. So you usually need to do:
>>
>> use FindBin qw ($RealBin $RealScript);
>> use lib $FindBin::RealBin;
>> chdir $RealBin;
>>
>> Otherwise you get issues when people try to open files with a relative path.
>
> This is normal in other web servers also.
>
> Doing that is broken, we provide $app->path_to so you don't ever have to do that.

How is it broken?


Lyle
Tomas Doran
2012-10-24 02:31:20 UTC
Permalink
On 23 Oct 2012, at 22:03, Lyle wrote:

>>> Otherwise you get issues when people try to open files with a relative path.
>>
>> This is normal in other web servers also.
>>
>> Doing that is broken, we provide $app->path_to so you don't ever have to do that.
>
> How is it broken?

Because, as much as possible, code should attempt to separate concerns.

The pwd should be the responsibility of the web server layer, not a dependency of your application component.

Standard daemonization techniques include a chdir('/') step

which is always going to ruin relative paths.

Your application precluding your web stack from being a daemon is a pretty big ask, no?

Cheers
t0m
Lyle
2012-10-24 03:08:08 UTC
Permalink
On 23/10/2012 22:31, Tomas Doran wrote:
> On 23 Oct 2012, at 22:03, Lyle wrote:
>
>>>> Otherwise you get issues when people try to open files with a relative path.
>>> This is normal in other web servers also.
>>>
>>> Doing that is broken, we provide $app->path_to so you don't ever have to do that.
>> How is it broken?
> Because, as much as possible, code should attempt to separate concerns.

ok

> The pwd should be the responsibility of the web server layer, not a dependency of your application component.

So when web servers are inconsistent, why shouldn't the application be
sure it's pwd is where it's installed?

> Standard daemonization techniques include a chdir('/') step
>
> which is always going to ruin relative paths.
>
> Your application precluding your web stack from being a daemon is a pretty big ask, no?

Why would a chdir in the application affect the daemons pwd? Or are you
talking about the application running as a daemon itself?


Lyle
Tomas Doran
2012-10-24 01:37:35 UTC
Permalink
On 23 Oct 2012, at 11:37, Craig Chant wrote:

> Bingo - You are a genius Tom!
>
> Thank you so, so much, I would never have found that switch buried in the documentation for a long, long time!
>
> I cannot thank the Catalyst community enough for bearing with me and taking the time to provide all the suggestions and support I have received!

Woop!

Really glad that's fixed for you :-D

I know there were a few things you worked out during this discussion / issue that it'd be worthwhile clarifying in the documentation?

The one I know for sure, I've already done:

http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-Manual.git;a=commitdiff;h=689b0b148a6d4e4c6257618f412460d925c11659

Please could someone offer a patch to fix / clarify this? (git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git)

TIA
t0m
David Schmidt
2012-10-18 11:48:29 UTC
Permalink
> Though while we are on the subject of Catalyst plug-ins, I do get this message in the devel server output when it's started.
>
> [warn] Deprecated 'static' config key used, please use the key 'Plugin::Static::Simple' instead
>
> I've looked at the main application MyApp.pm in the lib folder and the plug-ins loaded are :-
>
> use Catalyst qw/
> -Debug
> ConfigLoader
> Static::Simple
> StackTrace
> Session
> Session::Store::FastMmap
> Session::State::Cookie
> /;
>
> I've tried putting Plugin::Static::Simple insted but that falls over because it can't locate the plug-in module, I've checked PPM and I have 'Plugin::Static::Simple' Catalyst CPAN module installed so am little stumped especially with the limited beginners knowledge I have of your framework so perhaps you could advise.



Doesnt really matter in this case. It just warns you to use

MyApp->config(
'Plugin::Static::Simple' => {
...
}
);

instead of

MyApp->config(
static => {
...
}
);
Craig Chant
2012-10-18 14:41:33 UTC
Permalink
Hi David,

Ah gotcha, thanks found what I believe to be the culprit.

Though I think the code was auto generated when using the helper script to create the base application?

static => {dirs => ['static', qr/^(images|css)/,]}

Replaced with...

'Plugin::Static::Simple' => {dirs => ['static', qr/^(images|css)/,]}

The warning has now gone when firing up the devel server.

Much obliged

Craig.

-----Original Message-----
From: David Schmidt [mailto:***@gmx.at]
Sent: 18 October 2012 07:48
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

> Though while we are on the subject of Catalyst plug-ins, I do get this message in the devel server output when it's started.
>
> [warn] Deprecated 'static' config key used, please use the key 'Plugin::Static::Simple' instead
>
> I've looked at the main application MyApp.pm in the lib folder and the plug-ins loaded are :-
>
> use Catalyst qw/
> -Debug
> ConfigLoader
> Static::Simple
> StackTrace
> Session
> Session::Store::FastMmap
> Session::State::Cookie
> /;
>
> I've tried putting Plugin::Static::Simple insted but that falls over because it can't locate the plug-in module, I've checked PPM and I have 'Plugin::Static::Simple' Catalyst CPAN module installed so am little stumped especially with the limited beginners knowledge I have of your framework so perhaps you could advise.



Doesnt really matter in this case. It just warns you to use

MyApp->config(
'Plugin::Static::Simple' => {
...
}
);

instead of

MyApp->config(
static => {
...
}
);

_______________________________________________
List: ***@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/***@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Services Authority.
Craig Chant
2012-10-22 13:36:43 UTC
Permalink
Well I've provided everything you requested, but not had a reply from you, shall I assume Catalyst doesn't work on IIS until I hear to the contrary?

-----Original Message-----
From: Tomas Doran [mailto:***@bobtfish.net]
Sent: 17 October 2012 21:24
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI


On 17 Oct 2012, at 16:49, Craig Chant wrote:

> Hi,
>
> I've been going round in circles unable to find any help on why my catalyst application won't work on IIS7 Windows Server 2008 R2
>
> I find all the documentation to be incorrect,, such as setting the path to '*' stops all static content being served from the root/static directory , I had to put '*.' For images etc to show.
>

Patch please?

> Now I cannot get any path to be recognised, http://mydomain/mycontroller/mymethod does nothing, and all that will load is the Root.pm -> sub index :Path :Args(0) method.
>

Loading the wrong URI is significantly different to doing nothing, no?

> It doesn't matter what URL I point my browser to all I ever get is the welcome screen from the Root.pm index method.
>
> If I use localhost for the devel server the app resolves the URL path correctly and the associated action runs from the correct controller.
>
> However, over IIS7 it will not work and I cannot find any resources to explain why.
>
> Please help!
>

You haven't given us anything to help try to explain why!

Please can you give us the debug output from startup of the app + the debug logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one at the start to dump $env, and two near the bottom to dump $c->request->uri and $c->request->base just after they've been assigned to...

Cheers
t0m


_______________________________________________
List: ***@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/***@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by the Financial Services Authority.
anthony.okusanya at usbank.com ()
2012-10-22 20:34:02 UTC
Permalink
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 19380 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20121022/7ad954cb/attachment.gif
Craig Chant
2012-10-22 20:58:30 UTC
Permalink
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 899 bytes
Desc: image001.jpg
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20121022/fc9eb668/image001.jpg
Loading...