Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

CGI configuraton

by leslie (Pilgrim)
on Sep 10, 2010 at 05:40 UTC ( [id://859595]=perlquestion: print w/replies, xml ) Need Help??

leslie has asked for the wisdom of the Perl Monks concerning the following question:

Dear friends,

I know perl. But I don't know about perl CGI. I want to learn that. I have tried to configure the perl CGI. But I unable to do that.

Configuration I have done : In /etc/apache2/httpd.conf, I have added ,

<Directory /home/leslie/public_html/> Options ExecCGI AddHandler cgi-script .cgi .pl </Directory>
Then I have restart the apache server, While running the sample script with the extension of .cgi its simply prints the hole file content on the browser.

System Env: Webserver: apache2 OS : ubuntu 10.4 Note: I am not root user.

Can some one help me to configure the CGI in my env

Replies are listed 'Best First'.
Re: CGI configuraton
by Khen1950fx (Canon) on Sep 10, 2010 at 07:01 UTC
    On my system, httpd.conf is located at /etc/httpd/conf/httpd.conf

    At approx. line 292, the Options directive:

    <Directory /> Options FollowSymLinks ExecCGI AllowOverride None </Directory>
    At approx. line 779, the AddHandler:
    AddHandler cgi-script .cgi
      hi friend,

      In my system there is no /etc/httpd/conf/httpd.conf. It has located in /etc/apache2/httpd.conf. How can I configure this ?

      I have discussed with my friend, He said , you should enable the CGI module in apache, If u enable this then it will have mod-perl package.

      I don't know how to enable this.. How can I run the CGI in my system.

      I want to learn frds.. Can any one plzz tell me to run the CGI script in my system.

      Thanks you frds..

        Well, first of all, you're editing the wrong file for Ubuntu. Ubuntu uses a virtual hosts system and you'll want to add the directory section to the file for the virtual host, which will be in the /etc/apache2/sites-available directory. I highly recommend you read the Ubuntu Server Guide on Apache2.

        Second is, directory names shouldn't have a trailing slash. Not a big deal, but maybe you would like to see a nice Apache Tutorial to help get the commands right. Also, I'm not sure it matters but I use +ExecCGI rather than ExecCGI.

        CGI and mod_perl are very different things. Apache2 on Ubuntu comes with CGI enabled and turned on for /usr/lib/cgi-bin, you can skip all this and just drop your script in that directory.

        Setting up mod_perl on Ubuntu isn't difficult but you'll need to install the mod_perl package and then a2enmod it. Search the Ubuntu site, I'm sure they have a guide somewhere.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://859595]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found