greenace92 Posted March 9, 2016 Share Posted March 9, 2016 For example the command to make a directory mkdir which php has a command for that... but other functions that may need to be ran through bash but I would like to be triggered by a button. To install a lamp server, I have to run a bunch of commands... apt-get install php5 apt-get install mysql-server apt-get install phpmyadmin etc... I'm aware that you can condense that into a single line, but how can I trigger this single line code that runs in bash, by clicking a button? I was told of some "tools?" that automate server commands, can't recall at the moment. Quote Link to comment https://forums.phpfreaks.com/topic/300966-how-to-automate-bash-commands-and-execute-with-a-simple-click-of-a-button/ Share on other sites More sharing options...
Jacques1 Posted March 9, 2016 Share Posted March 9, 2016 Why do you want this? Executing administrative tasks with PHP or even running the script itself as root is generally the absolute last thing you want. The security of many PHP scripts is already scary enough, but a script with root privileges is orders of magnitudes worse. You need a damn good reason to take that risk. Quote Link to comment https://forums.phpfreaks.com/topic/300966-how-to-automate-bash-commands-and-execute-with-a-simple-click-of-a-button/#findComment-1531828 Share on other sites More sharing options...
greenace92 Posted March 9, 2016 Author Share Posted March 9, 2016 Probably laughable to say but this is for my own hosting "business" (laughs at himself for ineptitude). When I had setup a Wordpress folder/installation for somebody, I had them point their domain to my server's ip address, I then had to create a directory for their domain, a new virtual host, then run the commands to install Wordpress. After that, I told them to go to their domain/wp-admin and that was that. Automate this process after payment. That's what I'm looking to do. Probably in over my head. (You a dummy boy!) Yeah, so that's why I'm asking. Quote Link to comment https://forums.phpfreaks.com/topic/300966-how-to-automate-bash-commands-and-execute-with-a-simple-click-of-a-button/#findComment-1531829 Share on other sites More sharing options...
Jacques1 Posted March 9, 2016 Share Posted March 9, 2016 Probably in over my head. With all due respect: Yes. Acting as a commercial hoster requires a professional infrastructure and a very solid security concept. Wordpress in particular is infamous for all kinds of vulnerabilities, so if you let random people install and manage their own Wordpress site on your server, that's nothing less than suicidal. I strongly recommend you stay away from this. At best, I'd host a few sandboxed, manually installed Wordpress installations for close friends. Anything beyond that is unrealistic. Quote Link to comment https://forums.phpfreaks.com/topic/300966-how-to-automate-bash-commands-and-execute-with-a-simple-click-of-a-button/#findComment-1531831 Share on other sites More sharing options...
greenace92 Posted March 10, 2016 Author Share Posted March 10, 2016 (edited) To what extent is "commercial hoster" ? What if when developing sites for persona/family-owned businesses, I also hosted those sites? Thanks for the suggestion on sandboxing, I'll have to research on that. I'm still working on the file upload process list you provided. What about hosting in general as far as hosting the websites I built... perhaps "management" is allowed edits where I have built in editing functions in pages almost like a blog. What does it take to not be unrealistic? More than one person? Years of experience? I am looking to rent public cloud server(s) (cheap) to use as overflow/backup that would be automated. I'm just wondering if I offer to develop websites then turn around say "Well, go find a host" and if they're in general not very well informed of the web, I would think that I could throw it on as a directory/new virtual host. I wouldn't say to the extent of reseller hosting... but anyway, thanks for your time. Edited March 10, 2016 by greenace92 Quote Link to comment https://forums.phpfreaks.com/topic/300966-how-to-automate-bash-commands-and-execute-with-a-simple-click-of-a-button/#findComment-1531832 Share on other sites More sharing options...
QuickOldCar Posted March 10, 2016 Share Posted March 10, 2016 Honestly the vanilla wordpress versions are not something want piles to be managing across your server. Can enable the wordpress multisites and have an enormous amount of more control with some very important additional plugins. When talking "professional hosting"...something like a virtualization manager using KVM, OpenVZ, Xen or VMWare. Hosting virtual OS, virtual dedicated servers, virtual private servers. Account management, help tickets and support, cpu, memory, bandwidth, storage limitations. Client picks an OS, installs own server or turnkey package Client can only have access their own containers Waaaay back I hosted using hypervm and kloxo. Required centos. Was never an easy thing to do then or even now, be prepared to get schooled with all this. Hard to find the perfect for everything and flaw free solution. Quote Link to comment https://forums.phpfreaks.com/topic/300966-how-to-automate-bash-commands-and-execute-with-a-simple-click-of-a-button/#findComment-1531845 Share on other sites More sharing options...
greenace92 Posted March 10, 2016 Author Share Posted March 10, 2016 people suggested to use reseller hosting account(s) where the people I rented from could offer help as well. The professional hosting stuff is beyond me now. At this point I'd be happy to have a few clients that I designed/built their websites and hosted them. The Wordpress was potential cheap/easy businesses as far as hosting something that I don't have to deal with much. This seems to be how it is with OVH when I rent my VPS from them, complete freedom. Until something goes down... they also have 24/7 call support that's pretty nuts. Quote Link to comment https://forums.phpfreaks.com/topic/300966-how-to-automate-bash-commands-and-execute-with-a-simple-click-of-a-button/#findComment-1531874 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.