Solved DocumentRoot on apache

What directory do people use on apache for DocumentRoot?

I'm think about various applications such as Wordpress.

Some examples I've seen use /usr/local/www/wordpress others use /usr/local/www/apache24/data/wordpress.

I realise both will work, but wondered which most people used.
 
Don't use /usr/local/www/apache24/data, that's all I can say. It's where Apache's default "It works" website lives, leave that as-is. Same for /usr/local/www/nginx/ with nginx.

I like /usr/local/www/<mywebsite>/, for example /usr/local/www/example.com/, keeps everything nice and separated. It's also independent of the web server being used.
 
In like to put it in /var/www/<website>/ because to me it makes sense to put the data in /var/ as my mail and printer files also live there.
I think, in /var is the classical place.

/usr/local is a FreeBSD custom, because one wants to separate base system from installed packages.

But if you have a small root and not a big system mounted on /var, then is not appropriate.

What directory do people use on apache for DocumentRoot?

Is there a reason you are using apache? See my other thread.
 
I had websites in /srv/www on openSUSE (iirc ftp defaults there too); I like /srv more than /var for serving content
Makes sense but /srv/ is not in hier(7) and I dislike adding more top-level directories. Further more, /var/www/ is shorter than /usr/local/www/ and hier(7) mentions /usr/local/ is for programs installed by pkg(7) and ports(7) which does not include website data in my opinion.
 
Despite the fact that I no longer work with Solaris I still very much prefer using /opt whenever it suits the situation. A local Minecraft server? /opt/minecraft, my jails? /opt/jails and you can probably guess where this is going? ;) I also utilize /opt/www for all my own personal sites while still keeping /usr/local/www around for "defaultish" contents.
 
I think under /home/www would be the right place. Web-Content deserve backup like the data of users.

If you make it a login user, you can directly login to work in it or send files with scp file www@server:place.

Perhaps I implement this idea ...
 
I have been using the default /usr/local/www/ (how do you make the paths green?) for so long now, that my brain is almost like a ROM, and since I moved over to ZFS, it's going to be REALLY difficult to "re-learn" allt the new paths.
 
how do you make the paths green?
 
Back
Top