[lug] cgi-bin Apache

John Starkey jstarkey at advancecreations.com
Sun Dec 10 10:54:56 MST 2000


Some of the things I told you were wrong. 1) I never finished setting up
~user/cgi-bin and 2) ScriptAlias. All the accounts I host have domains. I
have a couple regular users but they aren't doing the web.

I did start to set it up (~user/cgi-bin) just now and here's what I came
up with. www.apache.org/docs/howto/cgi.html is what I'm using, as well as
Apache Unleashed, which only covers the server cgi-bin as far as I can
tell.

I have Apache pointing to the correct dir by adding AllowOverride Options
(in the main server config section) and in a /home/*/cgi-bin Directory
container, within the mod_userdir section we discussed, I added Options
+ExecCGI.

I'm recieving "Internal Server Error" messages. According to error_log
it's being caused by a "premature end of script" but the script is working
in my other cgi-bins. So I think it's an suExec problem. Regardless it is
pointing to that file and not showing the script so it is trying to
execute the file.

Sorry about the inconvenience, I hope this may help a little more better
:}. I'm gonna try to get back to it later this week. If I get it working
I'll let you know. 

BTW, everything I did is located in the Apache link above.

John



On Sun, 10 Dec 2000, D. Stimits wrote:

> John Starkey wrote:
> > 
> > Check out the mod_userdir section of httpd.conf. You'll need to add
> > ExecCGI to the Options in the Directory container and I *think* everything
> 
> I found:
> LoadModule userdir_module     modules/mod_userdir.so
> AddModule mod_userdir.c
> <Directory "/home/httpd/cgi-bin">
>     AllowOverride None
>     Options ExecCGI
>     Order allow,deny
>     Allow from all
> </Directory>
> 
> > is smooth from there, ScriptAlias should be ok, I think, if you already
> 
> ScriptAlias does work with /home/httpd/cgi-bin/. I've added a package
> that only partially does what I want: cgi-wrap. It allows individual
> users to have cgi-bin directories specific to them, but it is somewhat
> clumsy in use (functionality is good). The current ScriptAlias line just
> points there:
> ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"
> 
> Is it possible for ScriptAlias to be given some sort of pattern matching
> so it will allow on ~someuser/cgi-bin/ to recognize it and do some
> relative path? E.G:
> ScriptAlias ~.*[/]cgi-bin[/]  ~/cgi-bin/
> 
> (scenario borrows from regular expressions)
> 
> > have it working with ServerRoot. It's been a couple months since I
> > config'd ~user/cgi-bin though. And that was my first.
> > 
> > This will atleast get you started.
> 
> Still I can't get http://localhost/~user/cgi-bin/myscript.cgi to run;
> logs show I have permissions and all, but it lists the contents instead
> of executing (they are chmod to exec). I figure I'll have to pick up an
> Apache config book soon. From what I found, I may not be able to give an
> individual user quite what I want without creating virtual domains for
> each one (thus giving the domain its own cgi-bin as a whole instead of
> per-user).
> 
> > 
> > On Sat, 9 Dec 2000, D. Stimits wrote:
> > 
> > > I'm trying to set up a local linux machine to work similar to a Solaris
> > > account I have (it uses Zeus, similar to the linux Apache). Right now
> > > the linux box has a cgi-bin directory that works for the
> > > http://localhost, but what I need is an individual per-user cgi-bin
> > > directory. On the solaris account, for security reasons (which I tend to
> > > agree with), cgi is allowed to execute only if it is in ~/cgi-bin/. For
> > > the linux box, I'd like to mirror this on an individual per-user basis.
> > > So I can use http://localhost/~someuser/myapp.cgi, and it will know to
> > > search the cgi-bin directory of only that user. Is this a simple
> > > configuration setup for Apache? I'd like to see any reference to a .cgi
> > > file refused if it is not in the ~someuser/cgi-bin/ directory.
> > >
> > > D. Stimits, stimits at idcomm.com
> > >
> > > _______________________________________________
> > > Web Page:  http://lug.boulder.co.us
> > > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > >
> > 
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 





More information about the LUG mailing list