Reputation: 249
My organization maintains a front-end server with back-end compute nodes. Is the following possible (or a good way to do this)?
wget
request supplying an input parameter to a PHP or Python script, e.g. wget http://adress/script.php/arg1&value/
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.
Upvotes: 0
Views: 184
Reputation: 5354
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.
Upvotes: 1