Changing apache document root in ubuntu

12 thoughts on “Changing apache document root in ubuntu”

    1.  @nsmgr8 I am using my home directory in a separate partition. If somehow my ubuntu installation gets corrupted, my home directory will be safe and I can install the system without much trouble. So I prefer to move the www directory to home instead a symbolic link :)

      1.  @tareq  Then try the other way around
        sudo rm -rf /var/www; sudo ln -s /home/${USER}/www /var/www
         
        The point is not to touch default settings. Of course, there are thousand other ways to do it.

      2. @tareq
        Then try the other way around
        sudo rm -r /var/www; sudo ln -s /home/${USER}/www /var/www
         
        The point is not to touch default settings. Of course, there are thousand other ways to do it.
         

  1. The symlink (second) way is better imo as it avoids changing config files. You should ad a caveat to your comment though warning people that they are deleting their current doc root and all files within using that method. :)

  2. I actually like changing config files better because that’s a standard process with any other service. I don’t have to try to remember a different method or process. I do it like dns, dhcp, samba, etc – so why deviate from that even if it’s easier via one line change? Stick with a standard and you know where to go always.

Leave a Reply