Thanks, but that's about setting php open basedir as per wiki (useful commands). I'm looking very specifically how to set the document root.
It's in httpd.conf
Note I never knew how to do this and found out by having a grep about for DocumentRoot and looking at the code in some contribs
[root@esmith conf]# grep Document httpd.conf
# Documentation for modules is in "/home/httpd/manual/mod" in HTML format.
# DocumentRoot: The directory out of which you will serve your
DocumentRoot /home/e-smith/files/ibays/Primary/html
DocumentRoot /home/e-smith/files/ibays/crm/html
Set via the httpd.conf templates e.g.
cd /etc/e-smith/templates/etc/httpd/conf/httpd.conf
[root@home httpd.conf]# grep -rn Document *
15DSOstart:14:# Documentation for modules is in "/home/httpd/manual/mod" in HTML format.
50DocRoot:1:# DocumentRoot: The directory out of which you will serve your
50DocRoot:5:DocumentRoot /home/e-smith/files/ibays/Primary/html
VirtualHosts/20IbayContent:15: $OUT .= " DocumentRoot $basedir/html\n";
WebAppVirtualHost/50Content:55: my $root = $domain->prop('DocumentRoot') ||
WebAppVirtualHost/50Content:58: $OUT .= " DocumentRoot $root\n";
Unfortunately it will only point to one of your existing ibays (check $basedir in templates, VirtualHosts/20IbayContent), so if you want to use /opt you need a bit of trickery.
Make your own virtualhost templates (copy over another example) to a new directory. If you used the stock one as a template then you can modify $basedir depending on what you want as a trigger for it.
A good one to use as a base would be the WebAppVirtualHost from Dans contrib - see the template 50Content to see how the DocumentRoot is set.
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost -> VirtualhostTest
Modify templates to give you the config required.
You then need to tell a domain to use that template path to create the required VirtualHost entry in httpd.conf (other config entries removed for clarity):
my.domain.net=domain
Description=my opt domain
TemplatePath=VirtualhostTest
Job done. The only aside is why make life difficult and use /opt ? i know it used to be considered better but as far as I understand it now there is no reason not to just use an ibay.
B. Rgds
John