user3312508
user3312508

Reputation: 937

Send HTTP request through browser to a program that is listening on a port

So I am trying to build a C Program that handles HTTP requests through a web browser. The program is listening on a predefined port for incoming HTTP requests and responds appropriately. It is working totally fine when I place is it in the root directory but it doesnt work when I move it to directory on its own.

For instance, this works: localhost:9000

but this doesnt: localhost:9000/myprogram

Any clues on how I may fix this?

Upvotes: 0

Views: 148

Answers (1)

user4129403
user4129403

Reputation:

Hard to answer with so few details. But to get started I would check the following:

  1. What does the web server log say?
  2. Is the web server configured to allow execution of [CGI] in this directory?
  3. Are you sure you haven't mixed up the web root with the directory root, thus placing your program in the wrong place?
  4. Are the directory and program access modes set correctly?

Upvotes: 0

Related Questions