Click to See Complete Forum and Search --> : Virtual Hosts and cgi-bin's


VRay
04-15-2002, 05:01 PM
I can run cgi-scripts for my virtual hosts if I use http://myip/~usernameX/cgi-bin/whatever.cgi
How would I configure the virtual hosts to work using http://www.usernamex.com/cgi-bin/whatever.cgi
I just can't get it to work.

Thanks.

johnwebb
04-16-2002, 12:33 AM
You need to put an alias for the cgi-bin in the VirtualHost section.

ScriptAlias /cgi-bin/ /home/usernameX/cgi-bin/

freebsd
04-16-2002, 09:52 AM
Like johnwebb mentioned, you can run cgi scripts within a ScriptAlias'd cgi-bin or you can disable scriptalias and enable Options ExecCGI globally so you can have non-CGI files in/or underneath your cgi-bin directory.
Keep in mind that a ScriptAlias'd cgi-bin has a strict policy. Everything within it is treated as CGI script (even your bg.jpg and .htaccess).
In addition to johnwebb suggestion, you also need to disable UserDir since it's now handled by VirtualHost rather than UserDir.

When you ask "How would I configure the virtual hosts to work using <A HREF="http://www.usernamex.com/cgi-bin/whatever.cgi"," TARGET=_blank>http://www.usernamex.com/cgi-bin/whatever.cgi",</A> are you sure such vhost is working in the first place? If not, just isolate the two different issues.

&gt;&gt; I just can't get it to work

This tells nothing and is extremely unhelpful. You need to stop telling this in any public forums. Instead, here's the info you should have provided:

1) What did you do exactly?
2) What you expect it to do?
3) What did happen?
4) How can you tell it's not working?

VRay
04-17-2002, 04:01 AM
Thanks guys, that did the trick. Hehe, freebsd, getting a little cranky as you got down there? johnweb gave me one solution, you gave me a couple more, I surely couldn't have posted that incoherently!