no cgi bin

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Thu Apr 15, 2004 10:21 pm    Post subject: no cgi bin Reply with quote

I attempted to put my form processing program in the cgi bin and renamed my program with a .cgi extension. however it could not find the path specified or something because it only returned my sourcecode. So i simply placed my processing program in an a relative path to the program - that is in the htmldocs folder and everything works fine.
My question is is there a security risk with doing this. or not putting it in the cgi-bin. is it necessarily wrong or something? I'm using python to do my form processing and using abyss to let me see how it handles the forms. Will there be some conflict when i upload it to my webhost?
Thank you very much.
Back to top View user's profile Send private message Yahoo Messenger
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Apr 15, 2004 11:18 pm    Post subject: Reply with quote

I never got python to work with abyss , I don't even know if its
a security issue but can you explain how to install python.

It may be possible to create a Python
version of ::Virtual Host Creator:: 8)

-------------------------------------------------------------------------------------

On Abyss , any cgi program can run outside the cgi
bin so that should not be a problem , Hope this helps!
Back to top View user's profile Send private message Visit poster's website
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Fri Apr 16, 2004 4:10 am    Post subject: Reply with quote

good to know.
------------------------------
To install python install like you would do any other language interpereter.

1)download the interpreter
2)in abyss go to : > Home > Server Configuration > Advanced > CGI Parameters
3) make sure botht these options are set to yes:
Resolve interpreter using the Windows Registry: yes
Resolve interpreter using the script's #! line: yes

this will have windows search for the path of the interpreter
and make sure the interpreter reads after the #! line

make sure in the cgi interperters section it says something like:
C:\Python23\python.exe py

and that should be it shouldn't be a problem.

Glad to know there is another python fan on the board. let me know if you have any problems.

:wink:
Back to top View user's profile Send private message Yahoo Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Apr 16, 2004 3:20 pm    Post subject: Re: no cgi bin Reply with quote

garyanderson,

There is no security risk if your CGI parameters (and your CGI Paths) are correctly set up.

But we recommend setting:
Resolve interpreter using the Windows Registry: No
Resolve interpreter using the script's #! line: No

This will speed up the processing of your CGI pages as Abyss will only rely on the extension to know what interpreter to use. Of course, you should set the Associated extensions with Python to "py cgi" (py space cgi).

By the way, we too are Python fans.

TrustPunk, what's the problem with Python?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Fri Apr 16, 2004 6:14 pm    Post subject: Reply with quote

Thank you for your reply. Howver is it necessarily wrong though if the application processing the form is not in the cgi bin? or is it okay if its in the htmldocs section and with a .py ext and not .cgi. I actually likethis better as i can modify it quicker.

Thank you.
Back to top View user's profile Send private message Yahoo Messenger
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Apr 17, 2004 5:24 am    Post subject: Reply with quote

Edit: I got Python working , no more screenshots,

Last edited by TRUSTAbyss on Thu Mar 24, 2005 9:11 am; edited 1 time in total
Back to top View user's profile Send private message Visit poster's website
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Sat Apr 17, 2004 8:30 am    Post subject: Reply with quote

Trustpunk, are you sure Perl and Python can both share the .cgi extension? If you have resolve interpreter using script's #! line set to no, there'll be no way for Abyss to choose the correct interpreter...

Do .py files work ?
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Apr 17, 2004 9:18 am    Post subject: Reply with quote

Quote:
garyanderson,

There is no security risk if your CGI parameters (and your CGI Paths) are correctly set up.

But we recommend setting:
Resolve interpreter using the Windows Registry: No
Resolve interpreter using the script's #! line: No

This will speed up the processing of your CGI pages as Abyss will only rely on the extension to know what interpreter to use. Of course, you should set the Associated extensions with Python to "py cgi" (py space cgi).

By the way, we too are Python fans.

TrustPunk, what's the problem with Python?


Have you read what Aprelium Recommends ?
Back to top View user's profile Send private message Visit poster's website
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Sat Apr 17, 2004 11:00 pm    Post subject: Reply with quote

hope it works for you punk. I only use python as my interperter for cgi so i don't know if there is a conflict of sorts with abyss when it has to go to perl or to python.

one question. if you use perl or pyhton for cgi, why do you have to rename the script with a .cgi extension. is it for security reasons so ppl can't see what program your using for processingand hack you? otherwise i don't really see a reason. and why place it in the cgi bin, isn't that just confusing? then you have to change your path in your script to \cgi-bin\parser.cg it just seems a lot of work for no reason. Of course i'm a web newbie so i'll be spouting off a lot. Thanks for the replies


With python I can print out the html page or use the location mime to redirect the web page? I just find all of these unecessary thats why, let me know if i'm wrong. Thankslol:
Back to top View user's profile Send private message Yahoo Messenger
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Sun Apr 18, 2004 12:35 am    Post subject: Reply with quote

TRUSTpunk wrote:
Have you read what Aprelium Recommends ?


They may have been assuming you were only running one scripting language on your server. For hosting a personal site, most people do not need to install Perl, Python, ASP and PHP at the same time...
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Apr 18, 2004 4:50 pm    Post subject: Reply with quote

garyanderson,

Using .cgi and cgi-bin is not mandatory. That's mainly a legacy from the early web servers (in the 90s) where security was rudimentary and where scripts needed to be located in a single directory.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Sun Apr 18, 2004 9:04 pm    Post subject: Reply with quote

OH, Thank you so much apprelium. I really was wondering if it was a security issue or somthing. Thank you for answering. I really am impressed with python so I wouldn't mind showing it off to the world. That language should be bigger thatn it is now, Maybe you guys should add a python forum. I noticed you had perl, asp and something else. I did a search on here and I noticed a lot of ppl are interested in Python. I would love to contribute some of my scripts to help out. anyway i can.

Abyss OWNS!!! EXCELLENT WORK!!!
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sun Apr 18, 2004 9:22 pm    Post subject: Reply with quote

So what about the whole idea that the /cgi-bin directory has to be out of the root directory?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon Apr 19, 2004 7:11 am    Post subject: Reply with quote

Edit: Here's a good Python script to test if Python is working.

Hello World!
Code:

print "Content-Type: text/html\n"
print "Hello World!"


Last edited by TRUSTAbyss on Thu Mar 24, 2005 9:12 am; edited 1 time in total
Back to top View user's profile Send private message Visit poster's website
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Mon Apr 19, 2004 2:45 pm    Post subject: Reply with quote

congratulations punk i'm glad you got it working. Next time we'll ask you to post code. I've realised when dealing with computers the answers to the questions are usally really simple.

Your right the cgi.tes() method is an excellent method to check if everything is working properly. If you know python at all you can do pretty much everything for cgi. You might even give up perl.

al python cgi scripst begin with the following
Code:
import cgi
import cgitb; cgitb.enable()
form = cgi.FieldStorage()

and thats it!! cgitb is a cgi tracback class that will point out any errors when your scripts don't work. use this to build the forms then remove when your script is working fine.
calling the fieldstorage method invokes form to be of a dictionary type (I don't know if you have those in perl, they are called hash in other languages)
once you have your form, you access you can manipulate like so
Code:
input=form.getvalue("name","N/A")
where getvalue gets the value of the name key and returns it, if its not there, then "N/A" will print instead.

when your ready to output html then simply
Code:
print "Content-type: text/html"
print
print <tags>text</tags>

note python supports th location mime type as well

anyway to make a short story long: d
1st make sure your using python 2.3 that is the latest.
note that not all of the dictionary methods are supported by the cgi module - an annoyance i think they should fix in later releases.
for more detailed info about using the cgi module go to python manuals> index>cgi. you'll find a plethora of info. Trust me you'll llove it.
to see what ptython can do with cgi check
http://aspn.activestate.com/ASPN/Cookbook/Python?kwd=CGI%20Programming
HAVE FUN!!
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Tue Apr 20, 2004 12:37 am    Post subject: Reply with quote

There is a very nice Python webmail that I like (since we're on the topic of Python):
http://linux.tucows.com/preview/260315.html
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
MUGH8506
-


Joined: 14 Jun 2004
Posts: 72
Location: Hell

PostPosted: Fri Jul 09, 2004 6:07 pm    Post subject: Reply with quote

What is "cgibin"? Is this a server side or what?
_________________

http://www.trustabyss.com/
Back to top View user's profile Send private message MSN Messenger
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Jul 09, 2004 6:16 pm    Post subject: Reply with quote

The cgi-bin is where you keep your Perl scripts , if you have the new
2.0 Beta 1 , you don't have to worry about the cgi-bin because its not
included in the package , also 1.2 doesn't need a cgi-bin now.

Welcome to the year 2004 !
Back to top View user's profile Send private message Visit poster's website
MUGH8506
-


Joined: 14 Jun 2004
Posts: 72
Location: Hell

PostPosted: Sat Jul 10, 2004 5:53 am    Post subject: Reply with quote

oh yeah
_________________

http://www.trustabyss.com/
Back to top View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group