Operating System - HP-UX
1837910 Members
2236 Online
110124 Solutions
New Discussion

Re: stop/start though web page?

 
SOLVED
Go to solution
someone_4
Honored Contributor

stop/start though web page?

Hello and good morning everyone ..
I was wondering if anyone knows of a way to stop and start or just execute a remsh command though a webpage ? I already have apache set up on one box and it works great. But I have an app on another box that I would like to stop and start though a web page can be done though the execution of a remsh though a web interface? Thanks

Richard
8 REPLIES 8
Edward Alfert_2
Respected Contributor
Solution

Re: stop/start though web page?

you can use webmin

http://www.webmin.com/webmin/

it has an addon module that lets you execute any command throught a web interface... make sure you are sure you want to do this... it doens't use https only http

i have it installed and it works great.
"Do what you love and you will never work a day in your life." - Confucius
someone_4
Honored Contributor

Re: stop/start though web page?

Hey edward ..
how hard was the installation ?
and is it free?

Edward Alfert_2
Respected Contributor

Re: stop/start though web page?

it is free and runs on any unix/linux

the install was easy very easy and straightforward.

Also, if you have hpux 11i, it comes bundled with the system if you install apache during os install.

try http://yourserver:10000

that is the default port for webmin

Once it is installed, it is very easy to upgrade to the latest version or add a module. Just point and click on the various webpages.

It has modules for all kinds of things like sendmail, postfix, mysql, apache, squid, bind, ftp, majordomo, and countless other popular applications.
"Do what you love and you will never work a day in your life." - Confucius
Ralph Grothe
Honored Contributor

Re: stop/start though web page?

Hi Richard,

you can achieve this through a little CGI script.
In fact nothing else is done by webmin.
Webmin is a little http server with a bunch of CGI scripts entirely written in Perl.
If you are adventurous enough and are aware of the security implications you could for instance (in a trusted host environment between the boxes) allow a user to execute (non-perilious) commands on the remote box by putting him in the .shost file of the login account on the remote box.
I would recommend to use ssh instead of remsh.

Then you could write a small CGI script and place it in the ScriptAlias directory of the webserver, and make it executable by the webserver's UID.

In Perl one could write something like

$ruser = 'user_on_remote_box';
$rhost = 'fqn_of_remote_box';
print <
Context-type: text/html



remote ls -lR



HEADER

open SSH, "/usr/local/bin/ssh -l $ruser $rhost /usr/bin/ls -lR |";
while () { print }
close SSH;

print "\\n\\n";
__END__

But it is much better to use Perl's CGI.pm module, read the POD (i.e. "perldoc CGI").

Madness, thy name is system administration
someone_4
Honored Contributor

Re: stop/start though web page?

OHHH THIS IS GOOD STUFF !!!
im liking this webadmin stuff !!
nice .. very nice ..
Can you point me how to add modules or the options to execute command though here?

Richard
Edward Alfert_2
Respected Contributor

Re: stop/start though web page?

i have version 0.87 (some layout changes from 0.84 so depending on the version you have, they may be in differnt screens).

Adding Modules:
go to "webmin" tab
then "webmin configuration"
then "webmin modules"
then "from local from" select the directory where you download the module to.
You can donwload modules from
http://www.webmin.com/webmin/standard.html
and thirdparty ones from
http://webmin.thirdpartymodules.com/

MANY.. MANY to choose from.

the one i use for ssh/telnet i downloaded and it put it under the "other" tab

on that same "other" tab i also have one that lets me run commands throught a web form .. the module is called "command shell"
"Do what you love and you will never work a day in your life." - Confucius
someone_4
Honored Contributor

Re: stop/start though web page?

i got it going here ..
one last question when you add a module do you have to restart webmin ?if so how do i restart this thing?
someone_4
Honored Contributor

Re: stop/start though web page?

edward
I found it looking though the webadmin website.
Thanks allot for all your help

Richard