-
I want to replace my CGI scripts with Mojolicious using nginx with a reverse proxy to Hypnotoad. I previously had a factcgi process running as the nginx user and I want nginx to also own the Hypnotoad process. This seems much more secure than running the process myself since I have superuser privileges but barring this, I don't want to compromise the security of folders that I own. The Mojo script in question will be accepting user input and writing data to the disk. I can't figure out how to do this however. Right now, I have local::lib set up with Mojolicious installed in ~/perl5. I tried installing the perl-Mojolicious package provided by my distro (CentOS 7) since a system-wide install is executable by the nginx user but it's too old and it doesn't seem to work. I'm not sure how to install packages system-wide with cpanm and this also doesn't seem like the right approach. Assuming my site is served from |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
There is no restriction what user can run a mojo app based on its location or owner. The user must have permissions to read the script, and must have the environment set up to load your Perl modules. Since you are using a local::lib which is specific to your user, you must configure that local::lib location in the other user's env in your init script for the hypnotoad daemon (which can also handle choosing the user to run it as).
|
Beta Was this translation helpful? Give feedback.
-
I use:
which seems to work for me. |
Beta Was this translation helpful? Give feedback.
There is no restriction what user can run a mojo app based on its location or owner. The user must have permissions to read the script, and must have the environment set up to load your Perl modules. Since you are using a local::lib which is specific to your user, you must configure that local::lib location in the other user's env in your init script for the hypnotoad daemon (which can also handle choosing the user to run it as).
PERL5LIB=/path/to/your/perl5/lib/perl