From aa2adb933833c7fb7b67b3d0413cfe377b7cb61c Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Mon, 26 Nov 2018 04:59:24 -0500 Subject: [PATCH] Add DocumentRoot location (#22799) --- guide/english/apache/index.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/guide/english/apache/index.md b/guide/english/apache/index.md index 7d3b76f2b6..75802e8b10 100644 --- a/guide/english/apache/index.md +++ b/guide/english/apache/index.md @@ -21,3 +21,31 @@ sudo yum install httpd ``` pacman -S apache ``` + +### Getting Started +Once you have Apache installed you need to know where to put your HTML documents. This location is generally referred to as the `DocumentRoot`. This location is usually `/var/www/html` on most Linux systems. Follow the instructions below to find the configuration file for Apache and the `DocumentRoot`. + +#### Command +``` +~$ sudo grep "DocumentRoot" -R /etc/ +``` + +The `-R` flag will cause grep to search recursively through the `/etc` directory and print out the full path of the file that it finds the `DocumentRoot` keyword in. + +#### Ubuntu output +``` +/etc/apache2/sites-available/000-default.conf: DocumentRoot /var/www/html +/etc/apache2/sites-available/default-ssl.conf: DocumentRoot /var/www/html +/etc/apache2/sites-enabled/000-default.conf: DocumentRoot /var/www/html +``` + +#### Centos output +``` +/etc/httpd/conf/httpd.conf DocumentRoot /var/www/html +``` + +#### References +- Installation and Configurations guides + - [Ubuntu](https://tutorials.ubuntu.com/tutorial/install-and-configure-apache#2) + - [CentOS](https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-apache-config-ui.html) + - [Arch Linux](https://wiki.archlinux.org/index.php/Apache_HTTP_Server)