Hello dear Monks!

I am trying to run and deploy an app I wrote in Perl and Mojolicious.

When I use Morbo development server, everything is fine, pretty, fast and simple.

But:

When I try to change Apache httpd config file httpd.conf to work with my Mojolicious app according to documentation on the Internet, all pages of the web app are not available -- 404 HTTP error.

Webpages with docs:
http://mojolicio.us/perldoc/Mojolicious/Guides
http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook
http://mojolicio.us/perldoc/Mojo/Server/Morbo
http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad
https://github.com/kraih/mojo/wiki/Apache-deployment
https://github.com/kraih/mojo/wiki/Hypnotoad-prefork-web-server

Relevant part of file httpd.conf (at the end of file):

<VirtualHost *:80> ServerName localhost ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ <Perl> $ENV{PLACK_ENV} = 'production'; $ENV{MOJO_HOME} = '/var/www/MezlApp'; $ENV{MOJO_MODE} = 'deployment'; </Perl> <Location /> SetHandler perl-script PerlResponseHandler Plack::Handler::Apache2 PerlSetVar psgi_app /var/www/MezlApp/script/runapp </Location> </VirtualHost>

This is the last version of text in httpd.conf. After some playing with it I realized I have no idea how to deploy my app to Apache httpd server and I decided to try to play with Hypnotoad but with no positive effect yet.

When I try to run this app with Hypnotoad server:

$ cd ~

my home directory is /home/martin

$ hypnotoad PokusApp/runhtapp.pl

the command fails with this two sentences:

Deep recursion on subroutine "Mojo::Server::Hypnotoad::run" at /home/martin/PokusApp/runhtapp.pl line 7.

Deep recursion on subroutine "Mojo::Server::load_app" at /usr/share/perl5/vendor_perl/Mojo/Server/Hypnotoad.pm line 35.

File /home/martin/PokusApp/runhtapp.pl:

#!/usr/bin/perl use strict; use warnings; use Mojo::Server::Hypnotoad; my $hypnotoad = Mojo::Server::Hypnotoad->new; $hypnotoad->run('/home/martin/PokusApp/script/runapp'); # Line 7!

File /home/martin/PokusApp/script/runapp:

#!/usr/bin/perl use strict; use warnings; use FDI; # FileDirInfo BEGIN { unshift @INC, "$FDI::cfd/../lib"; } require Mojolicious::Commands; Mojolicious::Commands->start_app('PokusApp');

Where is the bug? What I made wrong?

My operatig system is Fedora 20 i386. I use Perl v5.18.2 and Mojolicious distribution from Fedora's repository. Output of:

$ perl -MMojolicious -e "print Mojolicious->VERSION"

is:

4.25

When I run tests:

$ PokusApp/script/runapp test

All tests successful. Result: PASS

Thank you for your help.


In reply to Mojolicious, Morbo, Hypnotoad and Apache httpd deployment [SOLVED] by brilant_blue

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.