Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Best suite

by plvicente (Novice)
on May 06, 2021 at 16:37 UTC ( #11132161=perlquestion: print w/replies, xml ) Need Help??

plvicente has asked for the wisdom of the Perl Monks concerning the following question:

Hello Perl Monks,

Should I use this way or this way?

use Mojolicious::Lite; app->config( hypnotoad => { listen => [ '' ], proxy => 1, }, ); # the rest of your application goes here

For mojolicious Apache2

Or this way =>

LoadModule proxy_module lib/httpd/ LoadModule proxy_http_module lib/httpd/ <Proxy *> Order allow,deny Allow from all </Proxy> <VirtualHost *:80> ServerName ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000/ </VirtualHost> <VirtualHost *:80> ServerName ProxyPass / http://localhost:3001/ ProxyPassReverse / http://localhost:3001/ </VirtualHost>

Should I keep this as it is or should I look for other solution?
Instead this eg.

#!/usr/bin/perl -wT use strict; use CGI; my $query = CGI->new(); print $query->header( "text/html" ), $query->start_html(-title => "My First CGI Script", -bgcolor => "#ffffcc" ), $query->h1( "This is a pretty lame web page" ), $query->p( "Who is this Ovid guy, anyway?" ), $query->end_html
I am seeking for solutions to be done on an apache2 server. Take care Monks.

Best Regards Monks,

Replies are listed 'Best First'.
Re: Best suite
by hippo (Chancellor) on May 06, 2021 at 16:44 UTC
    print $query->header( "text/html" ), $query->start_html(-title => "My First CGI Script", -bgcolor => "#ffffcc" ), $query->h1( "This is a pretty lame web page" ), $query->p( "Who is this Ovid guy, anyway?" ), $query->end_html

    Whatever you decide to do, don't do that. See the docs for reasons to avoid this.


Re: Best suite
by karlgoethebier (Abbot) on May 06, 2021 at 17:33 UTC

    Proxying your application server (whatever it is) isn’t a bad idea IMHO. Please see this as well as this for further inspiration. I had some success in the past with Tomcat and NGINX. Unfortunately Perl wasn’t part of the projects. Less or more. I placed some «Perls» in it called by Java 😜😎. Guerrilla tactics. Best regards, Karl.

    «The Crux of the Biscuit is the Apostrophe»

      Thank you for all answers and quick. I am learning how to use perl cgi. I am unix systems background. I asked and thank you in due which it suites better. My application for apache2 is a mix, so I need to know which parameters should work better.

        For a light-weight, powerful, non-monolithic, friendly, stable, easy-to-get started platform for modern web development I strongly recommend you experiment with Dancer2.

        Hope this helps!

        The way forward always starts with a minimal test.
        I am learning how to use perl cgi

        Please don't...
        As others have said, Mojolicious, Dancer2 or my choice is Template - anything except!

Re: Best suite
by haukex (Bishop) on May 06, 2021 at 17:14 UTC

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11132161]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2021-09-28 22:26 GMT
Find Nodes?
    Voting Booth?

    No recent polls found