LinuxQuestions.org
Help answer threads with 0 replies.
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 08-08-2006, 04:01 PM   #1
laeeq38
LQ Newbie
 
Registered: Jul 2006
Posts: 10

Rep: Reputation: 0
web server doesnt run cgi file


I have created a virtual host with following configuration

NameVirtualHost 192.168.0.2:80

#Default Host

<VirtualHost *>
DocumentRoot /var/www/html
ServerName Linux
DirectoryIndex index.html
</VirtualHost>

#My domain

<VirtualHost 192.168.0.2>
DocumentRoot /var/www/mysite
ServerName www.mysite.com
DirectoryIndex index.html

<Files results>
ForceType application/x-httpd-cgi
</Files>

<Directory "/var/www/mysite">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow, deny
Allow from all
</Directory>

</VirtualHost>

I have created a subdirectory that I named "result" under DocumentRoot directory mysite and placed a cgi file called results but with no .cgi extension but ForceType should take care of it.

but when I type URL www.mysite.com/result/results

it doesnt run the file as cgi script but a window appears telling me that
"you have chosen to open results which is a: application/x-httpd-cgi from: http://www.mysite.com
and asking me to open with or save to disk.

I am wondering why it is doing this instead of running it.

I also added the following line it maynot be necesary but I still added

AddHandler cgi-script .cgi

it run when I put results in the main directory
www.mysite.com/results

I will appreciate if anybody could help me in this
Thanks!!
 
Old 08-10-2006, 07:08 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
I think you need to add a ScriptAlias directive to your httpd.conf file:

ScriptAlias /cgi-bin/ "path/to/cgi/programs"

I've also got a Directory set up for this:

<Directory "/path/to/cgi/programs">
AllowOverride none
Options none
Order allow, deny
Allow from all
</Directory>

At least with my Apache 1.3, this allows me to run a cgi program.
 
  


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
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 10:30 PM
Apache Web Server and CGI scripts jonty_11 Red Hat 2 05-17-2006 01:52 PM
CGI File Not Executing on Apache Server kaplan71 Linux - Software 2 10-21-2004 07:12 AM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 06:21 AM
how do i set up my web server to use the Cgi-bin rhuser Linux - Software 2 02-22-2003 09:26 PM

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

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

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