title: The right way to change Apache root directory outside /var/www/
body: <p><strong>Intro</strong></p>
  
  <p>I have added a disk to my instance on Google Cloud with the goal to run my website files on this disk. I formatted and mounted the disk following this Google Cloud documentation:
  <a href="https://cloud.google.com/compute/docs/disks/add-persistent-disk" rel="nofollow">https://cloud.google.com/compute/docs/disks/add-persistent-disk</a></p>
  
  <p>After finishing this tutorial you have a directory <code>/mnt/disks/appdata/</code> which is ready to write files to. </p>
  
  <p><strong>What I have tried first</strong></p>
  
  <p>I want to use this directory <code>/mnt/disks/appdata/</code> as root directory, so I added the following lines to my <code>/etc/apache2/sites-available/000-default.conf</code> file. </p>
  
  <pre><code>&lt;Directory /mnt/disks/&gt;
     Options Indexes FollowSymLinks MultiViews
     AllowOverride All
     Order allow,deny
     allow from all
  &lt;/Directory&gt;
  
  ...
  
  DocumentRoot /mnt/disks/appdata
  </code></pre>
  
  <p>But after restarting my apache server and visiting my website I got a 404 error.</p>
  
  <p><strong>How I have fixed the problem, but don't know if it is the right way</strong></p>
  
  <p>To fix this problem I have added the following lines to my <code>/etc/apache2/apache2.conf</code> file.</p>
  
  <pre><code>&lt;Directory /mnt/disks/&gt;
          Options Indexes FollowSymLinks
          AllowOverride None
          Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p>This works, but I don't know if it is the best option to add this lines to the apache2.conf file, because the documentation in the apache2.conf file says:</p>
  
  <blockquote>
    <p>It does not allow access to the root filesystem outside of /usr/share
    and /var/www. The former is used by web applications packaged in
    Debian, the latter may be used for local directories served by the web
    server. If your system is serving content from a sub-directory in /srv
    you must allow access here, or in any related virtual host.</p>
  </blockquote>