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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Changing DocumentRoot

    LAMP
    apache
    2
    3
    163
    Loading More Posts
    • 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.
    • girish
      girish Staff last edited by girish

      A popular request with the LAMP is how to change the DocumentRoot.

      The latest package now has the apache configs under /app/data/apache. You can edit the files there and just restart the app.

      For example, to move the PHP directory to say /app/data/public/frontend, edit apache/app.conf like so:

      <VirtualHost *:80>
          DocumentRoot /app/data/public/frontend
      
          ErrorLog "|/bin/cat"
          CustomLog "|/bin/cat" combined
      
          <Directory /app/data/public/frontend>
              Options +FollowSymLinks
              AllowOverride All
              Require all granted
          </Directory>
      
          # Do not remove this include. It's required for your app to see the Real IP
          Include "/app/code/apache/rpaf.conf"
          # This line can be commented out, if you do no require PHPMyAdmin Access
          Include "/app/code/apache/phpmyadmin.conf"
      
      </VirtualHost>
      
      1 Reply Last reply Reply Quote 4
      • girish
        girish Staff last edited by

        cc @andirahmat I recall giving you some complicated htaccess rules for this. It's simpler now.

        A 1 Reply Last reply Reply Quote 1
        • A
          andirahmat @girish last edited by

          @girish Thank you girish

          1 Reply Last reply Reply Quote 0
          • Referenced by  steinhmor steinhmor 
          • First post
            Last post
          Powered by NodeBB