Denial of PHP Script Hosting

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
thekisab
Forum Newbie
Posts: 4
Joined: Wed May 12, 2004 4:42 am

Denial of PHP Script Hosting

Post by thekisab »

I have a few friends who would like to host on my webspace... problem is though, i dont want them running php scripts, and its configured to run them and i use them on my main site. Is there a way to stop them from running scipts in a certain directory using .htaccess. I dont have access to the apache config file.

I dont think the .htaccess would be good in the directories where they will be uploading files to as wll, so it should be in the root dir or something... i dunno... any information would be great.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

If your friends have access to the server and are hosting the scripts, they will have access to your scripts unless you're encoding them with something likehttp://www.zend.com/store/products/zend-encoder.php
thekisab
Forum Newbie
Posts: 4
Joined: Wed May 12, 2004 4:42 am

Post by thekisab »

No i will be setting them up with a sub directory, thats all they will be able to access.
thekisab
Forum Newbie
Posts: 4
Joined: Wed May 12, 2004 4:42 am

Post by thekisab »

Its ok ive found what to do now. Well at least i found a few things to try, here what i found if anyone is interested.

>> Create .htaccess in that directory with one line:
>> ForceType text/plain

The RemoveHandler directive removes any handler associations for files with the given extensions. This allows .htaccess files in subdirectories to undo any associations inherited from parent directories or the server config files. An example of its use might be:

/foo/.htaccess:
AddHandler server-parsed .html
/foo/bar/.htaccess:
RemoveHandler .html
This has the effect of returning .html files in the /foo/bar directory to being treated as normal files, rather than as candidates for parsing (see the mod_include module).

The extension argument is case-insensitive, and can be specified with or without a leading dot.

The RemoveType directive removes any MIME type associations for files with the given extensions. This allows .htaccess files in subdirectories to undo any associations inherited from parent directories or the server config files. An example of its use might be:

/foo/.htaccess:
RemoveType .cgi
This will remove any special handling of .cgi files in the /foo/ directory and any beneath it, causing the files to be treated as being of the default type.

Note:RemoveType directives are processed after any AddType directives, so it is possible they may undo the effects of the latter if both occur within the same directory configuration.

The extension argument is case-insensitive, and can be specified with or without a leading dot.

Taken from:
http://httpd.apache.org/docs/mod/mod_mi ... ovehandler
Post Reply