CB2.0 lsphp + nginx + apache (proxy)

Aedero

Verified User
Joined
Sep 28, 2013
Messages
20
Hi Martynas,

I'm experiencing a small problem with the new lsphp + nginx/apache proxy.
When a file ends with .php it will try to parse it even if it don't exists.

So url's like jkgljeglkjekglj.php will return a blank page instead of a 404 Not found error.

Can you please help me fix this problem?

Thank you in advance!

With kind regards,

Robin
 
Sorry for double posting but I have made a fix for it:
(Check if the file exists, else return 404)

Edit file: /etc/httpd/conf/extra/httpd-php-handlers.conf
Code:
<FilesMatch "\.(inc|php|php3|php4|php44|php5|php52|php53|php54|php55|php56|php6|phtml|phps)$">
AddHandler application/x-httpd-lsphp .inc .php .php5 .php54 .phtml
AddHandler application/x-httpd-php-source .phps
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ - [R=404,L]
</FilesMatch>
AddType text/html .php
 
The following should fix that issue now (I got a report from CloudLinux developers, that they bug is now fixed in the latest version of mod_lsapi):
Code:
cd /usr/local/directadmin/custombuild
./build update
./build apache
 
Back
Top