LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to configuer perl with apache2 ? ... (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-configuer-perl-with-apache2-534655/)

adam_blackice 03-05-2007 01:54 AM

how to configuer perl with apache2 ? ...
 
hello all .....,
this is my second post with this issue i posted before in the programming forum and i didnot get the answers so i hope to find it here

i want to configure perl with apache 2 to make me able to write cgi programs and simply i have apche2 installed and also i have perl installed and i was writing perl programs and i got the output by the shell and i want to get it by browser so i but this lines on the httpd.conf file

PHP Code:

   ScriptAlias /cgi-bin"/usr/local/apache/cgi-bin/" 


PHP Code:

 <Directory "/usr/local/apache2/cgi-bin">
    
AllowOverride None
    Options None
    Order allow
,deny
    Allow from all
</Directory

and when i want to run the program from abrowser like that

http://localhost/cgi-bin/hello.cgi
igot this error

Forbidden

You don't have permission to access /cgi-bin/hello.cgi on this server

and iam sure i have changed the ownership of the file to a normal user on the system what i can Do ? >......

thanx for all

bathory 03-05-2007 02:12 AM

You must make that your cgi-bin script is executable:
Code:

chmod +x /usr/local/apache2/cgi-bin/hello.cgi

adam_blackice 03-05-2007 02:26 AM

still having the same error :S

Forbidden

You don't have permission to access /cgi-bin/test.cgi on this server.

i want to know what about adding mod_perl to apache how can it be done ? .... and itis an important to make perl working with apache ?

bathory 03-05-2007 03:15 AM

Now that I looked better your config you have an error in the path of your cgi directory:
Quote:

ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
vs
Quote:

<Directory "/usr/local/apache2/cgi-bin">
Note the 2 after apache.

adam_blackice 03-05-2007 05:57 AM

thanx for your support i make it as apache2 and when i run the localhost/cgi-bin/hello.cgi igot this

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
you@example.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>

bathory 03-05-2007 06:24 AM

So you made:
Code:

ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
and still not working?
If you want to debug the "Internal Server Error", use the documentation provided by apache.

adam_blackice 03-05-2007 10:21 AM

thanx mr bathory i search in the apache pages and the problem solved thanx :)


All times are GMT -5. The time now is 09:14 PM.