Re: Setting up pgAdmin4 as a web application

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: Setting up pgAdmin4 as a web application
Дата
Msg-id CA+OCxoxh49o_9U2pJw9LEfHFzmZ5rbC5Sf7v=usNa4uwocp-ew@mail.gmail.com
обсуждение исходный текст
Ответ на Setting up pgAdmin4 as a web application  (Derek Ealy <dealy663@gmail.com>)
Список pgadmin-hackers
Hi

On Tue, Oct 18, 2016 at 6:42 PM, Derek Ealy <dealy663@gmail.com> wrote:
> I've been trying to get pgAdmin4 to work as a web app for a couple of days.
> I've finally figured out python, pip, wsgi, apache (I think). I can see from
> the logs that is failing when trying to select from the version table which
> I assume should be in the sqlite Db as opposed to my postgres instance.
>
> I've located my pgadmin4.db file and can see that has zero bytes in it.
>
> Here is the message that appears in my apache error log when I try to access
> the pgadmin4 website:
>
> OperationalError: (sqlite3.OperationalError) no such table: version [SQL:
> u'SELECT version.name AS version_name, version.value AS version_value
> \\nFROM version \\nWHERE version.name = ?\\n LIMIT ? OFFSET ?'] [parameters:
> ('ConfigDB', 1, 0)], referer: http://dbgsdev01.nw.loc/
>
> Any ideas how I can get this fixed?

I'll bet this is a permissions issue, with the webserver user account
being unable to properly write files where it needs to. On my test
system, I did something like the following:

- Stop the web server
- Set the following paths in config_local.py in the pgAdmin installation:

LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage'

- My webserver is running as daemon:daemon - adjust the following to suit:

# mkdir /var/log/pgadmin4
# chown daemon:daemon /var/log/pgadmin4
# mkdir /var/lib/pgadmin4
# chown daemon:daemon /var/lib/pgadmin4

- Start the web server

That should allow the config database to be properly created in a
location that the webserver can access, and ensure the sessions,
storage and logs are similarly accessible.

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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Fahar Abbas
Дата:
Сообщение: Re: RM1849: Auto-generating security keys
Следующее
От: Fahar Abbas
Дата:
Сообщение: Re: RM1849: Auto-generating security keys