LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-27-2008, 10:59 PM   #1
rhiel_jheanne
LQ Newbie
 
Registered: Jan 2008
Posts: 1

Rep: Reputation: 0
Cool configuring apache2 to permit cgi


Hi!

Im 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.


heres 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....
 
Old 01-28-2008, 02:49 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,542

Rep: Reputation: 136Reputation: 136
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cgi is not running through Apache2 ----- help xudonw1 Linux - Server 2 04-07-2007 05:42 AM
cgi on apache2? sharadshankar Linux - Software 5 02-19-2006 04:40 PM
CGI With Apache2 karthik85nitt Linux - Newbie 2 07-15-2005 04:11 AM
CGI apache2 question gothrog Linux - Software 1 09-16-2004 02:31 PM
how to install a cgi counter in apache2 hartings Programming 14 08-31-2003 10:33 AM


All times are GMT -5. The time now is 12:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration