How can i write a script to execute commands on the webserver from a browser?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How can i write a script to execute commands on the webserver from a browser?
# 1  
Old 10-21-2009
How can i write a script to execute commands on the webserver from a browser?

I want to create a script with the php exec() or system() function to execute commands from a remote browser on the webserver. I am open to using Perl or whatever. I am using an Apache2 webserver on Ubuntu.

I have done quite a bit of research on this on google and read lots of responses about permissions of the server, why not use ssh instead etc. etc..

I know of other ways to do this but I am really interested in how I can make this work from the browser. Thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl script to check read/write/execute permission for 'others'

I want to check access rights permissions not for 'user', not for 'group', but for 'others'. I want to do it by system command in which i want to use 'ls -l' and 'awk' command. I have written the following program : #!/usr/bin/local/perl #include <stdlib.h> system ("ls -l | awk... (1 Reply)
Discussion started by: shubhamsachdeva
1 Replies

2. Solaris

write a script to execute some operations on sun solaris

Sun Microsystems Inc. SunOS 5.9 Generic May 2002 SUNFIRE V240 if there is a power failure, automatically: write all operations in a log file (0 Replies)
Discussion started by: doudou2012
0 Replies

3. UNIX for Dummies Questions & Answers

commands to execute unix script

commands to execute unix script (1 Reply)
Discussion started by: sunilamarnadh
1 Replies

4. Shell Programming and Scripting

Execute shell script from browser through php

Hi all, I want to execute a shell script in which I call ssh to execute a remote command. Everything works fine from command line but when I try to call from PHP (with exec or whatever function) it fails. After some time I came to the root cause: when www-data execute the ssh command it asks... (4 Replies)
Discussion started by: Evan
4 Replies

5. Shell Programming and Scripting

Execute ssh commands through bash script

Hi all! I am trying to write a script that will check if a certain directory is available at several different nodes and then do stuff in it ..... On the beginning of the script I give as a variable the directory and the number of the nodes and then I loop like this: for... (3 Replies)
Discussion started by: idet2
3 Replies

6. Shell Programming and Scripting

Execute interactive bash menu script in browser with PHP

I have an interactive menu script written in bash and I would like use PHP to open the interactive bash menu in a browser. Is this possible? Using the sytem() function in php runs the script but it's all garbled. Seems like maybe a terminal window needs to be opened in php first? ... (1 Reply)
Discussion started by: nck
1 Replies

7. Shell Programming and Scripting

write a shell script to execute a command

Hello all, I have just started doing shell scripting. I want to read a file which stores the status of my job I have submitted on a cluster. The file looks something like this : ========================FILE============================= crab: Checking the status of all jobs: please wait... (4 Replies)
Discussion started by: learn_linux
4 Replies

8. Shell Programming and Scripting

Can we execute series of commands from a single script?

Hi, I am trying to call a certain command from within a shell script, but everytime it executes the script, only the first command runs and it comes out of the control, how do i do it? code : ```````` #!/bin/sh # # #i=1 #while #do # i=`expr $i + 1` #done StoreXML -project xnat -l... (2 Replies)
Discussion started by: virendra maloo
2 Replies

9. Shell Programming and Scripting

Pls Help-Script to execute Commands and write to excel file

Execute some commands in script and store result in excel sheet Kindly help me........... (1 Reply)
Discussion started by: Computer_baby
1 Replies

10. Shell Programming and Scripting

how do i get my script to execute multiple commands?

New to shell scripting. I can't get my script to execute multiple commands. Here's the code. It's a menu script. #!/bin/ksh clear print "SDE MENU" PS3="SDE MENU, enter choice:" select clean_menu in "tasdedev instance 5151" "orkindev instance 5155" "tasdetst instance 5157" "orkinsys... (1 Reply)
Discussion started by: hvincent
1 Replies
Login or Register to Ask a Question
SMOKEPING_CGI(1)						     SmokePing							  SMOKEPING_CGI(1)

NAME
smokeping_cgi - SmokePing webfrontend OVERVIEW
This script acts as a 'website' for your SmokePing monitoring operation. It presents the targets you are looking at in a tree structure and draws graphs as they are required by people looking at the pages. DESCRIPTION
To get smokeping_cgi going, you need a webserver which allows you to run CGI or better FastCGI scripts. The system must be setup so that the cgi process is allowed to write to the image caching area as defined in the config file. This script runs fine as a normal CGI, BUT it will appear to be very slow, because it does a lot of things when starting up. So if the script has to be started a fresh on every click, this is both slow and a tough thing for your webserver. I therefore strongly recommend using FastCGI. Please refer to the installation document for detailed setup instructions. SETUP
There is a sample htdocs directory in your smokeping installation root. Copy its content to the place where your webserver expects its files. There are also two sample cgi scripts showing how to launch the smokeping cgi in your website. The only difference is the file extension. Adjust the paths in the script and you should be ready to go. COPYRIGHT
Copyright (c) 2011 by Tobias Oetiker. All right reserved. LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AUTHOR
Tobias Oetiker <tobi@oetiker.ch> 2.6.8 2013-03-17 SMOKEPING_CGI(1)