CGI Programmng / Scripts Interview Questions and Answers

CGI Programmng Questions and Answers:

1 :: What do I absolutely need to know in CGI?

If you're already a programmer,CGI is extremely straightforward, and just three resources should get you up to speed in the time it takes to read them:
1) Installation notes for your HTTPD.Is it configured to run CGI scripts, and if so how does it identify that a URL should be executed?
(Check your manuals, READMEs, ISP webpages/FAQS, and if you still can't find it ask your server administrator).
2) The CGI specification at NCSA tells you all you need to know to get your programs running as CGI applications.
3) WWW Security FAQ. This is not required to 'get it working', but
is essential reading if you want to KEEP it working!
http://www.w3.org/Security/Faq/www-security-faq.html

If you're NOT already a programmer, you'll have to learn. If you would
find it hard to write, say, a 'grep' or 'cat' utility to run from the
commandline, then you will probably have a hard time with CGI. Make
sure your programs work from the commandline BEFORE trying them with CGI,
so that at least one possible source of errors has been dealt with.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 1 No
Place Your Answer

2 :: Do I have to use Perl?

No - you can use any programming language you please. Perl is simply
today's most popular choice for CGI applications. Some other widely-
used languages are C, C++, TCL, BASIC and - for simple tasks -
even shell scripts.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

3 :: Can I identify users/sessions without password protection?

The most usual (but browser-dependent) way to do this is to set a cookie.
If you do this, you are accepting that not all users will have a 'session'.

An alternative is to pass a session ID in every GET URL, and in hidden
fields of POST requests. This can be a big overhead unless _every_ page
requires CGI in any case.

Another alternative is the Hyper-G[1] solution of encoding a session-id in
the URLs of pages returned:
http://hyper-g.server/session_id/real/path/to/page
This has the drawback of making the URLs very confusing, and causes any
bookmarked pages to generate old session_ids.

Note that a session ID based solely on REMOTE_HOST (or REMOTE_ADDR)
will NOT work, as multiple users may access your pages concurrently
from the same machine.

[1] Actually I don't think that's been true of Hyper-G since sometime
in '96. However, general advances in web server technology, such as
Apache's mod_alias or mod_rewrite, make it straightforward without
the need for CGI.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

4 :: How can I stop my CGI script reading and writing files as nobody?

CGI scripts are run by the HTTPD, and therefore by the UID of the HTTPD
process, which is (by convention) usually a special user "nobody".

There are two basic ways to run a script under your own userid:
(1) The direct approach: use a setuid program.
(2) The double-server approach: have your CGI script communicate
with a second process (e.g. a daemon) running under your userid,
which is responsible for the actual file management.

The direct approach is usually faster, but the client-server architecture
may help with other problems, such as maintaining integrity of a database.

When running a compiled CGI program (e.g. C, C++), you can make it
setuid by simply setting the setuid bit:
e.g. "chmod 4755 myprog.cgi"

For security reasons, this is not possible with scripting languages
(eg Perl, Tcl, shell). A workaround is to run them from a setuid
program, such as cgiwrap.

In most cases where you'd want to use the client-server approach,
the server is a finished product (such as an SQL server) with its
own CGI interface.
A lightweight alternative to this is Don Libes' "expect" package.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

5 :: Do I need to be on Unix?

No, but it helps. The Web, along with the Internet itself, C, Perl,
and almost every other Good Thing in the last 20 years of computing,
originated in Unix. At the time of writing, this is still the
most mature and best-supported platform for Web applications.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

Rate This Category:
0/5 Rating (0 vote)
Place Your Question



Top: CGI Programmng / Scripts Interview Questions and Answers
CGI Programmng / Scripts Interview Questions and Answers

Top Frequently Asked CGI Programmng Question
Frequently Asked CGI Programmng Job Interview Question


Top Frequently opened Computer Programming Job Interview categories
Most popular Computer Programming Job Interview categories

Comments About CGI Programmng / Scripts Interview Questions and Answers

Share your valuable opinions, ideas and suggestions about CGI Programmng / Scripts Interview Questions and Answers
While placing your comment your email address is required but won't be published any where else; Personal information will be kept confidential; we do not sell or release our respective visitors private information.
  1. Webmaster 20th of May 2012

    Webmaster Said

    Tell us what you feel about CGI Programmng / Scripts Interview Questions and Answers
    All comments will be published after review. No login or registration is required to post a comment on CGI Programmng / Scripts Interview Questions and Answers We offer and invite you to submit your valuable comment now; Please be respectful of others when commenting. Insulting others, self-promotional comments, website promotional comments, marketing stuff, SEO Techniques, SMS-style content and off-topic comments will not be approved at this information portal.
    So start sharing your thoughts regarding CGI Programmng / Scripts Interview Questions and Answers
    Thank you.

Leave a Comment

Leave a Comment
  1.  Enter This Verification Code  Regenerate Verification Code  



Your reply will be added to the comment above (Below any other replies to this comment) -

Top Comments About: CGI Programmng / Scripts Interview Questions and Answers
Comments on CGI Programmng / Scripts Interview Questions and Answers

 
Top of Link batk to CGI Programmng / Scripts Interview Questions and Answers
Link batk to CGI Programmng / Scripts Interview Questions and Answers