Suexec Questions


#1

I read up at Apache but I’m still a newbie at this. I have a Perl script that needs to be able to write to a directory. I hope I’m mistaken, but reading about Suexec on Dreamhost’s wiki makes me believe that this is not possible.

Essentially what the script does is that the user fills out a form and hits the “Submit” button. The contents of the form are then stored in a local file. The instructions on the script read: “This location will need to be capable of having information written to it by the web script.”

I believe I can put the script in a different directory than the file that gets written. Is that the way around this issue? I’ve tried running the script but I get a 500 error, and also a 404 error.

Thanks so much for your help!

Onwards,

Matt


#2

You’re mistaken. The wiki is just saying that since suexec runs the CGI file as the user specified for the domain, it makes sure that nobody else but that user could change the CGI file contents or have created the CGI file.

But you’re talking about a CGI program writing to a directory. This only concerns suexec if it failed to do its job of switching users. Out of several years I’ve only had that happen once. The CGI program still ran but it ran under the user ‘dhapache’ and thus the CGI program itself encountered errors.

It is wise to store data files and library (source code) files outside the web directory, eg /home/username/data and /home/username/lib. The least you can do is disable the public read permission on these files - if ‘dhapache’ can’t read the file it can’t serve it.

You don’t know what the issue is yet. Internal Server Error messages are intentionally vague. The reason the error is occuring should be recorded in the error.log file for the domain.

As for the 404 error, thats because you don’t have an internal_error.html file in the your web directory. See Creating custom error pages

:cool: [color=#6600CC]Atropos[/color] | openvein.org


#3

Wow, hey, thanks. It’s going to take a while to absorb all that. Thank you!

Onwards,

Matt