Running a C/C++ program and/or bash script from a server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Running a C/C++ program and/or bash script from a server
# 1  
Old 12-13-2013
Running a C/C++ program and/or bash script from a server

I wish to be able to give to a client the opportunity to :

0) Turn one of my ubuntu computers into a webserver
1) See a webpage after visiting a url where an external user/client can set a couple of variables (e.g. Number1= ?, Number2=?)
2) By pressing "run" the program runs on my machine
3) On my machine I could or not have a queue system. Some kind or protection should stop the client using a wget like tool to download files and programs on his computer

I have some experience with webpy and I had it working for internal networks. I am after a solution for C/C++ and bash. The framework needs to be able to be used from outside the local network
# 2  
Old 12-13-2013
If you install Apache, you can put your scripts in a cgi-bin directory. When the client accesses www.mywebsite.com/cgi-bin/myscript.sh?var1=a&var2=b&var3=cv, it will run your script with QUERY_STRING set to "var1=a&var2=b&var3=c" which you can process to get your variables out of and run your script accordingly. It is possible to have these variables fed into it via an HTTP web form which they can type into.

The output will end up in his web browser, or if you specify, as a file.

They call this process CGI, or "common gateway interface".

Last edited by Corona688; 12-13-2013 at 12:56 PM..
This User Gave Thanks to Corona688 For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

2. UNIX for Beginners Questions & Answers

Running a program manual vs script

Hello - I am new to unix... very new. I am running a program at the command prompt:-nohup ./ledger - comptroller_extract 05/11/2018 & The above runs as expected. If I put it in a sh script:- current_date=$(date+%m/%d%y) nohup ./ledger - comptroller_extract $current_date & This does... (4 Replies)
Discussion started by: MSpeare
4 Replies

3. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

4. UNIX for Dummies Questions & Answers

Transfer file from server B to server C and running the script on server A

I have 3 servers A, B, C and server B is having some files in /u01/soa/ directory, these files i want to copy to server C, and i want to run the script from server A. Script(Server A) --> Files at Server B (Source server) --> Copy the files to Server C(Target Server). We dont have RSA key... (4 Replies)
Discussion started by: kiran_j
4 Replies

5. Solaris

Test program running taking much more time on high end server T5440 than low end server T5220

Hi all, I have written the following program and run on both T5440 and T5220 on same OS version. I found that T5540 server takes more time than T5220. Please find below the details. test1.cpp #include <iostream> #include <pthread.h> using namespace std; #define NUM_OF_THREADS 20... (17 Replies)
Discussion started by: sanjay_singh85
17 Replies

6. Shell Programming and Scripting

bash script to check if a program is running

I'm a bit new to bash programming and I was assigned the job of writing a script that will check to see if a program server is running and to restart the program if it is not up. The script is supposed to check the program every hour (which I have looked up and I believe I know how to do) and send... (3 Replies)
Discussion started by: mcknz
3 Replies

7. Shell Programming and Scripting

Problem running a program/script in the background from a script

Hi all, I have a script that calls another program/script, xxx, to run in the background. Supposedly this program at most should finish within five (5) minutes so after five (5) minutes, I run some other steps to run the script into completion. My problem is sometimes the program takes... (5 Replies)
Discussion started by: newbie_01
5 Replies

8. Shell Programming and Scripting

Kill shell script when host program not running/disk unmounted

I have my Mac OS X program executing a shell script (a script that copies files to a drive). I want to make it so that the shell script automatically kills itself if it finds that the host .app is not running OR kill itself if the drive that it is copying files to has been unmounted. Right now what... (2 Replies)
Discussion started by: pcwiz
2 Replies

9. Shell Programming and Scripting

Leaving Program running but killing the script

Sorry for all the threads. I am almost done. I ahve a bash script that is launching a diags program then copying the .html over my client. then it does the following line /opt/firefox/firefox report.html it launches it fines but the program waits for me to close the window or kill the script.... (2 Replies)
Discussion started by: deaconf19
2 Replies

10. UNIX for Dummies Questions & Answers

running dos program from unix server

Hello, My apologies if this sounds like a stupid question...... but is it possible to call a script that is located on a w2k machine from a csh script bing run on a unix server. Many thanks rkap (1 Reply)
Discussion started by: rkap
1 Replies
Login or Register to Ask a Question