You can run the application behind some web server, for example Apache, which knows how to authenticate users securely.
You have two options for this:
- Use FastCGI
- Proxy requests to your application.
To go the FastCGI route, use plackup as follows:
plackup -s FCGI myapp.psgi
And in your Apache configuration, use something like this:
LoadModule fastcgi_module libexec/mod_fastcgi.so <IfModule mod_fastcgi.c> FastCgiExternalServer /tmp/myapp.fcgi -host localhost:5000 Alias /myapp/ /tmp/myapp.fcgi/ </IfModule>
Alternatively, you can make Apache proxy requests in your application:
ProxyPass /myapp http://localhost:5000/
Since plackup not recommended for production systems, you should study Starman , which will limit your options to a proxy solution.
innaM
source share