hello misc!

I know that apache has it's own module for cgi execution, but unfortunately, it works only with mpm_prefork module.

So, the question is: is it possible to forward requests to slowcgi?

I've tried this configuration ( basically this is a copy of similar php-fpm option )

<VirtualHost *:80>
        ServerName gw.kasakoff.net
        DocumentRoot /var/www/htdocs/gw

        Alias "/dhcpd-leasesd/" "/var/www/dhcpd-leasesd/"

        <Directory "/var/www/dhcpd-leasesd">
        SetHandler "proxy:unix:/var/www/run/slowcgi.sock|fcgi://localhost"
        Require ip 192.168.0.
        </Directory>
</VirtualHost>

And slowcgi -dv -p/

mx$ doas slowcgi -dv -p/
slowcgi: sock_user: www
slowcgi: socket: /var/www/run/slowcgi.sock
slowcgi: slowcgi_user: www
slowcgi: chroot: /
slowcgi: inflight incremented, now 1
slowcgi: env[0], proxy-nokeepalive=1
slowcgi: env[1], HTTP_HOST=gw.kasakoff.net
slowcgi: env[2], HTTP_CONNECTION=keep-alive
slowcgi: env[3], HTTP_CACHE_CONTROL=max-age=0
slowcgi: env[4], HTTP_DNT=1
slowcgi: env[5], HTTP_UPGRADE_INSECURE_REQUESTS=1
slowcgi: env[6], HTTP_USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 slowcgi: env[7], HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
slowcgi: env[8], HTTP_ACCEPT_ENCODING=gzip, deflate
slowcgi: env[9], HTTP_ACCEPT_LANGUAGE=ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
slowcgi: env[10], HTTP_SEC_GPC=1
slowcgi: env[11], PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
slowcgi: env[12], LD_LIBRARY_PATH=/usr/local/lib
slowcgi: env[13], SERVER_SIGNATURE=
slowcgi: env[14], SERVER_SOFTWARE=Apache/2.4.62 (Unix) LibreSSL/4.0.0
slowcgi: env[15], SERVER_NAME=gw.kasakoff.net
slowcgi: env[16], SERVER_ADDR=192.168.0.1
slowcgi: env[17], SERVER_PORT=80
slowcgi: env[18], REMOTE_ADDR=192.168.0.77
slowcgi: env[19], DOCUMENT_ROOT=/var/www/htdocs/gw
slowcgi: env[20], REQUEST_SCHEME=http
slowcgi: env[21], CONTEXT_PREFIX=/dhcpd-leasesd/
slowcgi: env[22], CONTEXT_DOCUMENT_ROOT=/var/www/dhcpd-leasesd/
slowcgi: env[23], SERVER_ADMIN=y...@example.com
slowcgi: env[24], SCRIPT_FILENAME=proxy:fcgi://localhost/var/www/dhcpd-leasesd/dhcpd-leasesd
slowcgi: env[25], REMOTE_PORT=48888
slowcgi: env[26], GATEWAY_INTERFACE=CGI/1.1
slowcgi: env[27], SERVER_PROTOCOL=HTTP/1.1
slowcgi: env[28], REQUEST_METHOD=GET
slowcgi: env[29], QUERY_STRING=
slowcgi: env[30], REQUEST_URI=/dhcpd-leasesd/dhcpd-leasesd
slowcgi: env[31], SCRIPT_NAME=/dhcpd-leasesd/dhcpd-leasesd
slowcgi: fork: proxy:fcgi://localhost/var/www/dhcpd-leasesd/dhcpd-leasesd
slowcgi: wait: proxy:fcgi://localhost/var/www/dhcpd-leasesd/dhcpd-leasesd

unfortunately this does not work due to errors:

Oct 19 08:01:24 mx slowcgi[25467]: cannot chdir to proxy:fcgi://localhost/var/www/dhcpd-leasesd: No such file or directory Oct 19 08:01:24 mx slowcgi[25467]: execve proxy:fcgi://localhost/var/www/dhcpd-leasesd/dhcpd-leasesd: No such file or directory

I know that I can run dhcpd-leasesd as daemon and just proxy there.
This is just an example.

The main question is: is it posiible to run slowcgi with apache and mpm_worker module?

Reply via email to