LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-18-2005, 02:33 AM   #1
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 45
Apache named virtual host config


I have a domain with a home directory where cgi scripts work fine as in
domain/~user/cgi-bin/script.py


But when I set up a named virtual host in Apache2 config, php and html displays fine. The DocumentRoot is
/home/user/public_html
When i open
domain/cgi-bin/script.py
Firefox asks what program I want to open py file with.

I've tried different configs in the virtual host section of the apache config file.
 
Old 04-18-2005, 02:36 AM   #2
xedios
Member
 
Registered: May 2004
Location: SLO
Distribution: RH9
Posts: 70

Rep: Reputation: 15
Do you have a script alias configured
?
 
Old 04-18-2005, 02:44 AM   #3
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Original Poster
Rep: Reputation: 45
<VirtualHost *>
ServerName codingzone.dyndns.org
DocumentRoot /home/codingzone/public_html/
ScriptAlias /cgi-bin/ /home/codingzone/public_html/cgi-bin/
<Directory /cgi-bin/>
Options ExecCGI
SetHandler cgi-script
AddHandler cg-script .cgi .py .pl
</Directory>
</VirtualHost>

I did try different options with different variables. So far I'm banging my head against the wall

Last edited by darthtux; 04-18-2005 at 02:49 AM.
 
Old 04-18-2005, 04:32 AM   #4
xedios
Member
 
Registered: May 2004
Location: SLO
Distribution: RH9
Posts: 70

Rep: Reputation: 15
<VirtualHost *>
ServerName codingzone.dyndns.org
DocumentRoot /home/codingzone/public_html/
ScriptAlias /cgi-bin/ /home/codingzone/public_html/cgi-bin/
<Directory /cgi-bin/>
Options +ExecCGI # changed added +
SetHandler cgi-script
AddHandler cgi-script .cgi .py .pl # changed added cgi-script (yu had cg-script)
</Directory>
</VirtualHost>

Try this mybi it wil work


something else

do you have in global httpd.conf <Directory> configurationa than don't permit execution of cgi scripts??
ig you ar locket to an specific dir
if so try remove it

http://httpd.apache.org/docs-2.0/howto/cgi.html

Last edited by xedios; 04-18-2005 at 04:41 AM.
 
Old 04-18-2005, 04:44 AM   #5
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Original Poster
Rep: Reputation: 45
Thanks for responding,

Put in your code and still no luck. Here is all the cgi info from the main virtual host

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
and
<Directory /home/*/public_html/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory>

jamesallen.dyndns.org:3000/~codingzone/cgi-bin/upload.py works
codingzone.dyndns.org:3000/cgi-bin/upload.py doesn't
 
Old 04-18-2005, 04:47 AM   #6
xedios
Member
 
Registered: May 2004
Location: SLO
Distribution: RH9
Posts: 70

Rep: Reputation: 15
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

<Directory "/usr/lib/cgi-bin"> # <Directory /usr/lib/cgi-bin> ?? whay "??

AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
and
<Directory /home/*/public_html/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory>

jamesallen.dyndns.org:3000/~codingzone/cgi-bin/upload.py works
codingzone.dyndns.org:3000/cgi-bin/upload.py doesn't
 
Old 04-18-2005, 04:56 AM   #7
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Original Poster
Rep: Reputation: 45
I'm not sure what your saying here. The scripts in /usr/lib/cgi-bin work for my main site as /cgi-bin
 
Old 04-18-2005, 07:29 AM   #8
xedios
Member
 
Registered: May 2004
Location: SLO
Distribution: RH9
Posts: 70

Rep: Reputation: 15
<Directory /home/*/public_html/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory>

// Try like this this works for me
<Directory /home/*/public_html/cgi-bin/>
Options +ExecCGI
AddHandler cgi-script .cgi
</Directory>


and something else what about permissions
what is in log file ?
 
Old 04-19-2005, 02:38 AM   #9
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Original Poster
Rep: Reputation: 45
I added:
AddHandler mod_python .py
to my VirtualHost <Directory /cgi-bin/> section and now it is humming along
 
  


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
apache 2 named virtual servers : server path djbar Linux - Networking 0 03-21-2004 10:05 AM
Trouble with Named based Virtual hosting in Apache 2 IanChristie Linux - Networking 16 11-07-2003 02:04 PM
Apache: Virtual Host Config question rajanr Linux - Software 5 08-30-2003 12:41 PM
Virtual Host type, named or IP via SSL? Named VH is not possible? piratebiter Linux - Security 3 08-20-2003 05:27 PM
Virtual host config won't work klintonray Linux - Networking 18 08-19-2003 02:53 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration