LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   configuring apache2 to permit cgi (https://www.linuxquestions.org/questions/linux-newbie-8/configuring-apache2-to-permit-cgi-616725/)

rhiel_jheanne 01-27-2008 10:59 PM

configuring apache2 to permit cgi
 
Hi!

I´m a Linux newbie,I can not get my CGI script. Everytime I run it in the web browser, the source code of cgi program will displayed or The requested URL /first.pl.html was not found on this server.


here´s my apache httpd config.


###########################################################################NameVirtualHost
<VirtualHost>
ServerAdmin rhiel_jheanne@yahoo.com
DocumentRoot "/home/jheanne/httpd-2.2.8/docs"
ServerName 202.90.157.245: Port 80
ErrorLog /home/jheanne/httpd-2.2.8/docs/error
CustomLog /home/jheanne/httpd-2.2.8/access_log common
ScriptAlias /cgi-bin/ home/jheanne/httpd-2.2.8/cgi-bin

User apache
Group apache

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Order allow,deny
Allow from all
</Directory>

#Directory Index

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

#LOgLevel

LOgLevel warn

<IfModule log_config_module
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>


</Directory>

<Directory "/home/jheanne/httpd-2.2.8/docs">
Options Indexes FollowSymLinks
AllowOverride None
<Directory "/home/jheanne/httpd-2.2.8/cgi-bin">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>

DefaultType text/plain
<IfModule mime_module>
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-cgi .cgi
AddHandler cgi-script .cgi
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>


Please help me I already confused of what is the right thing to do in configuring apache2 to permit CGI.

THANK YOU in advance....

j-ray 01-28-2008 02:49 AM

AddHandler cgi-script .cgi
should be
AddHandler cgi-script .cgi .pl

and the html extension at the end of your test script has to be removed. It is a perl file and has to be parsed, not an html document.
cheers, j


All times are GMT -5. The time now is 12:45 AM.