Discussion:
$c->req->env Empty
(too old to reply)
Viktor Nacht
2018-11-09 09:29:29 UTC
Permalink
In my Mojolicious::Lite app $c->req->env is completely empty under Morbo
and under Hypnotoad behind an Apache reverse proxy. Is this normal or am I
totally missing something?

V
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Stefan Adams
2018-11-09 15:07:51 UTC
Permalink
I would say, yes, this is normal.

From Mojo::Message::Request#env
<https://mojolicious.org/perldoc/Mojo/Message/Request#env>:

Direct access to the CGI or PSGI environment hash if available.


Sounds like you're probably not using CGI or PSGI.
Post by Viktor Nacht
In my Mojolicious::Lite app $c->req->env is completely empty under Morbo
and under Hypnotoad behind an Apache reverse proxy. Is this normal or am I
totally missing something?
V
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Viktor Nacht
2018-11-09 23:20:50 UTC
Permalink
Wow, I really feel stupid.. Thank you for having the patience to reply.
I've been using CGI.pm for around 22 years and Mojolicious for 2 years. Old
habits die hard, lol.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Stefan Adams
2018-11-09 23:30:55 UTC
Permalink
To be clear, Mojolicious can do CGI, but you need to take special steps.
Check the Cookbook or FAQ. I've not done CGI myself since moving to Mojo 6
years ago.

That said, be careful with it. I've seen periodic predictions that CGI
might not always be supported.
Post by Viktor Nacht
Wow, I really feel stupid.. Thank you for having the patience to reply.
I've been using CGI.pm for around 22 years and Mojolicious for 2 years. Old
habits die hard, lol.
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Dan Book
2018-11-09 23:37:09 UTC
Permalink
I don't know any reason to think that CGI would not be supported. It's used
automatically by having the CGI server (usually Apache) run your script as
a CGI script. The problem is that CGI does not run the event loop, so
websockets and async responses can't work. (This is also true when using
the PSGI server, used automatically under plackup.)

-Dan
Post by Stefan Adams
To be clear, Mojolicious can do CGI, but you need to take special steps.
Check the Cookbook or FAQ. I've not done CGI myself since moving to Mojo 6
years ago.
That said, be careful with it. I've seen periodic predictions that CGI
might not always be supported.
Post by Viktor Nacht
Wow, I really feel stupid.. Thank you for having the patience to reply.
I've been using CGI.pm for around 22 years and Mojolicious for 2 years. Old
habits die hard, lol.
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Alexander Karelas
2018-11-10 07:52:58 UTC
Permalink
I have set-up Mojolicious on CGI, it requires a trick that I think
wasn't included in full in the Wiki or in the documentation. I will post
it on Monday from work.

Basically you need to rewrite the browser URL to
/cgi-bin/path/to/my_app.pl/path/of/users/browser (that is, one path
appended to the other)

- Alex
Post by Dan Book
I don't know any reason to think that CGI would not be supported. It's
used automatically by having the CGI server (usually Apache) run your
script as a CGI script. The problem is that CGI does not run the event
loop, so websockets and async responses can't work. (This is also true
when using the PSGI server, used automatically under plackup.)
-Dan
To be clear, Mojolicious can do CGI, but you need to take special
steps. Check the Cookbook or FAQ. I've not done CGI myself since
moving to Mojo 6 years ago.
That said, be careful with it. I've seen periodic predictions that
CGI might not always be supported.
Wow, I really feel stupid.. Thank you for having the patience
to reply. I've been using CGI.pm for around 22 years and
Mojolicious for 2 years. Old habits die hard, lol. 
--
You received this message because you are subscribed to the
Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from
To post to this group, send email to
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it,
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
henq
2018-11-17 12:39:02 UTC
Permalink
Alexander, do you have a link to the post? I have a couple of Mojo lite
apps that get a handful request per day max, and response time is not
important. I'd rather make them run under CGI than having to deal with the
hassle of keeping a daemon running, setting up reverse proxy and so on. But
I have problems with getting internal links working when app is not at /
level, but in subdirectory.
I have set-up Mojolicious on CGI, it requires a trick that I think wasn't
included in full in the Wiki or in the documentation. I will post it on
Monday from work.
Basically you need to rewrite the browser URL to /cgi-bin/path/to/
my_app.pl/path/of/users/browser (that is, one path appended to the other)
- Alex
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Alexander Karelas
2018-11-17 18:23:24 UTC
Permalink
Hi Mr Henq,

I forgot to do this when I was at work. Now we will have to wait again
till Monday when I go back to the office, to find the Apache configuration.

I believe CGI sounds perfect for webapps that receive only a couple of
requests per day, though I'm not an expert.

- Alex
Alexander, do you have a link to the post?   I have a couple of Mojo
lite apps that get a handful request per day max, and response time is
not important. I'd rather make them run under CGI than having to deal
with the hassle of keeping a daemon running, setting up reverse proxy
and so on. But I have problems with getting internal links working
when app is not at / level, but in subdirectory.  
I have set-up Mojolicious on CGI, it requires a trick that I think
wasn't included in full in the Wiki or in the documentation. I
will post it on Monday from work.
Basically you need to rewrite the browser URL to
/cgi-bin/path/to/my_app.pl/path/of/users/browser
<http://my_app.pl/path/of/users/browser> (that is, one path
appended to the other)
- Alex
--
You received this message because you are subscribed to the Google
Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Alexander Karelas
2018-11-20 04:04:22 UTC
Permalink
Dear Mr Henq,

Please see a fresh new thread on this mailing list, that I'll be posting
in a few minutes, with a subject line of "Apache Config for Mojo CGI
setup - opinions?".

- Alexander
Alexander, do you have a link to the post?   I have a couple of Mojo
lite apps that get a handful request per day max, and response time is
not important. I'd rather make them run under CGI than having to deal
with the hassle of keeping a daemon running, setting up reverse proxy
and so on. But I have problems with getting internal links working
when app is not at / level, but in subdirectory.  
I have set-up Mojolicious on CGI, it requires a trick that I think
wasn't included in full in the Wiki or in the documentation. I
will post it on Monday from work.
Basically you need to rewrite the browser URL to
/cgi-bin/path/to/my_app.pl/path/of/users/browser
<http://my_app.pl/path/of/users/browser> (that is, one path
appended to the other)
- Alex
--
You received this message because you are subscribed to the Google
Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...