LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > Forbid access to PHP files

Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2007, 07:44 AM
BobbyEasland BobbyEasland is offline
New Member
 
Join Date: May 2007
Location: /usa/kentucky/richmond/
Posts: 2
Exclamation Forbid access to PHP files

We have a node that has not only image files but also PHP. The node is a dedicated static file server (images, CSS, JS, etc) and need to forbid access to the PHP scripts.

We have tried the following:
  • Removed all script handlers (server and VH levels) for PHP scripts
  • Added false FCGI handlers (expected at least a 500 error)
  • Added filter rule with status:403 using SecFilter
  • Used FILES + deny in htaccess (ala Apache style)
These were tried in order and were not performed together. After each attempt the settings were reverted and server restarted.

No matter what was tried requests for PHP scripts always returned a 200 status and download prompt.

Does anyone have any ideas?

Bobby
__________________
Zend Certified Engineer
Reply With Quote
  #2  
Old 05-08-2007, 08:15 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
First, you need to clear your browser's cache.

The easiest and probably the most efficient way is to add a rewrite rule at vhost level to blocked, should avoid using FILES in htaccess when possible. "SecFilter" is more expensive than a rewrite rule.
Reply With Quote
  #3  
Old 05-08-2007, 08:38 AM
BobbyEasland BobbyEasland is offline
New Member
 
Join Date: May 2007
Location: /usa/kentucky/richmond/
Posts: 2
We are using a base user account on the primary web node (internally called node1) which is pushed across the cluster with rsync at regular intervals via CRON. The image nodes are included in the nodes list. The result is that the same htaccess is used on all nodes including web. If I put a rewrite rule in the htaccess file locally it'll be overwritten at the next rsync. If I put it globabally it'll disable the entire cluster.

Is it possible to use both htaccess (filesystem) rewrite rules and also VH rewrite rules?

Bobby
__________________
Zend Certified Engineer
Reply With Quote
  #4  
Old 05-08-2007, 08:53 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Yes, you can do both, VH rewrite rules is more efficient.

I think there is a better choice for your needs. On the image node, you can set "Enable Scripts/ExtApps" to "no", this option is stored in the server configuration file, so you can use different a value for your image node and content node and have your vhost configured exactly the same way.
You need to add the script handler configuration back.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:29 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.