LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache named virtual host config (https://www.linuxquestions.org/questions/linux-software-2/apache-named-virtual-host-config-314394/)

darthtux 04-18-2005 02:33 AM

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.

xedios 04-18-2005 02:36 AM

Do you have a script alias configured
?

darthtux 04-18-2005 02:44 AM

<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 ;)

xedios 04-18-2005 04:32 AM

<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

darthtux 04-18-2005 04:44 AM

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

xedios 04-18-2005 04:47 AM

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

darthtux 04-18-2005 04:56 AM

I'm not sure what your saying here. The scripts in /usr/lib/cgi-bin work for my main site as /cgi-bin

xedios 04-18-2005 07:29 AM

<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 ?

darthtux 04-19-2005 02:38 AM

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


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