On Thursday, Jan 8, 2004, at 19:37 US/Central, Bill Hults wrote:

James A Baker wrote:

More specifically, I think it's probably that Alias directive he listed. You typically don't want to Alias *anything* inside a cgi-bin directory unless 100% certain there's no chance of it needing to be executed as a CGI... which in this case is actually the opposite of what you are 100% sure of, since the sqwebmail binary *has* to be run as a CGI.

-jab


P.S. If what you were trying to do was make the whole domain contain just the sqwebmail CGI service... then probably what you want is something more like this:


ScriptAlias / "/var/www/cgi-bin/"

That should make every URL reference files within your CGI directory, and not show anything outside of it. If that's actually what you want to do, then you should probably just set your DocumentRoot to be the same path, and forget having any HTML files.

That is what I want to do. The URL should bring up sqwebmail & that's it.
If I understand you correctly when I do this -
DocumentRoot /var/www/cgi-bin
ServerName webmail.vssg.com
ScriptAlias / "/var/www/cgi-bin/"
I get -



Forbidden


You don't have permission to access / on this server
Changing permissions so that the httpd user owns the directory doesn't fix the problem.
Am I understanding you correctly?
Thanks for your help



Yes, that's what I was thinking. Permissions can be a problem, but more likely is that you don't have auto-indexing turned on... as is typical of most cgi-bin locales. And of course, I haven't set up one quite like that myself in a while, so I could be forgetting a piece... but I think all you should have to do is one of the following:


A) allow directory listings in that directory [via a <Directory> block with the "Options Indexes" setting] -- but that allows people to see any other CGI's that exist in your cgi-bin tree, which could be considered a security risk. (In fact, I would consider it one. ;) -- And people would still have to click on sqwebmail in the index listing if you choose this. [So it's not great for a number of reasons.]

...or...

B) Define a DirectoryIndex script (intro script to take the place of an index.html file) -- such as setting "DirectoryIndex welcome.cgi" in the appropriate Directory block, and then installing welcome.cgi so that it generates a welcome page, or a redirect to the sqwebmail binary ... Or simply setting sqwebmail to *BE* the DirectoryIndex value.

...or...

C) If you really know what you're doing, you might find a good way to set up a redirect or mod_rewrite rule for the "/" path that forwards people to the sqwebmail URL automatically... *AND* doesn't recursively catch itself building an ever longer, infinitely looping, path request... but that might be impossible without using 2 domain names -- I'm not entirely sure.

...or... possibly something else I can't think of right away. ;-) But...

My suggestion is probably to go with choice B, option 2. So try something like this:

--%<-----%<-----
DocumentRoot /var/www/cgi-bin
ServerName webmail.vssg.com
ScriptAlias / "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
        DirectoryIndex sqwebmail
</Directory>
-----%<---%<----

I *believe* that something very close to that setup will do what you want... though I haven't tested it personally yet. So it may need slight tweaking still.

-jab



Reply via email to