-
I have limited experience setting up LAMP, and what I know I learned from DigitalOcean tutorials.
One of their tutorials includes this on editing the DirectoryIndex directive in mods-enabled/dir.conf:/etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>By moving "index.php" to the first position in the DirectoryIndex directive, I can cause index.PHP to run as the default rather than index.HTML.
I realize I can just remove index.HTML if I want index.PHP to be the file that runs, but I wonder, is it possible for me to edit a DirectoryIndex directive somewhere, as per the tutorial?
That would let me keep an index.HTML file on the site as a fallback in case PHP failed (unlikely, but surely possible).
-
@dfoy You can add custom apache configuration in app.conf using the file manager - https://docs.cloudron.io/apps/lamp/#apache-settings . I put the following line in app.conf inside the
VirtualHost
directive:<VirtualHost *:80> ... DirectoryIndex index.cgi index.pl index.php index.xhtml index.htm index.html </VirtualHost>
And then restarted the app. I can confirm that php loads first before the html.