Results 1 to 8 of 8

Thread: Apache2 Document Root

  1. #1
    Join Date
    Sep 2012
    Beans
    7

    Apache2 Document Root

    Hi,

    some months ago, I changed the apache2 Document Root from /var/www to /home/myname/folder .

    Now, I want it back to /var/www , but I don't remember how I changed it.

    I've tried adding
    DocumentRoot /var/www
    in /etc/apache2/apache2.conf and changing DocumentRoot to /var/www in /etc/apache2/sites-available/default , without success.

    /etc/apache2/httpd.conf is a blank file and there is no /etc/apache2/sites-enabled/default

    I also searched for the string
    /home/myname/folder
    in every file under /etc/apache2/ using grep, and found no occurrences.

    Does anyone know where else can I search for the Document Root directive? I'm using Apache/2.2.22 (Ubuntu) on ubuntu 12.04.1

    Thanks!

  2. #2
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: Apache2 Document Root

    What do you mean by "without success"? Have you restarted Apache?
    「明後日の夕方には帰ってるからね。」


  3. #3
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: Apache2 Document Root

    Quote Originally Posted by mrwebmaster View Post
    I've tried adding in /etc/apache2/apache2.conf and changing DocumentRoot to /var/www in /etc/apache2/sites-available/default , without success.
    Should be:
    Code:
    sudo nano /etc/apache2/sites-enabled/000-default

  4. #4
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: Apache2 Document Root

    Quote Originally Posted by wojox View Post
    Should be:
    Code:
    sudo nano /etc/apache2/sites-enabled/000-default
    which is exactly the same thing because the latter is a symlink to the former.
    「明後日の夕方には帰ってるからね。」


  5. #5
    Join Date
    Sep 2012
    Beans
    7

    Re: Apache2 Document Root

    Thanks for your replies. Yes, I've restarted apache and navigated to http://localhost and to http://127.0.0.1 and the document root is still /home/myname/folder (I've also restarted the computer and tried again).

    Wojox, there is no /etc/apache2/sites-enabled/000-default . But I copied

    /etc/apache2/sites-available/default

    to

    /etc/apache2/sites-enabled/000-default

    and now it's working fine.

    Curiosly, when I delete /etc/apache2/sites-enabled/000-default , Document Root is again /home/myname/folder . So I think this setting must be somewhere else. Anyway, it's working for me now. Thanks for your help!

  6. #6
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: Apache2 Document Root

    /etc/apache2/sites-enabled/000-default as I said is supposed to be a symlink to /etc/apache2/sites-available/default. If it does not exist, copying the file is a bad idea (you introduce a potential discrepancy), and you should create it instead. Remove your file and do

    Code:
    sudo a2ensite default
    「明後日の夕方には帰ってるからね。」


  7. #7
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: Apache2 Document Root

    Quote Originally Posted by Bachstelze View Post
    which is exactly the same thing because the latter is a symlink to the former.
    that's right, a2ensite.

  8. #8
    Join Date
    Sep 2012
    Beans
    7

    Re: Apache2 Document Root

    Thanks, Done

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •