Installing CGI-Scripts

Discussion in 'Web Development' started by vishal sharma, Jul 28, 2004.

  1. vishal sharma

    vishal sharma New Member

    Joined:
    Jul 23, 2004
    Messages:
    106
    Likes Received:
    6
    Trophy Points:
    0
    For many new webmaster this is probably one of the most daunting tasks they'll need to do. Mainly because you're not used to the UNIX environment, but also because you have to edit some perl scripts to make the script work. Here are the basic things you need to install CGI-Scripts.

    You need a web host that gives you a cgi-bin, most free hosting companies won't give you a cgi-bin because of security reasons. If you're on a free web host and you want to add things like a guestbook or message boards, I would suggest you use a service like www.bravenet.com they have codes that you just cut and paste. Good thing, it's easy, bad thing, it has advertising and it generally makes your page look a little less professional.

    You'll need the script itself. You can download almost any cgi-script for free at www.cgi-resources.com this is where I go to get any scripts that I'll need for the websites I write.

    You'll need a plain text editing program. If you're in a windows operating system Notepad would be fine to edit perl / cgi scripts. (Don't use Word, Wordpad or any other "rich text" type program, it will screw up the script).

    You'll need an ftp program, this is a program that will upload your page to your server. I like WS_FTP Pro, you an use the lite version of this program, which is free, but this pro version offers more features and easier to use I think.

    Okay, so that's what you'll need, now here is the important things you'll need to know about installing the scripts:

    Always read the included installation instructions. All scripts come with a readme.txt file or some form of installation instructions. Read these carefully, because they'll tell you how and what you need to do for this script.

    Knowing the perl path for your server. In all cgi scripts the script itself will need to know where the perl kernel is. In most cases the perl path is /usr/bin/perl and most people that write scripts will point it here, contact your web host if you're unsure of where the path to your perl kernel is

    Make sure to upload the .cgi files to the cgi-bin on your server. Almost all the servers I've been on makes you upload your scripts to a separate folder called the cgi-bin. If you upload your script elsewhere it just won't work (note, on some servers they do allow you to put the cgi-scripts in any directory, but it's been my experience that most have the separate cgi-bin).

    When uploading CGI, make sure that you upload it in ASCII, not BINARY, if you upload it in Binary the script will not work. Binary is for photos and regular pages, but for scripts you'll need to upload it in ASCII format.

    Know the root to your cgi-bin and also the public_html files. Most of the times the path will look like /home/username/domain name/public_html and the root to your cgi-bin will look like /home/username/domain name/cgi-bin - Once again, you'll need to contact your web host if you're unsure. Also, some scripts will point to the cgi script by having the url and not the root, pay attention to what the script asks, because sometimes it will be the url where the script is located, like, http://www.yourdomain.com/cgi-bin/scriptname.cgi

    Knowing your sendmail path. This is for scripts that will allow users to email or perhaps if the program emails you if someone posts messages etc. The send mail path is usually /usr/lib/sendmail once again, if you don't know contact your web host or check their FAQ, they usually give this information there.

    Knowing how to chmod or set permissions to files and directories. All the scripts you download will tell you to set permissions to your scripts and files, you must do this! If they say to set the permission to a certain number, you must do so! If you don't, the script won't work! In the different ftp programs there are different ways to set permissions, usually most will have where you can right click on the file and there will be a permissions button or a chmod button and then you can set the permissions that way.

    Contact your web host if you have trouble...always remember that you're paying for a service and most places offer technical support, don't be too shy to ask for help, that's what technical support is there for and especially if you're paying for the service you should use the service as much as you can!

    These are the basics you need to know, each script is different, some programmers really go out of their way to make the script easy to install, some programmers write great scripts but give lousy instructions, so, just try out some scripts, don't be scared of them, and don't give up on them, because the first few times, you'll almost always get errors, trust me, I should know!

    One other thing, I found with my own webhosting company that they weren't that willing to give cgi help, I think that's sort of lame to tell you the truth. A company that offers services should be knowledgeable on such topics, but you often find tech support usually knows less than you and that you're on your own most of the times.

    I've installed lots of scripts now and there are a few that I'll use over and over again because they're just so easy to install and really work great. If you want some help in this area I can point you to the easiest to install cgi-scripts, just tell me what your looking for or I'll write a tutorial on what scripts to use. Have fun, don't get frustrated, and don't give up, you'll get the hang of the cgi-scripts soon enough :eek:) If not, email me and I'll try and help out.
     
  2. alok

    alok New Member

    Joined:
    Jul 24, 2004
    Messages:
    127
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    S/W Engg
    Home Page:
    http://www.thatsalok.com
    Re: Webmasters--Installing CGI-Scripts

    sorry to Disturb you in this matter :d
    but i think the CGI is now obesolute technology,every buddy is going after new technology like JSP and ASp which more Fast and efficient.
    sorry ,but that truth,it that hurt i am sorry.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Re: Webmasters--Installing CGI-Scripts

    Sorry Alok but cgi is not at all obsolete and lots of technology still uses cgi. Perl is the most exciting language for cgi and still in development phase its use is increasing day by day.

    Thanks
    Shabbir Bhimani
     
  4. alok

    alok New Member

    Joined:
    Jul 24, 2004
    Messages:
    127
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    S/W Engg
    Home Page:
    http://www.thatsalok.com
    Re: Webmasters--Installing CGI-Scripts

    may be you are rite
    but with all due respect,no buddy want to use it when same functionality is provided by more powerful and easy scripting lanaguge like ASP ,PHP( which is upgrade of perl) and JSP.
    may be it on developmental stage,but why to develop a thing which already obesolute
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Re: Webmasters--Installing CGI-Scripts

    Alok, now I think you are not very much unknown to web technology.

    » PHP( which is upgrade of perl)
    First PHP and perl are nowhere related

    JSP can be considered as an easy way to use Java on web.

    Now if you say
    » but with all due respect,no buddy want to use it when same functionality is provided by more powerful and easy scripting lanaguge like ASP ,PHP( which is upgrade of perl) and JSP.

    so now the question comes why there are 3 scripting languages and not one say APJ(ASP,PHP,JSP). All can provide same functionality and to be honest all cannot have the same ranks if we define them with no1, no2, no3.

    Now if its on development and you are critising perl then this means that perl is famous and not obsolete.
    Windows is attacked by virus but not linux. What does it mean that non windows lovers want to give trouble to win guys but they think to keep linux clean but microsoft can develop virused for linux if they want but knows that Linux is nowhere near win and so doesnot need it.

    Alok if this hurts please dont mind.

    Thanks
    Shabbir Bhimani
     
  6. alok

    alok New Member

    Joined:
    Jul 24, 2004
    Messages:
    127
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    S/W Engg
    Home Page:
    http://www.thatsalok.com
    Re: Webmasters--Installing CGI-Scripts

    YEah i am new to webtechnology,the only weblanaguge i know is HTML :D
    Basically i quoted wrong that PHP is Upgrade of perl. actaully they are syntacally same.
    and abotu perl really my knowledge is zero do you have any good article that support that perl is lanaguage of future.
    basically Web is not my line i am vc++ Programmer and i work as System programmer in small company and trust my word my level is that of beginner
     
  7. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Re: Webmasters--Installing CGI-Scripts

    Benjamin78, your hosting url is self promotion without the context of the article and is deleted.
     
  8. rapwaydown

    rapwaydown New Member

    Joined:
    Nov 28, 2007
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    0
    Re: Webmasters--Installing CGI-Scripts

    wow, im new to web technology, still dont know HTML very good
    but getting there
     
  9. ashleycameron

    ashleycameron New Member

    Joined:
    May 9, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Re: Webmasters--Installing CGI-Scripts

    Hi, This is awesome article. Its very interesting and informative, Where you read this topic. Its really great work. Try to post these kind of article often... Best of Luck.
     
  10. Jenniferlinn

    Jenniferlinn New Member

    Joined:
    Dec 24, 2008
    Messages:
    23
    Likes Received:
    3
    Trophy Points:
    0
    Occupation:
    search engine optimization
    Location:
    UK
    Home Page:
    http://www.micrositez.co.uk/se
    Re: Webmasters--Installing CGI-Scripts

    Hello vishal

    Thanks for posting such a useful article here, It clears most of my doubts about the topic
     
  11. Lizapotter

    Lizapotter New Member

    Joined:
    Feb 24, 2009
    Messages:
    17
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Web Design London
    Location:
    UK
    Home Page:
    http://www.codastar.com/
    Re: Webmasters--Installing CGI-Scripts

    Tips while using CGI:

    1. Beware the eval statement

    Languages like PERL and the Bourne shell provide an eval command which allow you to construct a string and have the interpreter execute that string. This can be very dangerous. Observe the following statement in the Bourne shell:

    eval `echo $QUERY_STRING | awk 'BEGIN{RS="&"} {printf "QS_%s\n",$1}' `

    This clever little snippet takes the query string, and convents it into a set of variable set commands. Unfortunately, this script can be attacked by sending it a query string which starts with a ;.

    2. Do not trust the client to do anything

    A well-behaved client will escape any characters which have special meaning to the Bourne shell in a query string and thus avoid problems with your script misinterpreting the characters. A mischevious client may use special characters to confuse your script and gain unauthorized access.

    3. Be careful with popen and system.

    If you use any data from the client to construct a command line for a call to popen() or system(), be sure to place backslashes before any characters that have special meaning to the Bourne shell before calling the function. This can be achieved easily with a short C function.

    4. Turn off server-side includes

    If your server is unfortunate enough to support server-side includes, turn them off for your script directories. The server-side includes can be abused by clients which prey on scripts which directly output things they have been sent.
     
    shabbir likes this.
  12. Apostile

    Apostile New Member

    Joined:
    Jun 1, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    United States
    Home Page:
    http://www.apostile.us
    Re: Webmasters--Installing CGI-Scripts

    netCHARTING enables your web site to display massive amounts of dynamically generated data quickly and easily through a visual interface. Built with 100% managed code using C# and provided with extensive samples in both VB.NET and C#, this high performance charting control also contains a feature rich data access and aggregation system with calculation support. We continue to add value and functionality (such as the gauge and dial chart added in 2.5, the geographic map chart and vector chart in 4.0, AJAX scroll / zoom in 5.0, organizational charts in 5.1 and digital dashboards charts in 5.2) to .netCHARTING with no separate add-on purchases required. See what's new or download a fully functional, free, developer version and start charting today!
     
  13. wilomr11st

    wilomr11st New Member

    Joined:
    Aug 7, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://x.co/lgUx
    Re: Webmasters--Installing CGI-Scripts

    Sorry Alok but cgi is not at all obsolete and lots of technology still uses cgi. Perl is the most exciting language for cgi and still in development phase its use is increasing day by day.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice