title: Linux webserver: it is really possible to use another directory for DocumentRoot?
body: <p>I'm currently installing a linux webserver for software repositories. So, for testing it, i've change the config file as minimum. Configure permissions on this directory and enable SELinux on it too.
  Because i have a dedicated directory, i don't need and don't want to use <code>/var/www</code>.</p>
  <p>Here're my portion of config file in <code>/etc/httpd/conf/httpd.conf</code>:</p>
  <pre><code>[…]
  DocumentRoot &quot;/&lt;new_dir&gt;&quot;
   
  &lt;Directory &quot;/&lt;new_dir&gt;&quot;&gt;
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
  &lt;/Directory &quot;/&lt;new_dir&gt;&quot;&gt;
  […]
  </code></pre>
  <p>SELinux configuration:</p>
  <pre><code>semanage fcontext -a -t system_u:object_r:httpd_sys_rw_content_t &quot;/&lt;new_dir&gt;(/.*)?&quot;
  </code></pre>
  <p>Add ACL for apache to be sure that it is running:</p>
  <pre><code>setfacl -m u:apache:rw /&lt;new_dir&gt;
  </code></pre>
  <p>Then... restart the service: <code>systemctl restart httpd</code> without error.</p>
  <p>In my directory &lt;new_dir&gt;, I'v only repositories files, not index.html file.</p>
  <p>When I'm tried to get info, I received content of an index file (but I don't know where it comes from):</p>
  <pre><code># curl  http://localhost:80 or (http://localhost)
  &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 3.2 Final//EN&quot;&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Index of /&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Index of /&lt;/h1&gt;
  &lt;ul&gt;&lt;/ul&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  <p>And when I tried a directory of repository it, this error appears:</p>
  <pre><code># curl  http://localhost:80/mysql or (http://localhost/mysql)
  &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0//EN&quot;&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;301 Moved Permanently&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;Moved Permanently&lt;/h1&gt;
  &lt;p&gt;The document has moved &lt;a href= http://localhost/mysql/&gt;here&lt;/a&gt;.&lt;/p&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  <p>I really don't understand where could be the issue...
  As far as I know, it is possible to change the default DocumentRoot directory for httpd or isn't it?
  No SSL, no virtual host, no special specification just another directory as DocumentRoot.</p>
  <p>As anyone an idea, where or what could be the problem?</p>
  <p>Thanks in advance and best regards, H.</p>