tags:

views:

33

answers:

2

Hi experts,

I'm doing a OpenSSL project and I'm completely new to web server. I've got a client.c and server.c. client.c creates a connection to the server on port 6008 and reads data from stdin and then send those data to the server. The server.c reads data from socket and writes it back out to stdout.

I've got the server.c compiled on the server's unix terminal (Solaris 9) but I can't figure out how to run it on Apache 2.2.

PS. I've installed Apache 2.2.15 and OpenSSL 1.0.0a and they are all working.

Any help will be much appreciated!

Z.Zen

+2  A: 

If the server reads data from a socket, it doesn't need to be run by Apache at all. Just run it from the command line.

You see, Apache is an HTTP server. If a program does its own network communication, it doesn't need an HTTP interface.

Borealid
Thank you Borealid! I think what I did wrong was using the same port (6008) for both the application and Apache Server. So I changed the port number and it ran, with some bugs though :( But really appreciate your help!
Z.Zen
+1  A: 

It sounds like your server.c application is similar to a CGI / FastCGI application - if this is the case then you need to configure Apache to run your app using a CGI or FastCGI module respectively (Google has plenty of resources both on how to create CGI / FastCGI applications in C, and how to configure Apache)

If this isn't the case and you definitely want to host your application under Apache then I'd probably recommend that you modify your C application into a CGI application (on the basis that it is easier than producing a FastCGI application) and use the Apache CGI module.

Kragen