Changing Document Root in Server Settings

Discussion in 'Installation/Configuration' started by rbartz, May 4, 2006.

  1. rbartz

    rbartz Member HowtoForge Supporter

    We need to use suExec for several reasons.

    I am trying to decide whether to

    1. recompile apache and suexec to use /home/www as the document root so that PHP and CGI can do their thing more conveniently.

    2. change the document root in ispConfig to /var/www.

    A couple of considerations:

    A. Four sites are already installed in /home/www. If I change the Document Root in ispConfig Server Settings, can the directories of these existing sites then simply be moved, or do I need to reinstall all of the sites and users again?

    B. Is it right to assume that the normal (somtimes automatic --- YUM!) updating processes for apache, ispconfig, and suexec would reset the document root directory in suexec back to /var/www. I do not want to create a situation where an update can cripple the server....

    What do you recommend?

    Thank you guys for your help. I REALLY wish I would have understood the last part of the "Perfect Setup" where it told about using suexec and the need for putting things in /var/www instead of the default /home/www.

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I recommend 1).

    A) Yes. And dont forget to set the new webroot in ISPConfig under management > server > settings.
    B) Yes, if you run Yum to update your system, it might replace your httpd with a version with /var/www webroot. Thats why i recommend solution 1).
  3. rbartz

    rbartz Member HowtoForge Supporter

    Thank you Till

    Just to clarify my thinking, you are recommending I change the Document Root in ispConfig to /var/www so the virtual hosts can execute stuff using suexec.

    Question... will the user and group settings on the server and all data in the database be updated when I change the setting in Management >Server > Settings?

    Or do I need to backup everything, then delete the existing sites with user accounts, and then recreate the sites and user accounts again after the change of doc root?

    Thanks again,

    Last edited: May 4, 2006
  4. falko

    falko Super Moderator ISPConfig Developer

    You must change something in the web interface for all the users and web sites so that ISPConfig rewrites all the configurations. Afterwards, you can undo these changes.

    If you are on SuSE, the suExec document root is /srv/www, on all other distros it's /var/www.
  5. icmono

    icmono New Member

    FYI: in Debian/ubuntu you can find apache2-suexec-custom which you can configure to use any docroot you need. I think you can even specify seperate docroot per user.

Share This Page