Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8956349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:46:15+00:00 2026-06-15T14:46:15+00:00

I’ve got a webserver written in node.js, it pretty much just serves the user

  • 0

I’ve got a webserver written in node.js, it pretty much just serves the user with static files. To add PHP support to it I thought i could just download PHP and give PHP.exe the file. That works and will be sufficient if it where to be used by a single user. For an environment where multiple users would host their website on the server it’d however bring along a huge security issue. One could use a PHP script to do whatever he/she would want with any of the other websites or even the entire server.

Oh did i mention it is a windows server?

Anyways, so what i want is to get some permissions working to keep the php script within a specific directory.
I’m thinking in the direction of creating a user for each website on which I’ll apply the appropriate permissions and than when executing php.exe using something like ‘run as’ (assuming it is possible).
Are there any other ways for me to achieve my goal? And if so would they be better? Why so?

Also if you’re interested, my code looks like: http://pastebin.com/gZjN1mnj

Also I’m aware that $_POST, $_SERVER, $_COOKIE, $_SESSION etc. are all missing when using my server, but I’ve already thought of how to get that fixed and had one succesful test with it.

Now I’m already feeling the responses: why the hell would you do that? OR don’t, apache/nginx are better, etc. etc.
Consider it a learning process, I was just interested whether i could get it all to actually work ^^

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:46:17+00:00Added an answer on June 15, 2026 at 2:46 pm

    Congratulations on the mixed bag franken platform your developing 🙂

    Switch to Linux use process.setuid

    Node.js is a great webserver, so I can see the appeal. You’re swimming upstream by running both node and php on windows. If you have control I would switch over to linux.

    If you were running in Linux, Node has a built in functions process.setguid and process.setuid You have to be root to run these but a node.js program could run as root spawn a node process for each user, then jail itself and route all traffic to the child node processes that are jailed to specific users.

    Have a specific php.ini for each user

    You can use php safe mode, base_dir and other ini commands to try and jail php to a specific directory tree. This is flaky and incomplete and many of these features have been deprecated or removed in the latest releases because of bugs and ways around these. But its trivial to pass in an ini file with your php command line call.

    Use Third-pary RUNAS utility

    To really have user security in windows you’ll have to run something like autoIT RunAs
    http://www.autoitscript.com/autoit3/docs/functions/RunAs.htm

    As opposed to the normal runas command this one lets you specify a password so it could be run from your node process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.