开发者

How to run a c program on apache 2.2 server?

开发者 https://www.devze.com 2023-01-08 23:06 出处:网络
I\'m doing a OpenSSL project and I\'m completely new to web server开发者_如何学Go. 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

I'm doing a OpenSSL project and I'm completely new to web server开发者_如何学Go. 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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消