I am looking to change apaches default page for when there are no indexes and getting a 500 error. My server is Linux Red Hat with clients setup using Kloxo and /etc/httpd/conf.d/welcome.conf I am trying 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 gives a 500 error. I assume it has to do with PHP permissions as the file is uploaded as root and the user is specific to an account.
The noindex.html file works fine and is set as root as well.
I know an alternative is to use a skeleton directory, but I don’t want to go that route.
Does anyone have any ideas how I would accomplish this?
Thanks.
EDIT:
Error I get in suPHP:
UID of script “/var/www/error/noindex.php” is smaller than min_uid
If I change permissions to 777, I get the 500 error page, with only this message in logs:
File “/var/www/error/noindex.php” is writeable by others
EDIT 2:
Make the file 400 or 660 and user ID 501 (lxlabs), I now get the error:
Mismatch between target UID (1060) and UID (501) of file “/var/www/error/noindex.php”
I believe lxlabs is supposed to be a regular user, but might not have permissions to that directory. I am not sure how to target the /home/kloxo/httpd/error/noindex.php as the welcome.conf file seems to start in the /var/www directory.
EDIT 3:
This may help as well. I was able to set the suPHP details in 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>
Perhaps I can do something similar in the welcome.conf file?
After lots of testing and researching, it doesn’t appear to be possible to have a global file like this. The best work around is to put a file in the skeleton directory for each user.