Forum Moderators: coopster & phranque

Message Too Old, No Replies

Creating a CGI bin

         

stardancer11

8:03 pm on Jul 8, 2006 (gmt 0)

10+ Year Member



Hello everyone,
I was wondering if some one could help me create a CGI bin for my site. I am completelly new to scripting and cannot find any help out there.

I can creat a basic website (using DreamWeaver), but just creating a folder and naming it CGI-BIN does not seem to work :-(

My questions are:
-how do I create a CGI bin folder in DW?

-what exactly do I need to do to transfer my formmail.pl into that CGI bin? (formmail.pl was taken from Matt's Script Archives)

-I read on many tutorial pages that I have to FTP my CGI using ASCII mode. But how do I choose that mode in DW?

I would greatly appreciate any help!

perl_diver

10:33 pm on Jul 8, 2006 (gmt 0)

10+ Year Member



you can't just create a cgi-bin folder. The ability to run scripts is a server configuration issue. If you want to run cgi scripts on your local PC you need to install perl (or whatever language you will use for your cgi scripts) and an http server.

rocknbil

5:49 pm on Jul 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard stardancer, let me ask - how are you getting your files from your local computer to the server?

The mailer script is an interactive process - data is submitted to it from the web page and the server executes the script and returns a result. You are not going to be able to do this in Dreamweaver in any way, and it won't execute on your local computer in this way.

Begin looking around for other methods of transferring files to your server - the most common being FTP using WS_FTP. In this program, you will be able to create a directory in which to install any executable scripts, such as your mailer. You can create a directory (folder) on the server, let's call it "cgi" (not cgi-bin, so it doesn't get confused with the system's cgi-bin.) Once you create the "folder," will be able to right-click on it and select CHMOD, which means change mode, to set permissions for the folder to executable so any files in this directory can run. Open the directory, copy the script into there, and set the permissions to execute on the FILE also.

If you've no idea about anything I've just said, it's time to get out of Dreamweaver and your hands dirty. :-) Google up for topics on setting permissions, executable scripts, and go back to where you downloaded your formail.pl and read up on all the documentation.

perl_diver

6:40 pm on Jul 9, 2006 (gmt 0)

10+ Year Member




to set permissions for the folder to executable so any files in this directory can run.

Are you sure about that?

stardancer11

11:35 pm on Jul 9, 2006 (gmt 0)

10+ Year Member



I'd like to thank everyone for your help!
I tried everything I could but nothing works. My hosting company tech support just told me to set the permission to 755, which I did (no help at all).
This is what I found in their FAQ: 'Your CGI programs can be stored anywhere on your website. A special directory such
as /cgi-bin is not a must. The file extensions .pl, .py, .php3, and .php4 can be outside a /cgi-bin. When they are inside /cgi-bin they do not necessarily need executable rights.'

I will keep trying as I absolutely have to make it work!

rocknbil

9:53 pm on Jul 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



perl_diver- are you asking if I am sure one can set the permissions on the directory, or if it can be done with WS_FTP, or if that will solve the problem? I didn't want to over-explain, but if the server is config'ed to allow the FTP user to do so, as most are that I work with, then yes to both, maybe to third, I do it all the time. Of course, that goes completely out the window if it's a Windows-based server. But in spite of my usual overblown posts, I was trying to keep it simple. :-)

Stardancer if you must make it work, it's going to take a little reading up on perl as it's obvious you have something wrong. "Server internal error" is worthless to you as you know, it can be anything. Take perl_diver's suggestion, download perl for your local computer (it's free) and learn how to run the scripts by command line. This is where you start, it will tell you if there is anything inherently wrong with the script.

perl_diver

6:25 am on Jul 11, 2006 (gmt 0)

10+ Year Member




perl_diver- are you asking if I am sure one can set the permissions on the directory, or if it can be done with WS_FTP, or if that will solve the problem?

I was refering to if it would solve the problem. I would think it may also have to do with the http server setup too.

stardancer11

10:09 pm on Jul 12, 2006 (gmt 0)

10+ Year Member



Thank you very much for your replies!

I am a bit confused about FTP program choice. You say that about any FTP would work, but are so much against DreamWeaver. DW has an FTP program built in and why wouldnèt it work for transfering files to the server if any other would?

Also I read about every web site about it I could find withing last few days and did everything that was suggested.

What is happening now: when I click "submit" button on my form, the form action "/cgi-bin/formmail.pl" is acting as a link and takes me to formmail.pl instead of triggering the script.

stardancer11

11:07 pm on Jul 12, 2006 (gmt 0)

10+ Year Member



FINALLY!

The form is working like a charm! I DID IT! WOHOOOO!

Again, thanks a lot for all your help!

stardancer

rocknbil

11:08 am on Jul 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Aren't you going to let us know what was wrong? :-)