You are not logged in.

#1 2017-02-10 18:09:10

stefano
Member
Registered: 2011-04-09
Posts: 265

Why are Drupal sites installed in /var/lib/drupal?

I have some experience with creating and managing Drupal sites, but only in hosted environments. I am now trying to set up a couple of sites on my own desktop machine and I see that the drupal package installs the sites under /var/lib/drupal instead of putting them under the DocumentRoot (at /srv/http). Can anyone tell me why this is the case? Why using /var/lib?

Offline

#2 2017-02-10 18:41:26

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Why are Drupal sites installed in /var/lib/drupal?

I have no experience with drupal but I am thinking that if it uses its own user (perhaps http) that /var/lib/drupal is the homedir.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2017-02-10 19:54:30

Awebb
Member
Registered: 2010-05-06
Posts: 6,312

Re: Why are Drupal sites installed in /var/lib/drupal?

In addition to graysky's good point, /srv is for you, not for pacman. The system's version resides in /var/lib, /lib or other paths with explicitly static or otherwise important content. One traditionally symlinks package management installed web applications to /srv/whatever. I'd personally complain a lot, if pacman touched /srv in any way, that's for productive servers and not for library files.

Or, shorter answer: The probability, that $USER will throw files into /srv manually is huge and pacman doesn't like file conflicts, so we don't package files to /srv.

Offline

#4 2017-02-10 22:29:12

stefano
Member
Registered: 2011-04-09
Posts: 265

Re: Why are Drupal sites installed in /var/lib/drupal?

Awebb wrote:

In addition to graysky's good point, /srv is for you, not for pacman. The system's version resides in /var/lib, /lib or other paths with explicitly static or otherwise important content. One traditionally symlinks package management installed web applications to /srv/whatever. I'd personally complain a lot, if pacman touched /srv in any way, that's for productive servers and not for library files.

Or, shorter answer: The probability, that $USER will throw files into /srv manually is huge and pacman doesn't like file conflicts, so we don't package files to /srv.



This makes sense, BUT:

if the drupal package is only supposed to install a system version for the user to move around and/or symlink and not a production-ready system, I would expect:

1. that the pacman-installed drupal would NOT work (i.e that it would not be accessible by apache)

2. That the wiki page would make it clear that one of the two actions above is expected (symlink or copy everything under /srv)

instead what happens is tha at the end of the installation process there is a perfectly functional site being served from a location outside the DocumentRoot---that, I don't like.

Perhaps the wikipage should at least be updated to make pacman's strategy clearer.

Offline

#5 2017-02-10 22:43:43

Awebb
Member
Registered: 2010-05-06
Posts: 6,312

Re: Why are Drupal sites installed in /var/lib/drupal?

You are free to create a wiki account and open a discussion in the article. I personally don't think it's that specific page's job to teach you how the linux file system is supposed to work, neither is it supposed to guess, how you like your doc root, but don't let me stop you from discussing it with the authors of the article.

Offline

#6 2017-02-10 23:41:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,576
Website

Re: Why are Drupal sites installed in /var/lib/drupal?

stefano wrote:

instead of putting them under the DocumentRoot (at /srv/http).

Your document root is wherever you configure your http.conf (or http-vhosts.conf) to point to.  Just point the DocumentRoot of the host/vhost to the directory with the Drupal content.

/srv/http is just the default entry in the config file and it's a completely useless default if you have multiple domains/sub-domains.

Symlinking seems like a less than ideal workaround.  If you want to serve files from /var/lib/whatever just serve the files from /var/lib/whatever and be done with it.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2017-02-11 08:08:26

Awebb
Member
Registered: 2010-05-06
Posts: 6,312

Re: Why are Drupal sites installed in /var/lib/drupal?

Whatever the user ends up doing, /srv is a dead zone for pacman.

Offline

#8 2017-02-11 16:47:46

stefano
Member
Registered: 2011-04-09
Posts: 265

Re: Why are Drupal sites installed in /var/lib/drupal?

Trilby wrote:
stefano wrote:

instead of putting them under the DocumentRoot (at /srv/http).

Your document root is wherever you configure your http.conf (or http-vhosts.conf) to point to.  Just point the DocumentRoot of the host/vhost to the directory with the Drupal content.

/srv/http is just the default entry in the config file and it's a completely useless default if you have multiple domains/sub-domains.

Symlinking seems like a less than ideal workaround.  If you want to serve files from /var/lib/whatever just serve the files from /var/lib/whatever and be done with it.


Well, that what exactly my point, sorry for having being unclear:


pacman should install in /var/lib and the wiki page should make clear that the user should either change httpd.conf to point there or move the fresh drupal install under /srv/http (or set up a new root somewhere else, etc.)

At any rate, I'll follow up on the wiki discussion page

Offline

#9 2017-02-11 19:21:24

Awebb
Member
Registered: 2010-05-06
Posts: 6,312

Re: Why are Drupal sites installed in /var/lib/drupal?

I still don't see what's wrong with the wiki arcticle. It has "Include conf/extra/drupal.conf" for the httpd.conf and "/usr/share/webapps/drupal/.htaccess" changes mentioned. What's wrong with that?

Offline

Board footer

Powered by FluxBB