LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-06-2007, 07:14 AM   #1
xudonw1
LQ Newbie
 
Registered: Apr 2007
Location: london
Posts: 19

Rep: Reputation: 0
Unhappy cgi is not running through Apache2 ----- help


Hi there

I am A Linux Newb,

I can not 'get' the cgi script,every time I run it from IE, it shows me whole perl script.

dun know y???

here is my apache VHost config and content of my perl files
#########################################################
#########################################################
#NameVirtualHost
<VirtualHost 172.16.200.79>
ServerAdmin webadmin@nano.bds.tv
DocumentRoot /var/www/apache2-default/twiki/
ServerName nano.bds.tv
ErrorLog /var/www/apache2-default/twiki/error
ScriptLog /var/www/apache2-default/twiki/script
ScriptAlias /cgi-bin/ /var/www/apache2-default/twiki/bin/
#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory /var/www/apache2-default/twiki/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
#Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>

<Directory "/var/www/apache2-default/twiki/bin">
#<Directory "/usr/lib/cgi-bin/">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug

CustomLog /var/log/apache2/access.log combined
ServerSignature On

</VirtualHost>
############################################
###########################################

-r-xr-xr-x 1 www-data www-data 1057 2007-03-03 14:45 attach
-r-xr-xr-x 1 www-data www-data 1073 2007-03-03 14:45 changes
-r-xr-xr-x 1 www-data www-data 20757 2007-03-03 14:45 configure
-r-xr-xr-x 1 www-data www-data 1061 2007-03-03 14:45 edit
-r-xr-xr-x 1 www-data www-data 1427 2007-04-05 22:36 LocalLib.cfg
-r--r--r-- 1 www-data www-data 1419 2007-03-03 14:45 LocalLib.cfg.txt
-r-xr-xr-x 1 www-data www-data 1205 2007-03-03 14:45 login
-r-xr-xr-x 1 www-data www-data 1581 2007-03-03 14:45 logon
drwxr-xr-x 2 www-data www-data 4096 2007-03-03 14:45 logos
-r-xr-xr-x 1 www-data www-data 1135 2007-03-03 14:45 manage
-r-xr-xr-x 1 www-data www-data 1064 2007-03-03 14:45 oops
-r-xr-xr-x 1 www-data www-data 1063 2007-03-03 14:45 passwd
-r-xr-xr-x 1 www-data www-data 1072 2007-03-03 14:45 preview
-r-xr-xr-x 1 www-data www-data 1062 2007-03-03 14:45 rdiff
-r-xr-xr-x 1 www-data www-data 1062 2007-03-03 14:46 rdiffauth
-r-xr-xr-x 1 www-data www-data 1028 2007-03-03 14:45 register
-r-xr-xr-x 1 www-data www-data 1055 2007-03-03 14:45 rename
-r-xr-xr-x 1 www-data www-data 1030 2007-03-03 14:45 resetpasswd
-r-xr-xr-x 1 www-data www-data 3355 2007-03-03 14:45 rest
-r-xr-xr-x 1 www-data www-data 1060 2007-03-03 14:45 save
-r-xr-xr-x 1 www-data www-data 1079 2007-03-03 14:45 search
-r-xr-xr-x 1 www-data www-data 1999 2007-03-03 14:45 setlib.cfg
-r-xr-xr-x 1 www-data www-data 1569 2007-03-03 14:45 statistics
-r-xr-xr-x 1 www-data www-data 7195 2007-03-03 14:45 twiki
-r-xr-xr-x 1 www-data www-data 1055 2007-03-03 14:45 upload
-r-xr-xr-x 1 www-data www-data 1088 2007-03-03 14:45 view
-r-xr-xr-x 1 www-data www-data 1088 2007-03-03 14:46 viewauth
-r-xr-xr-x 1 www-data www-data 1054 2007-03-03 14:45 viewfile
 
Old 04-06-2007, 08:17 AM   #2
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
The reason it is displaying the text is that Apache has not been told that these perl scripts need to be processed by perl before being served to the client. Thus, it is simply serving them as-is, like it would an HTML file. You need to add a handler to the Apache configuration to tell it that certain files should be processed as CGI, something like:
Code:
AddHandler cgi-script .cgi .pl
This tells Apache that before it serves a file ending in .cgi or .pl, it should hand it off to perl for processing, and serve the output of that.
 
Old 04-07-2007, 05:42 AM   #3
xudonw1
LQ Newbie
 
Registered: Apr 2007
Location: london
Posts: 19

Original Poster
Rep: Reputation: 0
just the man ,, thank you

just the man ,, thank you

 
  


Reply



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 on apache2? sharadshankar Linux - Software 5 02-19-2006 04:40 PM
Apache2 php5 (cgi-fcgi). hgb Linux - Software 2 11-16-2005 09:51 AM
CGI With Apache2 karthik85nitt Linux - Newbie 2 07-15-2005 04:11 AM
CGI-script problem on Apache2 jkt2000 Linux - Networking 3 01-28-2005 04:38 AM
CGI apache2 question gothrog Linux - Software 1 09-16-2004 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:31 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
Open Source Consulting | Domain Registration