|
Now that you know what CHMOD and ASCII mode mean, you will need to know how to use them on files
and directories with your specific FTP program. If you are not sure, there are instructions
for several popular versions in the FTP section.
Uploading
- Start up your FTP program and connect to your CGI-BIN account.
- Change to the public_html directory.
- Create a new directory called scripts or whatever (okay, I don't literally mean a
directory called whatever, but if you really want to, go ahead).
- CHMOD the directory to 755 (drwxr-xr-x)
- Change to this new directory.
- Upload the file in ASCII mode.
- CHMOD the file to 755 (-rwxr-xr-x)
Testing it out
You can now test your script by typing the URL into your browser, which will look something
like:-
http://cgi-bin.spaceports.com/~user/scripts/hello.cgi
After a short pause you should see the phrase 'Hello World!' in large letters on your
screen. If so, well done - you are ready to move on.
If you see the Spaceports main page instead, then there are 3 possible causes:-
- Incorrect transfer mode - you must use ASCII for scripts.
- Incorrect file or directory permissions - they must be 755 for scripts and directories
containing scripts.
- The URL you typed in was incorrect. UNIX is case sensitive so hello.cgi is not
the same thing as Hello.cgi - this applies to directories too. Another similar cause
would be not starting off in the public_html folder to begin with.
|