http://www.perlmonks.org?node_id=11122411


in reply to [OT] Next steps in using DigitalOcean to host a website running Mojolicious

This is not a Perl question. See the docs provided by your host: https://www.digitalocean.com/docs/networking/dns/how-to/manage-records/.

"My goal for this thread is to get "hello mojo world" to display"

Does it do that in your local, test environment?


The way forward always starts with a minimal test.
  • Comment on Re: [OT] Next steps in using DigitalOcean to host a website running Mojolicious

Replies are listed 'Best First'.
Re^2: [OT] Next steps in using DigitalOcean to host a website running Mojolicious
by Aldebaran (Deacon) on Oct 14, 2020 at 02:24 UTC
    This is not a Perl question.

    It seems to be a "getting to the perl" question.

    See the docs provided by your host: https://www.digitalocean.com/docs/networking/dns/how-to/manage-records/.

    I stared at those pages for hours, days. The couple hints I got here imparted courage to try something, at least. When I view that page whilst signed in now, the domain information makes more sense, because it's particular.

    "My goal for this thread is to get "hello mojo world" to display" Does it do that in your local, test environment?

    Yes, and your question made me think long and hard about that local, test environment, and how it should have directory hierarchies similar to the target. I've got local and remote results, so super happy about that:

    fred@fourth:~/mojo$ mojo generate lite-app 1.myapp.pl [exist] /home/fred/mojo [write] /home/fred/mojo/1.myapp.pl [chmod] /home/fred/mojo/1.myapp.pl 744 fred@fourth:~/mojo$ ll total 20 drwxrwxr-x 2 fred fred 4096 Oct 13 20:29 ./ drwxr-xr-x 9 fred fred 4096 Oct 13 20:29 ../ -rwxr--r-- 1 fred fred 388 Oct 13 20:29 1.myapp.pl* -rwxr-xr-x 1 fred fred 127 Oct 13 19:12 2.1.mojo_hello.pl* -rwxr-xr-x 1 fred fred 1925 Oct 13 18:41 5.2.elev.pl* fred@fourth:~/mojo$ ./1.myapp.pl daemon [2020-10-13 20:30:50.55473] [75108] [info] Listening at "http://*:3000 +" Web application available at http://127.0.0.1:3000 [2020-10-13 20:31:02.55218] [75108] [debug] [XY-c4b0j] GET "/" [2020-10-13 20:31:02.55290] [75108] [debug] [XY-c4b0j] Routing to a ca +llback [2020-10-13 20:31:02.55381] [75108] [debug] [XY-c4b0j] Rendering templ +ate "index.html.ep" from DATA section [2020-10-13 20:31:02.55514] [75108] [debug] [XY-c4b0j] Rendering templ +ate "layouts/default.html.ep" from DATA section [2020-10-13 20:31:02.55639] [75108] [debug] [XY-c4b0j] 200 OK (0.00419 +6s, 238.322/s) ^Cfred@fourth:~/mojo$ cat 1.myapp.pl #!/usr/bin/env perl use Mojolicious::Lite -signatures; get '/' => sub ($c) { $c->render(template => 'index'); }; app->start; __DATA__ @@ index.html.ep % layout 'default'; % title 'Welcome'; <h1>Welcome to the Mojolicious real-time web framework!</h1> @@ layouts/default.html.ep <!DOCTYPE html> <html> <head><title><%= title %></title></head> <body><%= content %></body> </html> fred@fourth:~/mojo$

    Thanks all for replies.