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. |
Do you have a script alias configured
? |
<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 ;) |
<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 |
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 |
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 |
I'm not sure what your saying here. The scripts in /usr/lib/cgi-bin work for my main site as /cgi-bin
|
<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 ? |
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. |