![]() |
|
Customer Support
How do I use cgi scripts?
If you want to execute a cgi or any other script from your website, you can put the executable file in your cgi-bin directory: /htdocs/www/cgi-bin/CGI and other scripts are not required to go in the cgi-bin directory. You can execute them from your website in any directory you choose, as long as it is under the website DocumentRoot.
After you put the executable script or program somewhere accessible to a browser on your website, then make sure it is world executeable but not world writeable. The shell command to set the correct permissions on the file is:
Some FTP programs have a graphical way of setting permissions too.
Regardless of what any instructions that come with your cgi script say, no script needs to be world writeable or be in a world writeable directory. All your cgi scripts execute with your own permissions. Therefore, if you can write to a directory or file, then so can your script. They will not run if you make them world writable.
Setting permissions chmod 755 will always work for all directories and all cgi scripts.
Regular files that are not scripts should be chmod 644.
To execute your script from a webpage, you can either go to the script directly in a browser or make it the "action" of an html form like
<form action=http://yourdomain.com/cgi-bin/cgi-scriptname method=post>
User-Contributed Notes |
|
| There are no user-contributed notes for this topic. |
Related Questions:
How do I use sendmail with perl?
My formmail.pl script from Matt's Script Archive doesn't work.
Why does Sbox say "no such file or directory" but the files are there?
What Perl modules are installed?
Do you offer CGI? What scripts can I install?
I can't get the python socket module to work?
What is the path to perl or some other program?
Why do I get: Sbox error file is world writable?
Sendmail does not work or does not accept my optional arguments.
Importing the Python cgi module doesn't work.
How do I use MySQL with Python?
What version of Python do you support and what modules are available?
Why do I get: Sbox Error exec of [some script] failed (Exec format error)?
Why do I get: Sbox error file not world executable?
Why do I get: Sbox error the directory containing [some script] is world writable?
Why do I get: Sbox Error exec of [some script] failed (Permission denied)
Why do I get: Sbox error: cannot run suid scripts
Why do I get: Sbox Error exec of [some script] failed (Resource temporarily unavailable)
Browse Categories:Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales |
