icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » Apache CGI question

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old October 20th, 2004, 10:06 PM   #1 (permalink)
Registered User
Seasoned Poster
 
Joined in Apr 2004
42 posts
Gave thanks: 0
Thanked 0 times
Apache CGI question

Hoping one of you Apache CGI gurus might know the answer to this.

Is there a way to tell the webserver to not allow execution of CGI from a particular subdir?

I have a CGI installed which allows some of my users to upload files to a specific subdir on the website. What I want to prevent is them uploading some CGI script and executing it.

Thanks.
thomastj is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 20th, 2004, 10:13 PM   #2 (permalink)
Registered User
On a golden path...
 
programmerguy150's Avatar
 
Joined in Jul 2004
316 posts
Gave thanks: 0
Thanked 0 times
I believe so, or a lot of scripts would not work....let me think.....
__________________
programmerguy150 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 20th, 2004, 11:27 PM   #3 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
You could use a php-upload script which only allowed uploads of certain types of files.
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 20th, 2004, 11:28 PM   #4 (permalink)
Registered User
On a golden path...
 
programmerguy150's Avatar
 
Joined in Jul 2004
316 posts
Gave thanks: 0
Thanked 0 times
exactly! Oh and there is also java ones....go for java if you got a chance.....
__________________
programmerguy150 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 20th, 2004, 11:29 PM   #5 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
Quote:
Originally Posted by Newbie Hoster
exactly! Oh and there is also java ones....go for java if you got a chance.....
java is client side and more easily subverted. Use PHP to control upload to a server.
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 20th, 2004, 11:42 PM   #6 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,092 posts
Gave thanks: 48
Thanked 131 times
Quote:
Originally Posted by Bigjohn
java is client side and more easily subverted. Use PHP to control upload to a server.
Mm... Java both clientside and serverside.. Javascript is completely clientside though. Just clearing that up...
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 21st, 2004, 7:22 AM   #7 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
Quote:
Originally Posted by Haugland
Mm... Java both clientside and serverside.. Javascript is completely clientside though. Just clearing that up...
Ahh, I agree - however they don't run JBOSS on the servers at surpass... thus no serverside java.
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 21st, 2004, 9:34 AM   #8 (permalink)
Registered User
Seasoned Poster
 
Joined in Apr 2004
42 posts
Gave thanks: 0
Thanked 0 times
I'm sort of sour on php based scripts to do any uploads. The files I'm uploading will most like be larger than 2MB. The problem with PHP is it relies to heavily on the PHP.INI variables, which I can't control on a shared environment. Hence the reason for switching to CGI.

Yes I guess I could stop them from uploading a certain filetype, but the CGI have is written in Perl. It would take me some time to figure out the language structure and add something to stop certain extensions from being uploaded.

I'm using a CGI I pulled from http://www.pvdlab.net/en/commerce/wcom . It's ok, but could be better.

In any event, I thought there might be something on the Apache end to only allow CGI code to be executed from within a certain subdir. It appears I can place CGI code anywhere in my subdirs and execute it and it doesn't have to be in the cgi-bin subdirectory.
thomastj is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 21st, 2004, 11:15 AM   #9 (permalink)
rocks your socks.
Resident.
 
David's Avatar
 
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,170 posts
Gave thanks: 8
Thanked 35 times
what about doing it with anonymous ftp and limiting the file types?
__________________
Quote:
Originally Posted by removed View Post
Internet Explorer rules.
David is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On