LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Running a shell script from a web page (https://www.linuxquestions.org/questions/linux-newbie-8/running-a-shell-script-from-a-web-page-506428/)

anirbande 12-01-2006 12:51 AM

Running a shell script from a web page
 
Hi,
This is my first post here and I am new to Linux

I want to run a shell script from a HTML page
But my Apache Server gives errors when i execute a perl script (Internal Error)
Security is no concern here.
I want to configure /etc/httpd/conf/httpd.conf
so that it run shell scripts from any where in the server.
If u know how to write simple shell commands in perl plz advise

My AIM: I will have an Apache server running. A web page will be hoisted on that which will have options for running several commands as well as shell srcipts on the server without any security concern, remotely

The web page may be in Perl or HTML

Renars 12-01-2006 01:36 PM

It doesn't have too much to be done with apache. The main key in this is PHP. You can try using PHP's system() function, like

Code:

<?php system("/usr/bin/uptime"); ?>
or any other program. Just make sure the executable's permissions are set correctly, so the user which apache (php) runs on, can execute it.

Also you may be interested in PHP shell that will allow you to execute commands from webpage.
You can download it from http://spider-it.eu.org/download.php?view.9

Cheers.


All times are GMT -5. The time now is 11:34 PM.