0

I currently got a script running on a Debian server. It outputs the IPTables rules present at the time, in plain text format.

However, I got a separate webserver running, with a kind of CMS on it. What I want to do, is make a page where the output of that very same script gets shown. So, a HTML page needs to be able to execute the script and show the user the output. How can this be done in the most efficient way?

I'm thinking of setting up a SSH tunnel, and opening it when the user opens the page.

1 Answer 1

1

Instead of a SSH tunnel, you could write a simple server (e.g. node.js) and run it on a custom port. Such server should expose some (read-only) apis returning your data in a format easy to manipulate (e.g. JSON). You can of course add some kind of authentication (htaccess may be fine) to avoid others to call the apis.

On the webserver, your CMS will query these apis, then parse the results and show them consequently.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.