用自定义的PROXY_WORKER_MAX_NAME_SIZE构build并安装apache mod_proxy

我有一个虚拟主机(php-fpm / apache)configuration的问题。 它会抛出下面的错误:

name ProxyPass worker name (unix:///var/www/vhosts/system/site/php-fpm.sock|fcgi://127.0.0.1:9000/var/www/vhosts/site/httpdocs) too long... 

我知道我可以很容易地用符号链接解决它,或者只是通过删除unix套接字或fgcid部分。

但我正在想另一种方式。 我想知道是否可以使用apxs构buildmod_proxy模块,将PROXY_WORKER_MAX_NAME_SIZE设置为大于96个字符,然后将其安装到我的Apache 2.4。

我怎样才能做到这一点?

build立Apache

下载apache 2.4.x + apr + apr_util

构buildapr和apr_include(./configure&make)来创build.h复制apr / include / *到apache2.4 / include复制apr_util / include / *到apache2.4 / include复制apache2 / os / unix / os.h在apache2.4 / include(用于linux版本)

build立apache:

 ./configure --enable-so --with-included-apr --includedir=/home/remy/Bureau/build_2.4.7/apache2/include/ --with-apache=/home/remy/Bureau/build_2.4.7/apache2/ Make 

构buildApache模块(使用gcc):

 gcc -fPIC -DSHARED_MODULE -I/home/frogg/Bureau/build/apache2 -I/home/frogg/Bureau/build/apache2/include/-c mod_proxy.h 

然后创build与Apache一起使用的文件

 touch mod_proxy.so ld -Bshareable -o mod_proxy.so mod_proxy.o 

将.so文件放入启用apache模块的文件夹(或可用,然后a2enmod ..)

重新启动apache,它应该可以

要更改最大大小,请转到mod_proxy.h:305 (第305行),然后将96更改为所需的值: #define PROXY_WORKER_MAX_NAME_SIZE 96

来源

这里的apache源代码是可用的:

apache的APR源代码在这里:

官方安装文档

也许你可以尝试更新你的Apache版本

来源: https : //bugs.archlinux.org/task/43551

 The bug was reported to apache in 2012 https://issues.apache.org/bugzilla/show_bug.cgi?id=53218 and the issue is marked as resolved simple by making the size to 256.