Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2ZHn-0003go-01 for pgadmin-hackers@arkaria.postgresql.org; Mon, 24 Apr 2017 08:23:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d2ZHm-0007uJ-It for pgadmin-hackers@arkaria.postgresql.org; Mon, 24 Apr 2017 08:23:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d2ZHW-0007AU-VX for pgadmin-hackers@postgresql.org; Mon, 24 Apr 2017 08:23:39 +0000 Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d2ZHO-0005Yc-R9 for pgadmin-hackers@postgresql.org; Mon, 24 Apr 2017 08:23:38 +0000 Received: by mail-it0-x236.google.com with SMTP id 70so49292695ita.0 for ; Mon, 24 Apr 2017 01:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=R3TG3PKdHHZDhNPTHp9UwCnO9yEj70MvtYQ/2/N+t/I=; b=usc6rotjrxUUdLgnwvIX8j2aETEkXVkTXm9N/0FQQE/t6VH1jIV10LYMtZsMf459dP fPUVcdOYAKTq2HO74nVkFTRUoT+49kM/WW5twjWPsJU+Uu6HLOuLvITCtbahdaF8KGnM TUzmc0rDVQm/7Xn8yrsT8wF0pVZgLM1d+tsX//W/ShyvKhyCPqE4UCJ76BKn7HYtl2Mj bB1+LHSh3ABiMKbTJ7H6kFUsGf0O7RftLWcWIzabo3J9wCR2WghpfjyuI7Q+6gZxkbGW mh8kzwd9baFnKg3ApmxYKuYGSw5/XI8py5RsyyqusdntRqp7nir2Esp8i0M2EmYOT7LS ly5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=R3TG3PKdHHZDhNPTHp9UwCnO9yEj70MvtYQ/2/N+t/I=; b=p//NIqI2bDXyTAqo4/vMYeaePG05c8aTLyce2oKhNaIgeb/BhFfuIdhygP6KmL/Jyr xczNdS/CQoBuxYx1KgfGnqiSH+3IanzKYQaWL9GcpwC+MLMjHCy2YIx2Lja6Mgiyf8mE aLIQ31BLulUfsGX724sYvu186U5ctErDRnlPsMTG3Y5BR3c+PX8OJi6uxcEL8sbA3CMy u+OJvjplWB6K+tfJfk0zHYExGt5ejernoPwntZ3eEbq+PqKGtP9S/PIpSEsVE3TU6jn9 p0Y7g0U4heC3LquSrhYKE7lunrlJJCZbMM2tGyuJ/DXen/Y+bkKqy24yq2+0pBMUct7F QXbw== X-Gm-Message-State: AN3rC/4aJkzRE9C4pRhw+gNVX049w34IWl5U54JG/53hm0tdOHvF/Kj9 gtQW6RChKY62uQAFoe8UZYNsCd0pdA== X-Received: by 10.36.69.169 with SMTP id c41mr12352551itd.6.1493022208365; Mon, 24 Apr 2017 01:23:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.167 with HTTP; Mon, 24 Apr 2017 01:23:27 -0700 (PDT) In-Reply-To: <31f14480-46d0-03d8-8f13-b1ff6294f326@berkus.org> References: <8ca2ba41-b46f-a89e-6b1b-4b7277348685@berkus.org> <1492765022.3215.2.camel@gunduz.org> <9d48ca84-daaa-dca4-b6c4-ab7e99e9b74a@berkus.org> <31f14480-46d0-03d8-8f13-b1ff6294f326@berkus.org> From: Dave Page Date: Mon, 24 Apr 2017 09:23:27 +0100 Message-ID: Subject: Re: Install of pgadmin4 from package fails ... To: Josh Berkus Cc: =?UTF-8?B?RGV2cmltIEfDvG5kw7x6?= , pgadmin-hackers Content-Type: multipart/alternative; boundary=001a11c148be5f2993054de552d7 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a11c148be5f2993054de552d7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Apr 21, 2017 at 10:40 PM, Josh Berkus wrote: > On 04/21/2017 02:14 PM, Josh Berkus wrote: > > On 04/21/2017 01:57 AM, Devrim G=C3=BCnd=C3=BCz wrote: > >> On RHEL 7 / Fedora 25: > >> > >> * systemctl enable pgadmin4-v1.service; systemctl start > pgadmin4-v1.service > >> * cp /etc/httpd/conf.d/pgadmin4-v1.conf.sample > /etc/httpd/conf.d/pgadmin4- > >> v1.conf > >> * systemctl start httpd.service > >> > >> should be enough, at least this is what I just tested on my Fedora 25 > box. > > > > So I just tried this, and it doesn't do any of the setup. > > > > There's no config_local, and as far as I can tell the database isn't > > created. It's hard to know for sure, though, because without a > > config_local I'm not sure where it would be located. > > > > Error: [Fri Apr 21 21:02:32.080337 2017] [wsgi:error] [pid 26] [remote > > 76.115.138.49:35628] FileNotFoundError: [Errno 2] No such file or > > directory: '/usr/share/httpd/.pgadmin/pgadmin4.log' > > > > ... certainly there is no /usr/share/httpd/.pgadmin directory > > > > Aha, here's the problem. Setup is getting run as root, not as the user > httpd. This means it's dropping .pgadmin into /root/, which the web > server can't access; it's "home" directory is /usr/share/httpd. > However, that directory isn't writable by the apache user, either. > > There isn't an easy fix for this; on a default Fedora or CentOS system, > the only directory the apache user has read/write to is /tmp, as far as > I know. > > Ideas? This is covered in the docs: https://www.pgadmin.org/docs4/1.x/server_deployment.html Create a directory, setup the config to use it as required, then chown the database after running setup (which is probably easier than trying to run it as the apache user directly). --=20 Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --001a11c148be5f2993054de552d7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Fri, Apr 21, 2017 at 10:40 PM, Josh Berkus <josh@berkus.org> wrote:
On 04/21/= 2017 02:14 PM, Josh Berkus wrote:
> On 04/21/2017 01:57 AM, Devrim G=C3=BCnd=C3=BCz wrote:
>> On RHEL 7 / Fedora 25:
>>
>> * systemctl enable pgadmin4-v1.service; systemctl start pgadmin4-v= 1.service
>> * cp /etc/httpd/conf.d/pgadmin4-v1.conf.sample /etc/httpd/con= f.d/pgadmin4-
>> v1.conf
>> * systemctl start httpd.service
>>
>> should be enough, at least this is what I just tested on my Fedora= 25 box.
>
> So I just tried this, and it doesn't do any of the setup.
>
> There's no config_local, and as far as I can tell the database isn= 't
> created.=C2=A0 It's hard to know for sure, though, because without= a
> config_local I'm not sure where it would be located.
>
> Error: [Fri Apr 21 21:02:32.080337 2017] [wsgi:error] [pid 26] [remote=
> 76.115.138.49:35628] FileNotFoundError: [Errno 2] No such file or=
> directory: '/usr/share/httpd/.pgadmin/pgadmin4.log'
>
> ... certainly there is no /usr/share/httpd/.pgadmin directory
>

Aha, here's the problem.=C2=A0 Setup is getting run as root, not as the= user
httpd.=C2=A0 This means it's dropping .pgadmin into /root/, which the w= eb
server can't access; it's "home" directory is /usr/share/= httpd.
However, that directory isn't writable by the apache user, either.

There isn't an easy fix for this; on a default Fedora or CentOS system,=
the only directory the apache user has read/write to is /tmp, as far as
I know.

Ideas?


<= div>Create a directory, setup the config to use it as required, then chown = the database after running setup (which is probably easier than trying to r= un it as the apache user directly).

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgs= nake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Co= mpany
--001a11c148be5f2993054de552d7--