Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging Apache's default page to PHP
    text
    copied!<p>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:</p> <pre><code>&lt;LocationMatch "^/+$"&gt; Options -Indexes ErrorDocument 403 /error/noindex.html &lt;/LocationMatch&gt; </code></pre> <p>To </p> <pre><code>&lt;LocationMatch "^/+$"&gt; Options -Indexes ErrorDocument 403 /error/noindex.php &lt;/LocationMatch&gt; </code></pre> <p>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. </p> <p>The noindex.html file works fine and is set as root as well. </p> <p>I know an alternative is to use a skeleton directory, but I don't want to go that route. </p> <p>Does anyone have any ideas how I would accomplish this? </p> <p>Thanks.</p> <p>EDIT:</p> <p>Error I get in suPHP: UID of script "/var/www/error/noindex.php" is smaller than min_uid</p> <p>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</p> <p>EDIT 2:</p> <p>Make the file 400 or 660 and user ID 501 (lxlabs), I now get the error:</p> <p>Mismatch between target UID (1060) and UID (501) of file "/var/www/error/noindex.php"</p> <p>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.</p> <p>EDIT 3:</p> <p>This may help as well. I was able to set the suPHP details in the Virtualhost declarating. Like: </p> <pre><code>&lt;Virtualhost 123.456.78.90:8888&gt; 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/ &lt;Ifmodule mod_suphp.c&gt; SuPhp_UserGroup lxlabs lxlabs &lt;/Ifmodule&gt; &lt;/Virtualhost&gt; </code></pre> <p>Perhaps I can do something similar in the welcome.conf file?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload