php-enabled ServerDefaultPage

  • Hi,


    this is not a bug but a question and hopefully anyone can help me.
    I developed a more user-friendly default page in php with some stat display and redirection (eg. for ssl-accessing non-ssl-enabled pages => plain http) and failed with enabling php for this page.


    If a add the following directives in the site config the page is loading endless:



    Code
    1. <Proxy "unix:/var/run/php5-fpm-www.sock|fcgi://127.0.0.1:9000/var/www/virtual/ServerDefaultPage/">
    2. ProxySet timeout=7200
    3. </Proxy>
    4. <FilesMatch ".+\.ph(p[3457]?|t|tml)$">
    5. SetHandler proxy:unix:/var/run/php5-fpm-www.sock|fcgi://127.0.0.1:9000/var/www/virtual/ServerDefaultPage/
    6. </FilesMatch>

    If i point to a real domain socket i receive "File not found" which seems legit to me due to filesystem permissions but i won't go ahead with misusing real domain user environments here.
    Anyone has an idea how to properly enable php for the default page?


    Thanks,
    Chris

  • @itscz.org


    I'll give a try soon and provide you with a solution. You use the ServerDefaultPage plugin?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Edit: Oh sorry, you used the www pool. I created a new pool file


    You added a pool file for php fpm?


    Mine is working.


    Code: 00_ServerDefaultPage.conf
    1. <VirtualHost ip:80> ServerName default DocumentRoot /var/www/virtual/ServerDefaultPage ErrorDocument 401 / ErrorDocument 403 / ErrorDocument 404 / ErrorDocument 500 / ErrorDocument 503 / <Directory /var/www/virtual/ServerDefaultPage> Require all granted </Directory> <Proxy "unix:/var/run/php5-fpm-sdp.sock|fcgi://ip/"> ProxySet timeout=7200 </Proxy> <FilesMatch ".+\.ph(p[3457]?|t|tml)$"> SetHandler proxy:unix:/var/run/php5-fpm-sdp.sock|fcgi://ip/ </FilesMatch></VirtualHost>

    and a simple phpinfo();

  • Wow thank you very much, it works this way.


    However i modified it a bit because "phptmp" does not exist there per default, so i created a "htdocs, phptmp" subdirectory structure there and i also edited the 00_ServerDefaultPage_ssl.conf


    Here is my result: https://itscz.org/ (accept the self-signed here)


    But i am wondering if this is update safe?

    Edited once, last by itscz.org ().

  • Just updated to the latest i-MSCP and the pool file vanished

    Yeah, if you want make that custom pool configuration file peristent, you must inject it using an i-MSCP listener.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206