Change Web directory

Discussion in 'Installation/Configuration' started by 0x3D, Feb 5, 2012.

  1. 0x3D

    0x3D New Member


    i have Ubuntu Server 11.10 with ISPConfig 3.

    i want to change Web basedirectory to /media/hdd0. I changed from ISPConfig->Settings but can't access site's hosted in /media/hdd0, i view a 403 error (don't have to access this resource).

    I searched on the internet but don't found a solution, i found only a post on this forum where author write that must use suEXEC.

    please help me to move /var/www (and subfolders from ISPConfig) to /media/hdd0.

    sorry for my english.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Stop apache and make a backup of the contents of the /var/www folder.
    2) remount /media/hdd0 as /var/www in /etc/fstab
    3) Copy back the content to /var/www
    4) Undo the path changes that you did in ispconfig and then start apache.
  3. grandslamjmh

    grandslamjmh New Member

    Whats the full steps how to do that?
  4. falko

    falko Super Moderator ISPConfig Developer

    Use the mv command to move all contents away from the /var/www directory (/var/www must be empty afterwards).

    Edit /etc/fstab and mount your device to /var/www instead of /media/hdd0. Run
    mount -a
    afterwards and check that the device got mounted to /var/www by running
    Use the cp or mv command to copy your backup back to /var/www.
    Apache can be restarted as follows:
    /etc/init.d/apache2 restart
  5. grandslamjmh

    grandslamjmh New Member

    hey thanks for the post.

    isn't this kinda the same thing. Here is what i did.

    mv /var/www /path/to/my/folder
    then made a symlink:

    ln -s /my/path/www /var/www
  6. falko

    falko Super Moderator ISPConfig Developer

    You might get problems if you use suExec. suExec doesn't accept symlinks.
  7. grandslamjmh

    grandslamjmh New Member

    oh? well i guess ill go back to your post and see if i cant figure it out.

    I doubt ill be using suExec anyways though.
  8. grandslamjmh

    grandslamjmh New Member

    Are these the exact commands or could you post them please?

    so like do this?:
    add this line in /etc/fstab[CODE]/dev/mapper/vg_main00-LogVol00 /var/www ext4 defaults 0 0
    Then run the code
    mount -a
    then copy everything back and restart httpd
    Last edited: Feb 11, 2012
  9. falko

    falko Super Moderator ISPConfig Developer

    I didn't test, but they should work. If you are unsure, set up a test machine first.
  10. grandslamjmh

    grandslamjmh New Member

    havent seen any probs yet.

Share This Page