0

So, there seems to be really poor documentation for this, and I haven't found exactly how to do this. I am in the process of figuring out how to move my CMS to HTTP/2 and that requires PHP-FPM with Apache.

As this is a CMS, I have tons of aliased directories that are shared among the hundreds of sites served by Apache. I have configured the script that creates the vhost files which then adds:

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000//Atlas/Sites/sitename/$1

In the virtualhost config. And in the general Apache config I have this, for instance:

Alias /pages "/Atlas/Core/virtuals/pages"

Which means that http://www.sitename.com/pages/help is thus an alias directory. After some reading I think I have found out that PHP-FPM doesn't support Apache aliases, which makes sense since "/pages" isn't in the sitename/$1 path that I serve via proxy.

So how do I manage this? Is there something I can set up in the apache config or do I have to add all 20+ alias directories in each vhost, and how is it done?

Sandman
  • 2,323
  • 5
  • 28
  • 34
  • Alias is for mapping an Location (url path) to a directory on disk, you probably want rewrite – on8tom Jun 17 '20 at 11:50
  • Also you can use mod_macro for multiple similar looking vhosts instead of generating a bunch. – on8tom Jun 17 '20 at 11:54
  • @on8tom As I see it, the problem is that PHP-FPM has no idea about any aliases what so ever, my apache config works with mod_php of course. – Sandman Jun 17 '20 at 12:08
  • you are right, alias is processed before ProxyPass, and alias directly maps an url path to a path on disk. – on8tom Jun 17 '20 at 12:28
  • @on8tom Indeed - so how do I solve it? Do I need specific proxypass commands in the apache config or in the vhost-config? I can't seem to find any documentation on this – Sandman Jun 17 '20 at 13:07
  • You either need rewrite via mod_rewrite, or multiple proxyPass with the specific path translations, e.g. ProxyPass /pages fgci://...../atlas/core/virtuals/pages etc. – on8tom Jun 17 '20 at 13:12

0 Answers0