Effects of "Chroot PHP-FPM" on URL rewriting

Discussion in 'General' started by dharman, Nov 10, 2022.

  1. dharman

    dharman New Member

    Hi,
    I've a similar problem. To get it simpler as possible, I've confiugred a simple website. It has PHP-FPM enabled and is empty. It contains only the file standard_index.html and a folder called subdomain/usd, that contains a simple index.php. This one contains only a simple echo 'hello';.
    In ISPConfig I've configured a subdomain usd.mysite.tld to go to /subdomain/usd. When chroot is disabled I've got a wewb page saying "hello". When I enable chroot, I got an error 404 reporting "File not found." as page content.
     
  2. dharman

    dharman New Member

    Oh, and obviously, the folder subdomain/usd is into folder "/var/www/client1/web1/web/"
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Subdomains always point to the web root directory of the site they belong to, you can not point them to a different directory, so you probably did not add a subdomain but vhost subdomain?
     
  4. dharman

    dharman New Member

    Maybe....following there is what I've configured. Sorry for the italian interface. upload_2022-11-10_20-27-14.png
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so you do just a URL rewriting, this does not change the root directory of a subdomain to that folder. And yes, a chroot can have effects on that as well. This doe snot mean that there is any kind of bug or defect, the whole behavior of the system changes when you decide to use chrooting, that's why it is not on by default. You can use the website logs to find out what is called to get an idea of what you have to change in your settings.

    If one would want to actually point a subdomain to a folder, I would always use a vhost subdomain and not a URL redirect.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I'll move this to a separate thread as your question is not related to the issue of the original poster.
     

Share This Page