Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-07-2016, 11:44 AM   #1
Registered: Jun 2015
Posts: 282

Rep: Reputation: Disabled
Changing document root for Apache httpd

Default DocumentRoot is:


I have a hosting plan, with all of the storage space installed on /home.

I figured that I will change the DocumentRoot to:


Does it make sense, or should I use something else? Why, what would be the implications?


### Edit:

The question would be whether I should just change the DocumentRoot (I already did) or use the Alias directive?

Last edited by AdultFoundry; 01-07-2016 at 12:10 PM.
Old 01-07-2016, 02:54 PM   #2
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,703
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
personally, there is nothing against you doing that, but (personally, again) I'd keep /home and the document root separated...unless you have a solid reason to do this otherwise.
If you talk FTP, then that is different, once logged in via FTP, you "should"....get in your home folder anyway...
Old 01-07-2016, 03:10 PM   #3
Registered: Jun 2015
Posts: 282

Original Poster
Rep: Reputation: Disabled
I already put it there. This is from "Pro Apache, 3rd", Apress:

"Its quite usual for the document root to be moved somewhere else to distance the publicly accessible Web site or Web sites from any sensitive Apache configuration files. This also makes upgrading or replacing the Apache installation simpler. So to specify the default document
root, either of the following will do:

DocumentRoot htdocs
DocumentRoot /usr/local/apache/htdocs

For your server, youre going to place your Web site in its own directory inside a directory called www well outside the server root in /home:

DocumentRoot /home/www/alpha-complex/web

This naming scheme will serve you well if you decide to host multiple Web sites, as you can then add more directories under /home/www."

It is ok to put it there, based on that.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache cant see document root crowx Linux - Newbie 11 02-09-2011 11:21 PM
apache httpd document problem emanresu Linux - Software 2 07-09-2006 05:36 PM
Changing document root in Apache on OpenBSD 3.8 klemen *BSD 2 09-23-2005 02:56 AM
changing permissions of document root and cgi-bin abtimoteo Ubuntu 2 08-13-2005 09:36 AM
Document Root in Apache Hal Linux - Newbie 2 10-28-2003 06:10 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration