I'm searching to alter apaches default page when ever you will find no indexes and becoming a 500 error. My server is Linux Red-colored Hat with clients setup using Kloxo and /etc/httpd/conf.d/welcome.conf I'm attempting to change:

<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

To

<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.php
</LocationMatch>

Which after httpd restart it provides a 500 error. I suppose it's related to PHP permissions because the file is submitted as root and also the user is specific for an account.

The noindex.html file works fine and it is set as root too.

I understand an alternate is by using a skeleton directory, but I'd rather not go down that path.

Does anybody have ideas the way i would make this happen?

Thanks.

EDIT:

Error I recieve in suPHP: UID of script "/var/www/error/noindex.php" is more compact than min_uid

Basically change permissions to 777, I recieve the 500 error page, with only this message in logs: File "/var/www/error/noindex.php" is writeable by others

EDIT 2:

Result in the file 400 or 660 and user ID 501 (lxlabs), Now i obtain the error:

Mismatch between target UID (1060) and UID (501) of file "/var/www/error/noindex.php"

In my opinion lxlabs should be a normal user, but might possibly not have permissions to that particular directory. I don't know how you can concentrate on the /home/kloxo/httpd/error/noindex.php because the welcome.conf file appears to begin within the /var/www directory.

EDIT 3:

This might help too. I could set the suPHP particulars within the Virtualhost declarating. Like:

<Virtualhost 123.456.78.90:8888>
SSLEngine On 
SSLCertificateFile /home/kloxo/httpd/ssl/eth0___localhost.crt
SSLCertificateKeyFile /home/kloxo/httpd/ssl/eth0___localhost.key
SSLCACertificatefile /home/kloxo/httpd/ssl/eth0___localhost.ca

DocumentRoot   /home/kloxo/httpd/webmail/
<Ifmodule mod_suphp.c>
SuPhp_UserGroup lxlabs lxlabs
</Ifmodule>
</Virtualhost>

Possibly I'm able to make a move similar within the welcome.conf file?

I've not really understood your atmosphere, however the error message appears to become out of this line

You have to check suPHP's configuration file (typically /etc/suphp.conf) and find out what's the need for min_uid (that the default appears to become 100) Adjust the worthiness to meet your requirements.

The answer would be to alter the owner and permissions from the script. The consumer should be an ordinary user. The permissions should be 660 (rw for user and group) or 400 (r for user only). Explanation follows.

You're using suPHP that is an Apache module that attempts to secure PHP scripts by running all of them with restricted permissions. Whenever a script is asked for, suPHP switches to who owns the script before performing it.

For apparent security reasons, suPHP prohibits to operate a script as root. So PHP scripts possessed by root can not be arrived at through Apache. This is exactly what the content UID of script is more compact than min_uid means. suPHP is definitely a little more generic: it prohibits all special customers. Linux keeps the very first user ids for that special customers. Normal customers come with an ID above 500 or 1000 (with respect to the distribution) while root normally has the ID .

suPHP, still for security reasons, will not run scripts that any user can modify. This is actually the concept of the content File is writeable by others. This behavior could be switched of using the config parameter allow_file_others_writeable, however it does not make much sense to utilize a security-oriented module by having an insecure configuration. In the end, the primary reason for suPHP would be to separate the programs which have different file proprietors.

After plenty of testing and researching, it does not seem to be possible to possess a global file such as this. The very best deal with would be to put personal files within the skeleton directory for every user.