LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-20-2011, 10:53 PM   #1
AustinPowered
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
Web Programming Environment


I have an application written in C++ running on a Linux server. I would like to be able to connect a web browser to that server and have the web page display the status of the application and allow configuration settings to be displayed and modified.

The program will need to display counters which could be updated as often as every second. Drop down menus, progress bars and meters would also be nice.

What I'm looking to learn from this thread it where to start. I have some programming experience (mostly C) and have done some work with Qt4 and C++. What language should I learn next? What tool kit or library should I use?

Thank you in advance for your responses.

Austin Powered
 
Old 12-21-2011, 12:24 AM   #2
flamelord
Member
 
Registered: Jun 2011
Distribution: Arch Linux
Posts: 151

Rep: Reputation: 34
I'm not no expert but one possibility is php, I'm not really sure how you would do what you want to do, but I'm pretty sure it is possible. Ruby and Python are also options. Depending on the complexity of what you want to do you could even write a CGI program in c++. In any event you will need to be familiar with HTML, and probably javascript.

I'm not really a web developer, but I hope that this is helpful to you.
 
Old 12-21-2011, 10:26 AM   #3
dickgregory
Member
 
Registered: Oct 2002
Location: Houston
Distribution: Arch, PCLinuxOS, Mint
Posts: 257

Rep: Reputation: 34
Python has a built-in webserver. I have used it to implement a single-purpose function distantly related to what you seem to want. I implemented it as a single .py file of 72 lines, including white space and my custom functionality.

If you combine that with Django you have a pretty powerful tool that can get to about anything on your server system.
 
Old 12-21-2011, 07:15 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
The main qn is, do you want it all in one ie have the C++ program have a web interface as part of its code, or will it write to files that a separate prog eg in PHP can read etc.?
Either is do-able.
 
Old 12-22-2011, 02:58 AM   #5
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 12-22-2011, 05:56 AM   #6
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
When you mention counters and configuration settings, are the values behind these currently stored in text files, a SQL database, or something else?
 
Old 12-22-2011, 07:22 AM   #7
AustinPowered
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Proud View Post
When you mention counters and configuration settings, are the values behind these currently stored in text files, a SQL database, or something else?
Configuration settings are already in a plain text file and status values can be retrieved from the application through calls.

Assuming all of the information to be displayed is stored in an easily retrieved format (file or database), what tools could be used to write the web pages to display this information?

Thanks,
Austin Powered
 
Old 12-22-2011, 09:16 AM   #8
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,159

Rep: Reputation: 258Reputation: 258Reputation: 258
Hi

There are many options. If you are used to C++, it might be easiest to just embed a web server in your application.

http://stackoverflow.com/questions/7...ded-web-server
 
Old 12-22-2011, 09:17 PM   #9
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
If you want it to update the browser every second, I'd go with embedding a webserver in the C++, for performance/sync reasons.
Consider using threads.
 
Old 12-25-2011, 10:16 AM   #10
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
You will need to embed an HTTP server in your C++ application. Depending on your requirements, it may take as little as a hundred lines of code. However, the fast update rate suggests an AJAX application running on the browser client, and as I understand it, that implies producing XML on the server, as well as some storage of the javascript code on the server/application, so that adds some complexity. Embedded HTTP servers are becoming increasingly common, and last time I looked (not very recently), there were a number of open source packages targeting your type of application. It sounds like you want to export process variables from within the main part of your application, rather than data from files or databases, so I'm not sure how well most of the offerings will fit.

--- rod.
 
  


Reply


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
About programming in SMP environment scanner Linux - Kernel 2 07-24-2006 11:26 PM
programming in fedora environment praveen_singh Linux - Newbie 1 10-15-2004 05:12 AM
programming environment? pablowablo Linux - Newbie 12 04-27-2004 11:34 AM
Programming environment devit Programming 2 02-10-2004 01:15 PM


All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
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