LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   web server application in linux (https://www.linuxquestions.org/questions/programming-9/web-server-application-in-linux-555031/)

jaepi 05-18-2007 07:53 PM

web server application in linux
 
hello there, uhhmmm...anyone here could give me an idea or point me a reference on how web server application are created (console based) using c++ and linux as it's environment...i'd be using threading, processes, synchronization and http protocol...

a reference to any website or books would be nice...thank you...

milindlokde 05-19-2007 01:32 AM

This might help
 
You will have to use CGI programming for the purpose.
Here's a link for cgi programming using C:
http://www.openroad.org/cgihelp/cgi.html
Other rules regarding CGI programming will apply.

Perl, PHP or Python can be a good idea for webserver programming. Perl can help you with threading, processes, synchronization and http protocol. It is definitely a very versatile and strong programming language both for command line and for web programming.

nc3b 05-19-2007 02:37 AM

I really don't know what to say about cgi programming, but here is a link. http://beej.us/guide/bgnet/

It is a well known suite of tutorials, and it's quite friendly. But I suggest you also read "Linux Socket Programming By Example" , or "Beginning Linux Programming", or "Linux Programming Unleashed". These are commercial and, although you can find them on emule or whatever, you ought to buy them (really, the printed version of such a book is great!). And there is also a free ebook, "Advanced Linux Programming" and it's quite good. Hope this helps, cheers. :)

jaepi 05-19-2007 02:47 AM

thank you for being so kind... :)

Guttorm 05-19-2007 04:59 AM

Hi

Just another suggestion. I once looked into "ptypes". It's a C++ library like STL but it adds a lot of stuff that would be hard to write portable so it works on different platforms. Like how do you do portable multitread locking and networking with STL? (I have no idea)

http://www.melikyan.com/ptypes/

It's opensource, and as an example program, a web-server is included. Maybe take a look?

theNbomr 05-19-2007 11:09 AM

If you are looking for a small HTTP server that you can embed into your own application, then there are already a few of these out there. For one, go to http://www.acme.com/software/thttpd/. There are more links from there.
If you want to develop a server from the ground up, get yourself an HTTP (not HTML) reference, such as http://www.w3.org/Protocols/HTTP/HTTP2.html. Also get netcat, if you don't already have it, and use it to see what a browser sends to a server. Use the information at Beej's guide, from above, to start writng code that responds to the requests of a browser. You can easily have an embedded server that performs basic functionality in a couple of hundred lines of code. Probably less.

--- rod.


All times are GMT -5. The time now is 10:03 PM.