Can you change the default httpd directory location?

Discussion in 'Apache' started by z0diacx, Apr 4, 2009.

  1. #1
    I've got 2 drives.

    Drive 1 is at 95% capacity.

    Currently all web sites are in /var/www/vhosts/<domain>/httpdocs/

    Is it possible to move an entire directory (web site) over to my 2nd drive ?

    (I'm using Linux, and Plesk with latest control panel version)
     
    z0diacx, Apr 4, 2009 IP
  2. lookzovt

    lookzovt Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think the easiest way is to make symbolic link (by ln -s).
     
    lookzovt, Apr 5, 2009 IP
  3. z0diacx

    z0diacx Guest

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yah that's what my tech guy just said. He said it's not like IIS on Windows Server where you just have a nice little box you can type in the default root directory of each web site, and can put them anywhere. So we'll have to go the symbolic link route.

    Thanks!
     
    z0diacx, Apr 5, 2009 IP
  4. sandeeppai

    sandeeppai Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Creating symlinks for this purpose is not a good practice, I would suggest you to stop the webserver, mount the partition to the folder you have created, copy the existing files to the new location, and change the document root.

    Thanks
     
    sandeeppai, Apr 8, 2009 IP
  5. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #5
    May I know the drawbacks ?

    cPanel is also creating symlink when you move domain from one partition to another.

    Kailash
     
    kailash, Apr 13, 2009 IP
  6. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #6
    It's slow and creates a lot of unnecessary and complicated actions for the OS.

    You can change the location in your httpd.conf file. Check the top commented lines and see if it requires you to distill the file after making manual changes.

    Also, find the largest files on the drive. It's not uncommon to find massive backups or log files that can simply me moved or deleted.

    Whatever you do make sure you understand the security and operational changes that this will do. Control panels like plesk or cpanel don't always like it when you change root directories to different frives. Also, make sure you understand the proper ownership and permissions that everything needs to be on the new drive.
     
    jestep, Apr 14, 2009 IP
  7. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #7
    Thanks for the info. I was not aware about this.

    Kailash
     
    kailash, Apr 14, 2009 IP