Menu

davical setup.php (separte PostgreSQL-Server)

Help
OMG
2015-09-16
2015-09-16
  • OMG

    OMG - 2015-09-16

    My davical setup runs on 2 servers:

    Server 1 Web-Server (IP 192.168.1.2)

    /etc/davical/config.php

    <?php
    $c->pg_connect[] = "dbname=davical user=davical_app port=5432 host=192.168.1.3 password=xxx";
    // I did try also: $c->db_connect[] = array( 'dsn' => 'pgsql:dbname=davical port=5432 host=192.168.1.103', 'dbuser' => 'davical_app', 'dbpass' => 'xxx' );
    

    Server 2 PostgreServer (IP 192.168.1.3)

    /var/lib/pgsql/data/pg_hba.conf (first 2 lines)

    host    davical         davical_dba 192.168.1.2/32           trust
    host    davical         davical_app 192.168.1.2/32           trust
    

    Installation process:

    pg-Server

    createuser -U postgres davical_dba
    createuser -U postgres davical_app
    createdb -U postgres -O davical_dba davical
    psql -U postgres davical
    postgres=# ALTER USER davical_dba WITH PASSWORD 'xxx';
    postgres=# ALTER USER davical_app WITH PASSWORD 'xxx';
    

    Restart of PostgreSQL

    Web-Server

    psql -U davical_dba -h 192.168.1.3 davical <= Test was ok, so no Firewall which is blocking
    psql -qXAt -U davical_dba -h 192.168.1.3 davical < /usr/share/awl/dba/awl-tables.sql
    psql -qXAt -U davical_dba -h 192.168.1.3 davical < /usr/share/awl/dba/schema-management.sql
    psql -qXAt -U davical_dba -h 192.168.1.3 davical < /usr/share/davical/dba/davical.sql
    update-davical-database --dbname davical --dbuser davical_dba --dbhost 192.168.1.3 --dbpass xxx --appuser davical_app --nopatch --owner davical_dba
    psql -qXAt -U davical_dba -h 192.168.1.3 davical < /usr/share/davical/dba/base-data.sql
    psql -qX -U davical_dba -h DATABASE_HOST -c "UPDATE usr SET password = 'yyy' WHERE user_no = 1;" davical
    

    /etc/apache2/sites-available/net.my-domain.davical

    <VirtualHost *:80>
      DocumentRoot /usr/share/davical/htdocs
      DirectoryIndex index.php index.html
      ServerName davical.my-domain.net
      ServerAlias calendar.my-domain.net
      Alias /images/ /usr/share/davical/htdocs/images/
      <Directory /usr/share/davical/htdocs/>
          AllowOverride None
          Order allow,deny
          Allow from all
      </Directory>
      AcceptPathInfo On
    </VirtualHost>
    
    a2ensite net.my-domain.davical
    service apache2 restart
    

    Here is my problem

    If i run the site davical.my-domain.net/setup.php first i did see all green, then i get redirected to a login page. The first line on that login-page is (with red background): Unable to connect to database.

    and I'm not able to login with admin and Password yyy (as set above)

    I ask for your help

    Thank you.

     

    Last edit: OMG 2015-09-16
  • OMG

    OMG - 2015-09-16
     

    Last edit: OMG 2015-09-16
    • Jim Fenton

      Jim Fenton - 2015-09-16

      OMG,

      Most of DAViCal support is on GitLab rather than on SourceForge, so I'm
      not sure how many people are on this mailing list. The main support
      discussion list (which is still on SourceForge) is
      davical-general@lists.sourceforge.net; you might want to subscribe and
      re-ask the question there.

      I'm not much of a PostgresQL expert, but the first thing I'd try is to
      see if I can access the database remotely from the web-server via the
      command line. Probably something like:

      psql --host 192.168.1.3 --port 5432 --password davical

      (hoping I have the command right)

      If that doesn't work correctly, it's a database permissions problem.

      -Jim

      On 9/16/15 5:50 AM, OMG wrote:

      My davical setup runs on 2 servers:

      Server 1 Web-Server (IP 192.168.1.2)
      

      /etc/davical/config.php

      pg_connect[] = "dbname=davical user=davical_app port=5432
      host=192.168.1.3 password=xxx"; // I did try also: $c->db_connect[] =
      array( 'dsn' => 'pgsql:dbname=davical port=5432 host=192.168.1.103',
      'dbuser' => 'davical_app', 'dbpass' => 'xxx' );

      Server 2 PostgreServer (IP 192.168.1.3)
      

      /var/lib/pgsql/data/pg_hba.conf (first 2 lines)

      host davical davical_dba 192.168.1.2/32 trust
      host davical davical_app 192.168.1.2/32 trust

      Installation process:
      
        pg-Server
      

      createuser -U postgres davical_dba
      createuser -U postgres davical_app
      createdb -U postgres -O davical_dba davical
      psql -U postgres davical
      postgres=# ALTER USER davical_dba WITH PASSWORD 'xxx';
      postgres=# ALTER USER davical_app WITH PASSWORD 'xxx';

        Web-Server
      

      psql -U davical_dba -h 192.168.1.3 davical <= Test was ok, so no
      Firewall which is blocking
      psql -qXAt -U davical_dba -h 192.168.1.3 davical <
      /usr/share/awl/dba/awl-tables.sql
      psql -qXAt -U davical_dba -h 192.168.1.3 davical <
      /usr/share/awl/dba/schema-management.sql
      psql -qXAt -U davical_dba -h 192.168.1.3 davical <
      /usr/share/davical/dba/davical.sql
      update-davical-database --dbname davical --dbuser davical_dba --dbhost
      192.168.1.3 --dbpass xxx --appuser davical_app --nopatch --owner
      davical_dba
      psql -qXAt -U davical_dba -h 192.168.1.3 davical <
      /usr/share/davical/dba/base-data.sql
      psql -qX -U davical_dba -h DATABASE_HOST -c "UPDATE usr SET password =
      'yyy' WHERE user_no = 1;" davical

      nano /etc/apache2/sites-available/net.my-domain.davical

      |<VirtualHost *:80=""> DocumentRoot /usr/share/davical/htdocs
      DirectoryIndex index.php index.html ServerName davical.my-domain.net
      ServerAlias calendar.my-domain.net Alias /images/
      /usr/share/davical/htdocs/images/ <Directory usr="" share="" davical="" htdocs=""/> AllowOverride None Order allow,deny Allow
      from all </Directory> AcceptPathInfo On </VirtualHost>|

      a2ensite net.my-domain.davical

      service apache2 restart

      Here is my problem
      

      If i run the site davical.my-domain.net/setup.php first i did see all
      green, then i get redirected to a login page. The first line on that
      login-page is (with red background): Unable to connect to database.

      and I'm not able to login with admin and Password yyy (as set above)

      I ask for your help?
      

      Thank you.


      davical setup.php (separte PostgreSQL-Server)
      https://sourceforge.net/p/davical/discussion/622964/thread/2ad6267d/?limit=25#07f8


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/davical/discussion/622964/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.