简体   繁体   中英

Simple server-side response to wget request with password

My organization maintains a front-end server with back-end compute nodes. Is the following possible (or a good way to do this)?

  • user sends a password protected wget request supplying an input parameter to a PHP or Python script, eg wget http://adress/script.php/arg1&value/
  • PHP script launches a job on the backend, which prepares a data file by doing some computation dependent on the input parameters
  • download of the data file begins for the user

I understand the question is somewhat vague, but we are unsure how to most quickly implement the above feature. We are anticipating receiving at most 1-2 requests per day, and not at the same time.

Yes, it is possible.

It is a 'good way of doing it' on the condition that the script simply produces output data and makes no changes to the server (or the backends), other than some log entries, cache, etc. (stuff that has no visible effect on operation).

You should use https:// and not http:// if this is visible on the public network (to keep the passwords and returned data safe).

You can include the input parameters in any shape and form you want in the URL, but unless you have a special reason not to use an HTTP query, this form is probably best:

wget "https://address/script.php?arg1name=arg1value&arg2name=value2..."

How to implement it quickly: depends what your server setup is. If it has PHP, that's quick and easy enough. Using plain old CGI (with a Python or a shell script) is also an option, nearly all HTTP servers support it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM