Apache

I'm trying an experiment in a trusted environment -- behind a firewall in a small, family owned business. I'd like to try using scripts in /apache/cgi-bin to open applications on the local machine.

For example, I created a page in /apache/htdocs with a link to a shell script I put in /cgi-bin. I named the script "so5" and it reads:

#!/bin/sh
/opt/Office51/bin/soffice

If I run this script from a command line, it opens Star Office.  IfI follow the link to it, it is simply displayed as a text page on the browser.

My question is two-fold:

1. Is it even possible to start applications such as Star Office from cgi-bin scrpts?

2. If it is, can somebody point me to online docs that describe how one might do this?

TIA
LVL 1
bughead1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bughead1Author Commented:
Adjusted points to 150
0
tknayakCommented:
cgi-scripts can run programs like star office as I feel .. but as cgi scripts run on the server .. so u have to set display to run it on ur machine .. the above script u have written would have few modifications as

#!/bn/sh
xhost +
DISPLAY=yourhost:0.0
export DISPLAY
/opt/Office51/bin/soffice

and u need to have a faster network connecttion for this .. i mean between ur server and ur machine(client) ..
hope this works ..
0
tknayakCommented:
sorry!in the above script .. you have to remove that xhost + line
rather u have to run that command on ur client machine ..
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

bughead1Author Commented:
tknayak:

I have to reject the answer because everything is, at this time, running on one machine.  Allow me to explain:  Star Office and Apache are both installed and running on a central file and print server.  The work stations function only as Xterminals...thus the export function is of no value in this type of network and applications do not run on the client machines -- but rather only on the file server and are displayed on the client machines.

I have the network speed -- I already run Star Office on the file server and display it on the workstations -- and the issue isn't even really Star Office -- for the purpose of this exercise, the script could have as easily called up any other program.

The script I wrote differs only in that I didn't include the export lines, and the problem is that it simply displays as a HTML document rather than executing.

I appreciate the attempt, however, and perhaps this clarifies my problem a bit...  

0
j2Commented:
you must include the Apache directive

Options ExecCGI

for the dir which the script is in

Like

<Directory /home/httpd/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>

this also (depending on your srm.conf and access.conf) assumes the script has a .cgi suffix.

HOWEVER if what you are REALLY trying to do is to start the application on the client machine (the machine viewing the webpage) you can forget all about it, it isnt supported. just think of how fun a webpage that called /sbin/reboot or rm -rf / would be.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tknayakCommented:
Bughead!

Even if they are on the same machine u have to add that line export ...
because, there the porogram will run as user nobody/www (thats running httpd) .. but u r logged in as a different user so u have to set ur DISPLAY variable to run any X programs . it displays as html document because of the reason as answered by j2 ..
htw..
0
j2Commented:
iik.. i more intended to submit my text as comment, not answer.. sorry.
0
bughead1Author Commented:
j2:

Sorry it has taken me so long to get back to this -- and I know you said you posted it as an answer by accident, but now that I can get back to work on this, your answer gave me an idea...so I'm awarding the points.

But, real question now is, what can you do with them...I mean I tried to use my points to buy an new Athlon server and that didn't work.

I took a print out showing my points to a local restaurant and they refused to serve me until I produced a Master Card.


0
j2Commented:
I've had the same experience :)

Atleast the points bought t-shirts while you had less then 100.000 points :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.