Perlba...Server(3pm)

πŸ“¦
version 1.80 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– Perlbal::Manual::WebServer πŸ’–

okay bestie, so this is the manual page for Perlbal::Manual::WebServer β€” it lives in the User Contributed Perl Documentation section of the manual (section 3pm, for the record), and it's literally all about configuring Perlbal as a Web Server. buckle up πŸŽ€


✨ VERSION ✨

Perlbal 1.78. that's the one we're talking about here. πŸ’…


🌸 DESCRIPTION 🌸

The whole point of this page: how to configure a Perlbal Web Server service. that's it, that's the vibe. πŸ¦‹


πŸ‘‘ READ ME FIRST πŸ‘‘

no fr, read this first: go read Perlbal::Manual::Configuration before you read this one. this doc will make so much more sense after you've read that. i'm not being dramatic, it's just true. πŸ’œ


🧚 Configuring Perlbal as a Web Server 🧚

so by default, perlbal goes looking for a config file at /etc/perlbal/perlbal.conf. that's just where it expects you to keep your stuff. πŸ“

but!! you can also point perlbal at a different config file using the -c flag, like:

$ perlbal -c /home/user/perlbal.conf

now here's a super simple example where we set up a lil web server that serves an index file under /tmp:

CREATE SERVICE perlbal_test
    SET role           = web_server
    SET listen         = 0.0.0.0:80
    SET docroot        = /tmp
ENABLE perlbal_test

so what's happening here:

  • the first line creates a service called perlbal_test
  • the last line enables that service (no enable = no service, bestie)

and the three parameters in the middle say β€” in order β€” that this service is a web server, that it listens on all addresses on port 80, and that its document root is /tmp. iconic. πŸ”₯


🌈 Parameters 🌈

you can set parameters with commands in either of these two forms:

SET <service-name> <param> = <value>
SET <param> = <value>

now let's meet the whole cast 🫢

  • dirindexing = bool β€” shows directory indexes when an HTTP request is for a directory.
⚠️ warning bestie: this is not an async operation, so it will slow Perlbal down on heavily loaded sites. be careful out there. 😭

Default is false.

  • docroot = directory/root β€” the directory root for the web server. that's where your files live, periodt.
  • enable_concatenate_get = bool β€” turns on Perlbal's multiple-files-in-one-request mode, where a client can use a comma-separated list of files to return, always in text/plain.

this is so useful for web apps that have dozens/hundreds of tiny css/js files, and don't trust browsers/etc to do pipelining. πŸ’…

it decreases overall round-trip latency a bunch, but it requires the app to be modified to support it. see the t/17-concat.t test for details.

Default is false.

  • enable_md5 = bool β€” enables verification of the Content-MD5 header in HTTP PUT requests.

Default is true.

  • enable_delete = bool β€” enables HTTP DELETE requests.

Default is false.

  • enable_put = bool β€” enables HTTP PUT requests.

Default is false.

  • index_files = comma-separated list of filenames β€” a comma-separated list of filenames to load when a user visits a directory URL, listed in order of preference. first one wins, basically. πŸŽ€

Default is index.html.

  • max_put_size = size β€” the maximum content-length that will be accepted for a PUT request, if enable_put is on.

Default is 0, which means there is no limit. (zero = infinite vibes, iykyk)

  • min_put_directory = int β€” if PUT requests are enabled, require this many levels of directories to already exist. if not, fail. no shortcuts. πŸ’€

Default is 0.

  • server_tokens = bool β€” whether to provide a Server header.

Perlbal by default adds a header to all replies (such as the web_server role). by setting this default to "off", you can prevent Perlbal from identifying itself. stealth mode. πŸ™ˆ

Default is "on".


⭐ SEE ALSO ⭐

  • Perlbal::Manual::Configuration
  • Perlbal::Manual::Management

and that's the whole page, bestie πŸ’– this was Perlbal 1.78, documented under perl v5.34.0 and dated 2022-06-28 β€” go forth and serve some files, you absolute main character πŸ‘‘βœ¨

πŸ“¦ where this page comes from