Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. Is it possible to give PHP apps precedence over HTML pages?

Is it possible to give PHP apps precedence over HTML pages?

Scheduled Pinned Locked Moved Solved LAMP
4 Posts 2 Posters 817 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dfoy
    wrote on last edited by
    #1

    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).

    girishG 2 Replies Last reply
    0
    • D dfoy

      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).

      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      @dfoy Is this with the LAMP app on Cloudron (or some other app) ?

      1 Reply Last reply
      0
      • D dfoy

        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).

        girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #3

        @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.

        D 1 Reply Last reply
        3
        • girishG girish

          @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.

          D Offline
          D Offline
          dfoy
          wrote on last edited by
          #4

          @girish Thanks!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Bookmarks
          • Search