LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing document root for Apache httpd (https://www.linuxquestions.org/questions/linux-newbie-8/changing-document-root-for-apache-httpd-4175563326/)

AdultFoundry 01-07-2016 11:44 AM

Changing document root for Apache httpd
 
Default DocumentRoot is:

/var/www/html

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

I figured that I will change the DocumentRoot to:

/home/www/html

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

Thanks.

### Edit:

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

ButterflyMelissa 01-07-2016 02:54 PM

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...
Melissa

AdultFoundry 01-07-2016 03:10 PM

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.


All times are GMT -5. The time now is 11:11 AM.