layout | group | subgroup | title | menu_title | menu_node | menu_order | version | github_link | redirect_from |
---|---|---|---|---|---|---|---|---|---|
default |
install2 |
Getting Started |
What is a docroot? |
What is a docroot? |
200 |
2.0 |
install-gde/basics/basics_docroot.md |
/guides/v1.0/install-gde/basics/basics_docroot.html |
The web server document root (often referred to as the docroot) is the web server's root directory; in other words, all pages it delivers are located in this directory and subdirectories of it. The path to your web server's docroot depends on:
- What operating system you're using
- The web server brand and version
- Your hosting provider (if you use one)
This guide can't cover all the possibilities, but we'll help you get started figuring out where your docroot is. It's important; your Magento 2 installation directory is a subdirectory of your web server's docroot so if you don't know where the docroot is, you'll have a lot of trouble doing anything with Magento.
Look at the following sections in the order presented to locate your docroot.
If you use one, contact your hosting provider to locate the web server docroot. For example, cPanel typically uses public_html
as its docroot but don't believe us! Contact your provider directly.
If you don't use a hosting provider, you're not technical, and you're not that familiar with how things are set up, contact your network administrator.
This section is for technical people who don't mind opening a command prompt and finding the docroot themselves.
This section assumes you have a simple web server setup with virtual hosts. An Apache virtual host refers to running more than one web site (such as company1.example.com
and company2.example.com
) on a single machine. A virtual host configuration can override the default docroot. For more information about virtual hosts, see Apache 2.2 or Apache 2.4 documentation.
To find the docroot:
-
Find your web server version:
- Ubuntu:
apache2 -v
- CentOS:
httpd -v
- Ubuntu:
-
See one of the following sections:
-
Open the following file in a text editor:
-
Ubuntu:
/etc/apache2/sites-available/default
-
CentOS:
/etc/httpd/httpd.conf
-
-
Search the file for
DocumentRoot
. A typical result follows:-
Ubuntu:
DocumentRoot /var/www
-
CentOS:
DocumentRoot /var/www/html
-
To find the docroot for Apache 2.4:
-
Open the following file in a text editor:
/etc/apache2/sites-available/default/000-default.conf
-
Search the file for
DocumentRoot
. A typical result follows:DocumentRoot /var/www/html