LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-09-2010, 09:52 AM   #1
hong2010
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Rep: Reputation: 0
Smile How to make a web-based interface for user configuration program?


Dear friends...

I currently doing a network emulator program and the features must includes the web-based interface for user configuration. I able to run my program through command line. But I would like to ask how to associate my program to web-based interface for user configuration? Please kindly advise me for any example or website. Your responses are highly appreciate. Thanks
 
Old 02-10-2010, 08:29 AM   #2
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
The simplest way would be to have your site execute the command lines which configure the system via CGI.

Basically, you would have a webserver set up on the machine which contains your software.
This webserver will serve a page containing a form which has the configuration details (buttons, text boxes, check boxes)
When you click [SUBMIT] the contents of the form are POSTed to a CGI script when then parses out what needs to be done and exec()s the relevant commands to make it happen, or writes config files, or whatever.
 
Old 02-10-2010, 10:30 AM   #3
hong2010
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by nowonmai View Post
The simplest way would be to have your site execute the command lines which configure the system via CGI.

Basically, you would have a webserver set up on the machine which contains your software.
This webserver will serve a page containing a form which has the configuration details (buttons, text boxes, check boxes)
When you click [SUBMIT] the contents of the form are POSTed to a CGI script when then parses out what needs to be done and exec()s the relevant commands to make it happen, or writes config files, or whatever.
Thanks your solution, i will try it out.
 
Old 02-28-2010, 10:46 PM   #4
hong2010
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by nowonmai View Post
The simplest way would be to have your site execute the command lines which configure the system via CGI.

Basically, you would have a webserver set up on the machine which contains your software.
This webserver will serve a page containing a form which has the configuration details (buttons, text boxes, check boxes)
When you click [SUBMIT] the contents of the form are POSTed to a CGI script when then parses out what needs to be done and exec()s the relevant commands to make it happen, or writes config files, or whatever.
Hi, nowonmai..

i had set up the apache webserver on my current ubuntu 9.10 machine. For the CGI script, isn't i have to convert my c programming into CGI script in order to execute the program? Thanks..
 
Old 02-28-2010, 11:12 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
No, CGI is Common Gateway Interface, just an agreed way to call programs from a webserver; you can use any language.
http://en.wikipedia.org/wiki/Common_Gateway_Interface
 
Old 03-12-2010, 10:28 PM   #6
hong2010
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Smile How to load module and iptables rules through cgi scirpts?

Quote:
Originally Posted by chrism01 View Post
No, CGI is Common Gateway Interface, just an agreed way to call programs from a webserver; you can use any language.
http://en.wikipedia.org/wiki/Common_Gateway_Interface
Thanks Chrism01. I had idea to write and run .cgi script through my web server. But my question is how to load module(modprobe iptable_filter & modprobe ip_queue) and set iptables rules through cgi scirpts?Thanks for reply...
 
Old 03-30-2010, 05:43 AM   #7
hong2010
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Smile How to set iptables rules and access superuser(root privilege ) in web page?

Quote:
Originally Posted by nowonmai View Post
The simplest way would be to have your site execute the command lines which configure the system via CGI.

Basically, you would have a webserver set up on the machine which contains your software.
This webserver will serve a page containing a form which has the configuration details (buttons, text boxes, check boxes)
When you click [SUBMIT] the contents of the form are POSTed to a CGI script when then parses out what needs to be done and exec()s the relevant commands to make it happen, or writes config files, or whatever.
Hi friends..
i had wrote a network emulator program in c programming. It can run for ubuntu terminal with good performance. But i have to make it for web-based user configuration. So i had setup apache web server and write this program in cgi script and try to execute this program from web page. BUT IT CAN'T WORKS!!!

This program must be run in root privilege($sudo -s) and add the iptables rules such as (#iptables -A OUTPUT -j QUEUE). So my question is how to add iptables rules in my cgi scripts? How to set the superuser(root privilege) permission to access my program through web server? Or any other method? your reply is highly appreciate... thanks..
 
Old 03-30-2010, 07:43 PM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
The program will run as the Apache user, so you'll need to edit the sudoers file to give that user the reqd privileges.
Note that apache starts up as a root user so it can bind to port 80 (& 443), then drops privileges.
 
Old 04-09-2010, 12:59 AM   #9
hong2010
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chrism01 View Post
The program will run as the Apache user, so you'll need to edit the sudoers file to give that user the reqd privileges.
Note that apache starts up as a root user so it can bind to port 80 (& 443), then drops privileges.
Hi.. thanks for replies.. can you briefly explain about the procedure to drop the privilege and bind port? Isn't have to add the virtual host with the 443 port in httpd.conf file?
 
  


Reply

Tags
configuration, interface, web


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kmail - Web Based Interface for Remote Viewing of Emails. rlh57l Linux - Software 1 07-07-2008 12:54 AM
LXer: Create a Web-based interface for MySQL databases in a flash with phpMyEdit LXer Syndicated Linux News 0 03-09-2007 08:16 AM
LXer: How to change Linux /UNIX system password-using a web based PHP script user interface LXer Syndicated Linux News 0 08-05-2006 08:33 PM
any web based configuration for IPtables? ah_man04 Linux - Networking 1 04-16-2005 03:26 PM
How to make a web interface...? kleptophobiac Programming 3 09-08-2004 04:05 AM


All times are GMT -5. The time now is 05:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration