Answers.Body: <p>If the <code>craftcms</code> folder is more or less the <a href="https://docs.craftcms.com/v3/directory-structure.html" rel="nofollow noreferrer">out-of-the-box Craft 3 installation</a>, you should be able to just point your <code>Directory</code> blocks and <code>DocumentRoot</code> at <code>/var/www/html/craftcms/web</code>!</p>
  
  <p>Only the <code>web</code> folder is intended to be public—everything else should be hidden, above the web root—think of it as sandboxing access to just one folder of your application.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-08T20:05:49.237Z
Answers.LastActivityDate: 2019-04-08T20:05:49.237Z
Answers.UserDisplayName: August Miller
Body: <p>I am new to Craft CMS and am struggling with what and how to get the correct files in the right places. I started out with a LAMP stack on a Ubuntu 18.04 Digital Ocean droplet and proceeded with the Craft CMS setup. Currently I get a 404 ERROR stating "The requested URL /index.php was not found on this server".</p>
  
  <p>Where should I put it? Does this answer help and still work in this case : <a href="https://stackoverflow.com/questions/5891802/how-do-i-change-the-root-directory-of-an-apache-server/23175981#23175981">https://stackoverflow.com/questions/5891802/how-do-i-change-the-root-directory-of-an-apache-server/23175981#23175981</a>?</p>
  
  <p>My VH file:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
       ServerAdmin admin@example.com
       DocumentRoot /var/www/html/craftcms
       ServerName example.com
       ServerAlias www.example.com
  
       &lt;Directory /var/www/html/craftcms/&gt;
            Options FollowSymlinks
            AllowOverride All
            Require all granted
       &lt;/Directory&gt;
  
       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog ${APACHE_LOG_DIR}/access.log combined
  
       &lt;Directory /var/www/html/craftcms/&gt;
              RewriteEngine on
              RewriteBase /
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteRule ^(.*) index.php [PT,L]
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
Tags: <craft3><apache>
Title: Craft 3 vs Apache directory structure
ThreadText: # Craft 3 vs Apache directory structure
  
  (Asked by: username_0 on 2019-04-08)
  
  I am new to Craft CMS and am struggling with what and how to get the correct files in the right places. I started out with a LAMP stack on a Ubuntu 18.04 Digital Ocean droplet and proceeded with the Craft CMS setup. Currently I get a 404 ERROR stating "The requested URL /index.php was not found on this server".
  
  Where should I put it? Does this answer help and still work in this case : <https://stackoverflow.com/questions/5891802/how-do-i-change-the-root-directory-of-an-apache-server/23175981#23175981>?
  
  My VH file:
  
  ```
  <VirtualHost *:80>
       ServerAdmin admin@example.com
       DocumentRoot /var/www/html/craftcms
       ServerName example.com
       ServerAlias www.example.com
  
       <Directory /var/www/html/craftcms/>
            Options FollowSymlinks
            AllowOverride All
            Require all granted
       </Directory>
  
       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog ${APACHE_LOG_DIR}/access.log combined
  
       <Directory /var/www/html/craftcms/>
              RewriteEngine on
              RewriteBase /
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteRule ^(.*) index.php [PT,L]
      </Directory>
  </VirtualHost>
  
  ```
  
  **Tags:** craft3, apache
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-04-08. Score: 1 | Accepted answer
  
  If the `craftcms` folder is more or less the [out-of-the-box Craft 3 installation](https://docs.craftcms.com/v3/directory-structure.html), you should be able to just point your `Directory` blocks and `DocumentRoot` at `/var/www/html/craftcms/web`!
  
  Only the `web` folder is intended to be public—everything else should be hidden, above the web root—think of it as sandboxing access to just one folder of your application.
  
  
  ---
  
  