{"id":210,"date":"2013-06-03T21:52:22","date_gmt":"2013-06-03T21:52:22","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=210"},"modified":"2013-06-03T21:52:22","modified_gmt":"2013-06-03T21:52:22","slug":"how-to-find-apache-document-root","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2013\/06\/03\/how-to-find-apache-document-root\/","title":{"rendered":"How To Find Apache Document Root"},"content":{"rendered":"<p>Apache has DocumentRoot directive.<\/p>\n<p><img decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"http:\/\/i.imgur.com\/CakztZQ.gif\" width=\"80\" height=\"25\" \/><\/p>\n<p>This directive sets the directory from which Apache will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document. Example:<\/p>\n<p><strong>DocumentRoot \/home\/www\/domain.com <\/strong><\/p>\n<p>then an access to http:\/\/www.domain.com\/index.html refers to \/home\/www\/domain.com\/index.html.<\/p>\n<h2>Finding Apache Document Root<\/h2>\n<p>Use grep command as follows:<br \/>\n<code># grep -i 'DocumentRoot' httpd.conf<\/code><br \/>\nRHEL \/ Red hat \/ Fedora \/ CentOS Linux specific command:<br \/>\n<code># grep -i 'DocumentRoot' \/etc\/httpd\/conf\/httpd.conf<\/code><br \/>\nFreeBSD specific command:<br \/>\n<code># grep -i 'DocumentRoot' \/usr\/local\/etc\/apache22\/httpd.conf <\/code><br \/>\nSample output:<\/p>\n<pre># DocumentRoot: The directory out of which you will serve your\nDocumentRoot \"\/usr\/local\/www\/apache22\/data\"<\/pre>\n<p>\/usr\/local\/www\/apache22\/data is default document root for your website.<\/p>\n<p>To modify DocumentRoot use vi command and change DocumentRoot:<br \/>\n<code># vi \/etc\/httpd\/conf\/httpd.conf<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache has DocumentRoot directive. This directive sets the directory from which Apache will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document. Example: DocumentRoot \/home\/www\/domain.com then an access to http:\/\/www.domain.com\/index.html refers to \/home\/www\/domain.com\/index.html. Finding Apache [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[60],"tags":[90],"class_list":["post-210","post","type-post","status-publish","format-standard","hentry","category-linux","tag-how-to-find-apache-document-root"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=210"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/210\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}