Answer the question
In order to leave comments, you need to log in
How to execute a command from a website on a linux server?
Hello! There is a server based on Linux Debian 10 with php, nginx, mysql, wordpress, ansible installed and, accordingly, to raise the site on it. There is such an idea: a user from Windows machines enters the site, conditionally, clicks on a certain button, and the automatic installation of programs to his computer begins. The question is, how and with what help can such a button be made (i.e. how to send a command from the site to the server for ansible to work)?
PS From the server console, everything is already configured in the usual way, I can run the installation of programs on a remote Windows computer.
Answer the question
In order to leave comments, you need to log in
1. Create a console controller or a simple php file that will contain all these commands that start the installation of programs.
2. From the web controller Transfer control to the console controller. You can use the exec command , or you can write the job to the queue. And already the console script itself starts all tasks according to the schedule.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question