Nginx PostgreSQL PHP7.x woes...

I picked up this link http://unflyingobject.com/blog/stories/nextcloud-12-from-scratch-with-freebsd-11/ and decided to try Nginx & PosgreSQL with newer versions of PHP because it's twice the performance of Apache MySQL and half the overhead. Seemed a worthy project... however the code published didn't work for me, and I have struggled with getting a working database built.

Nextcloud requires a database name, login and password. PostgreSQL makes obtaining a password a real job. Nothing has worked from the manual. Even logging in from a SFTP connection.

Code:
$ pg_ctl initdb-D /usr/local/psql/data
pg_ctl: unrecognized operation mode "initdb-D"
Try "pg_ctl --help" for more information.
$ pg_ctl initdb -D /usr/local/psql/data
The files belonging to this database system will be owned by user "dhenzler".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /usr/local/psql/data ... initdb: could not create directory "/usr/local/psql/data": Permission denied
pg_ctl: database system initialization failed

Code:
$ pkg info | grep postgresql*
      postgresql95-client-9.5.10     PostgreSQL database (client)
      postgresql95-server-9.5.10     PostgreSQL is the most advanced      open-source database available anywhere
  
$ pkg info | grep nginx*
      freetype2-2.8_1                Free and portable TrueType font      rendering engine
      gtk-engines2-2.20.2_3          Theme engine for the GTK+-2.0      toolkit
      gtk-murrine-engine-0.98.2_5    Murrine GTK+ 2.x cairo based engine
      harfbuzz-1.7.4                 OpenType text shaping engine
      lcms2-2.9                      Accurate, fast, and small-footprint      color management engine
      libpeas-1.20.0                 Next evolution of the Gedit plugins      engine
      nginx-1.12.2_3,2               Robust and small WWW server
      sqlite3-3.21.0_1               SQL database engine in a C library
      webkit-gtk2-2.4.11_14          Opensource browser engine using the      GTK+ 2 toolkit
      webkit2-gtk3-2.16.6_3          Opensource browser engine using the      GTK+ 3 toolkit

Code:
$ sudo                -u pgsql initdb -D /usr/local/pgsql/data
                sh: sudo: not found
                $ bash
                [dhenzler@FBSD /usr/home/dhenzler]$ sudo -u pgsql initdb                -D
                /usr/local/pgsql/data
                bash: sudo: command not found
                [dhenzler@FBSD /usr/home/dhenzler]$
                [dhenzler@FBSD /usr/home/dhenzler]$
             
                [dhenzler@FBSD /usr/home/dhenzler]$ su -
                Password:
                root@FBSD:~ # service postgresql95 start
                /etc/rc.conf: nginx.postgresql_enable=YES: not found
                postgresql95 does not exist in /etc/rc.d or the local                startup
                directories (/usr/local/etc/rc.d), or is not executable
                root@FBSD:~ #

Anyway.... If you know how to get this fixed let me know... I've learned that pg_ctl is the correct way to start & stop the server. I need to be able to login and set a password. Nextcloud requires this info.

HELP
Dave
 
I've learned that pg_ctl is the correct way to start & stop the server.
Not on FreeBSD, use service postgresql start and service postgresql stop. Note that you don't need to initialize the database, the rc(8) script already takes care of this. And /usr/local/psql/data is the wrong directory, it's /var/db/postgres/data95/ for Postgresql 9.5.
 
Back
Top