auth user and exec a node app only with apache?

Posted by Blame on Server Fault See other posts from Server Fault or by Blame
Published on 2013-10-20T17:58:44Z Indexed on 2013/10/20 21:56 UTC
Read the original article Hit count: 166

Filed under:
|

I couldn't find an answer on the web and I'm trying for days now so I hope that someone with more experience with apache can help me out.

Iam writing an web editor and the user should be able to edit a file that is on the server in a directory the user has access to.

The problem Iam facing is that I need to authenticate against the system users (shadow/passwd). So the user should be able to login whith a system account and then the node app which does all the logic should be started with the users rights.

I hope to get this working without any additional script and only with Apache.

I found out two things:

  1. I can use mod_auth_pam to authenticate the user
  2. There is a mod called suEXEC which can exec the node app with a specified user

The problem is that I have to hard code which user is used by suEXEC but I want to decide when the user logs in.

Is there any way to authenticate a user against the shadow/passwd and then exec a prog with the users rights?

I dont want to run the node app as root and the user should only be able to access his own files.

Any help would be appreciated!

Thanks, Kodak

© Server Fault or respective owner

Related posts about apache2

Related posts about authentication