Author Topic: How do I change a virtual web server Document root?  (Read 4416 times)

thorsten

  • Guest
How do I change a virtual web server Document root?
« on: February 07, 2013, 06:36:53 am »
Hi,

according to Zentyal documentation and my findings, the vhost configuration can be found in

/etc/apache2/sites-available/

for each vhost
When aktived a softlink to this file is placed in

/etc/apache2/sites-enabled

The config files contains one ore two lines (ssl and non ssl) defining the DocumentRoot of the vhost. It is simply the vhost name as defined in the administrative interface. Also there is a Include statement referencing a user configuratioon directory, see documentation:

Quote
The DocumentRoot or root directory for each page is in the /srv/www/<domain>/ directory. In addition, it is possible to apply a customised Apache configuration to each Virtual host by adding a file to the /etc/apache2/sites-available/user-ebox-<domain>/ directory.
,

The config file is concolled by the administrative interface by mysql and the respective mas file as a template, so I can not change it as any change will be revoked earlier or later.

Question:
Does an DocumentRoot statement in a config file "B" called from another config file "A"  overrule the DocumentRule already defined in config file "A"?

If so, a chenge of Document root is quite easy, but how do I proceed if not? Brute force will be to remove the DocumentRoot statement from the master and to add config files manually for each vhost .... No, thats not nice ...

Any help appreciated
THX
Thorsten

mrooks1984

  • Zen Apprentice
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: How do I change a virtual web server Document root?
« Reply #1 on: February 27, 2014, 11:37:32 am »
did you ever find a answer to this, I also want to do this?

christian

  • Guest
Re: How do I change a virtual web server Document root?
« Reply #2 on: February 27, 2014, 11:45:05 am »
Indeed there is no way you can customize this from Zentyal GUI.
Dealing with .mas file is not a good idea either, I do agree.
The way I handle it is that I create symlink so that /srv/www/whatever points to my real folder.