AD0-E717 practice question 7 of 15
Which Magento project directory is the recommended webroot for the web server?
Full set: 77 questionsThe pub/ directory is the only directory designed to be publicly accessible from a web browser. It serves as the web server's document root (webroot) for security and performance reasons. This directory contains the application entry point (index.php) and all publicly accessible static assets like CSS, JavaScript, and images. Setting the webroot to pub/ prevents direct URL access to sensitive application code, configuration files, and directories like app/, vendor/, and var/, which is a critical security best practice for Magento.
B. app/: This directory contains sensitive application code and configuration files (e.g., app/etc/env.php with database credentials). Exposing it as the webroot would create a severe security vulnerability.
C. bin/: This directory contains the Magento command-line interface (CLI) executable. It is not intended for web access and does not contain the necessary files to serve the application via a browser.
1. Adobe Commerce Developer Documentation, "Apache web server": In the sample virtual host configuration, the DocumentRoot directive is explicitly set to the pub directory. The documentation states, "In the following example, the Magento installation directory is /var/www/html/magento2, and the DocumentRoot is set to the /var/www/html/magento2/pub directory."
Source: Adobe Experience League > Commerce Developer > Installation Guide > Set up the web server > Apache.
2. Adobe Commerce Developer Documentation, "Magento file system overview": This document describes the purpose of the top-level directories. For the pub directory, it states, "The publicly accessible files. The document root for the web server should be set to this directory."
Source: Adobe Experience League > Commerce Developer > Fundamentals > Magento file system overview.
3. Adobe Commerce Developer Documentation, "Nginx web server": Similar to the Apache documentation, the sample Nginx configuration file sets the webroot to the pub directory. The directive root /pub; is used to define the document root.
Source: Adobe Experience League > Commerce Developer > Installation Guide > Set up the web server > Nginx.
Keep practicing
Take the free AD0-E717 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other AD0-E717 practice questions
- Question 1A developer is creating a class \Vendor\Module\Model\MyModeL How should that class be def…
- Question 2What is one purpose of a customer data JS library?
- Question 3What folder would a developer place a custom patch on an Adobe Commerce Cloud project to …
- Question 4What action can be performed from the Cloud Project Portal (Onboarding Ul) of an Adobe Co…
- Question 5What database engine is part of the infrastructure of Adobe Commerce Cloud projects?
- Question 6What is the default store ID for the admin panel?
