0

I need a config for apache 2.4 which just connects to an open socket and talks fcgi over it.

I am writing my own fcgi-enabled web app. By now, it opens a listening socket and when a web server (nginx at the moment) connects to it (when getting a request from a browser) they talk fcgi over that socket. (So my app basically implements a fcgi responder role acc. to fcgi protocol spec and serves some basic pages over it.) My goal is to enable apache 2.4 to replace nginx in this scenario.

I'd like to start basic:

  • http listening port is 2000 for now so no root or priv drop needed
  • lauch httpd as normal user with cusomized config file (-f parameter)
  • httpd does not need to launch my app, it should expect an open port stated in its conf
  • ssl (encryption/security) irrelevant right now (topic for a later date)
  • simple apache conf for serving static pages works already

This my simplistic httpd.conf. It works for serving static pages.

DocumentRoot "/tmp/nginx/pages"
Listen 2000
PidFile "/tmp/nginx/httpd.pid"
ErrorLog "/tmp/nginx/error_log"
ServerRoot "/usr/lib64/apache2"
LoadModule authz_core_module mod_authz_core.so

# LoadModule proxy_module mod_proxy.so
# LoadModule proxy_fcgi_module mod_proxy_fcgi.so
# ProxyPass /a unix://tmp/nginx/socket_fcgiMain.s
# LoadModule fcgid_module /usr/lib64/apache2/mod_fcgid.so
# FcgidIPCDir "/tmp/nginx"

My questions:

which is the correct fcgi module for apache:

  • mod_proxy_fcgi.so
  • mod_fcgid.so
  • something else?

How to configure it?

2
  • nowadays you should be using mod_proxy_fcgi, check mod_proxy_fcgi documentation. To use it the easier method for me is the handler method, mentioned in the linked page. Commented Jun 21 at 20:44
  • @DanielFerradal thanks for that hint. Can you give some more? This is my httpd.conf ``` DocumentRoot "/tmp/nginx/pages" Listen 2000 PidFile "/tmp/nginx/httpd.pid" ErrorLog "/tmp/nginx/error_log" ServerName localhost LoadModule proxy_module mod_proxy.so LoadModule proxy_fcgi_module mod_proxy_fcgi.so ProxyRequests On ProxyVia On ProxyPass "/myapp/" "fcgi://localhost:9000/" ``` My app has a listening socket on localhost:9000 however httpd does not even try to talk to it. What am I missing?
    – K. Nick
    Commented yesterday

0

You must log in to answer this question.

Browse other questions tagged .