When setting up a vhost and choosing a DocumentRoot
can I set it to a folder outside /var/www
e.g. var/www2
or do I have to stay inside e.g. /var/www/site2
?
System: Ubuntu / Apache2
You can set it to whatever directory you want, for example:
DocumentRoot /home/web/www
and dont forget to add directory settings like:
<Directory "/home/web/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
----Edited----
If you are running single site I would suggest you to add that user/group (in this case user web)
User web
Group web
to
/etc/apache.conf
if you are running multiple sites create a new group and add those users to that group, in /etc/apache.conf add
Group your-new-group
I hope this helps
/home/web/www
belong to www-data
?