Mailing List Archive

Only get blank pages after installation
Hello:

I have installed DAViCal on my server, but when I attempt to access it all I get is blank pages.

My server is running:
Ubuntu Server 18.04.3
Apache 2.4.29
PostgreSQL 10.10
Webmin 1.941
Virtualmin 6.03

The apache2 and PostgreSQL services are both running
esprimme@esprimmeserv:~$ sudo service --status-all
 [..]
 [ + ]  apache2
 [..]
 [ + ]  postgresql
 [..]


DAViCal has been setup as a virtual host with SSL

<VirtualHost *:80>
  ServerName calendar.example.com
  Redirect permanent "/" https://calendar.example.com/"]"https://calendar.example.com/"
</VirtualHost>

<VirtualHost *:443>
#SSL
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/calendar.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/calendar.example.com/privkey.pem

# Server
ServerName calendar.example.com
ServerAlias http://www.calendar.example.com"]www.calendar.example.com
ServerAlias webmail.calendar.example.com
ServerAlias admin.calendar.example.com
DocumentRoot /home/calendar/public_html

#Logs
ErrorLog /var/log/virtualmin/calendar.example.com_error_log
CustomLog /var/log/virtualmin/calendar.example.com_access_log combined
ScriptAlias /cgi-bin/ /home/calendar/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/calendar/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php7.2 .php7.2
AddType application/x-httpd-php .php
</Directory>
<Directory /home/calendar/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.calendar.example.com
RewriteRule ^(.*) https://calendar.example.com:20000/"]https://calendar.example.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.calendar.example.com
RewriteRule ^(.*) https://calendar.example.com:10000/"]https://calendar.example.com:10000/ [R]
</VirtualHost>
The files from /usr/share/davical/htdocs have been copied to /home/calendar/public_html.
The owner: group has been set to www-data:www-data. All files' permissions have been set to 755 to allow the PHP files to execute.
sudo ls -l /home/calendar/public_html
total 148
-rwxr-xr-x 1 www-data www-data  1512 Apr  8  2017 admin.php
-rwxr-xr-x 1 www-data www-data 24386 Jan 11  2018 always.php
-rwxr-xr-x 1 www-data www-data  6119 Jan 10  2018 caldav.php
drwxr-xr-x 2 www-data www-data  4096 Feb  7 16:51 css
-rwxr-xr-x 1 www-data www-data  6254 Dec  2  2016 davical.css
-rwxr-xr-x 1 www-data www-data  8504 Apr  8  2017 feed.php
-rwxr-xr-x 1 www-data www-data  3368 Sep 28  2017 freebusy.php
-rwxr-xr-x 1 www-data www-data  1329 May  1  2017 help.php
drwxr-xr-x 2 www-data www-data  4096 Feb  7 16:51 images
-rwxr-xr-x 1 www-data www-data  4343 May  1  2017 index.php
-rwxr-xr-x 1 www-data www-data  6872 May  1  2017 iSchedule.php
drwxr-xr-x 2 www-data www-data  4096 Feb  7 16:51 js
-rwxr-xr-x 1 www-data www-data  5695 Apr  8  2017 metrics.php
-rwxr-xr-x 1 www-data www-data  2362 Jan  2  2017 public.php
-rwxr-xr-x 1 www-data www-data    25 Dec  2  2016 robots.txt
-rwxr-xr-x 1 www-data www-data 17281 May  1  2017 setup.php
drwxr-xr-x 2 www-data www-data  4096 Feb 10 04:08 stats
-rwxr-xr-x 1 www-data www-data  7071 Apr  8  2017 tools.php
-rwxr-xr-x 1 www-data www-data  1017 Dec 28  2016 tz.php
-rwxr-xr-x 1 www-data www-data  3715 May  1  2017 upgrade.php


The following have been added to /etc/postgresql/pg_hba.conf
local all all trust
local   davical    davical_app   trust
local   davical    davical_dba   trust


I have made the following change to /etc/davical/config.php

Disabled/Commented:  $c->pg_connect[] = "dbname=davical user=davical_app";
Enabled/Uncommented:  $c->pg_connect[] = "dbname=davical user=davical_app port=5432 host=localhost password=*********";

After creation of the database, I was given a password for 'admin' user. Should I have used user=admin password=???????????
BTW...my distribution package installed the file with port=5433.


I am able to telnet into DAViCal on localhost

esprimme@esprimmeserv:~$ sudo telnet localhost 5432
Trying ::1...
Connected to localhost.localdomain.
Escape character is '^]'.


but not the server's IP address
esprimme@esprimmeserv:~$ sudo telnet 192.168.0.109 5432
Trying 192.168.0.109...
telnet: Unable to connect to remote host: Connection refused

I'm stumped. This is my first exposure to PostgreSQL, so that's not helping. Any insights would be greatly appreciated:

Thanks

--
Patrick
Email: support@esprimme.com
Re: Only get blank pages after installation [ In reply to ]
On 11/02/2020 15:46, Esprimme Support wrote:

> The following have been added to /etc/postgresql/pg_hba.conf
> local all all trust
> local   davical    davical_app   trust
> local   davical    davical_dba   trust
>
>
> I have made the following change to /etc/davical/config.php
>
> Disabled/Commented:  $c->pg_connect[] = "dbname=davical user=davical_app";
> Enabled/Uncommented:  $c->pg_connect[] = "dbname=davical
> user=davical_app port=5432 host=localhost password=*********";
>
> After creation of the database, I was given a password for 'admin' user.
> Should I have used user=admin password=???????????
> BTW...my distribution package installed the file with port=5433.
>
>
> I am able to telnet into DAViCal on localhost
>
> esprimme@esprimmeserv:~$ sudo telnet localhost 5432
> Trying ::1...
> Connected to localhost.localdomain.
> Escape character is '^]'.
>
>
> but not the server's IP address
> esprimme@esprimmeserv:~$ sudo telnet 192.168.0.109 5432
> Trying 192.168.0.109...
> telnet: Unable to connect to remote host: Connection refused
>
> I'm stumped. This is my first exposure to PostgreSQL, so that's not
> helping. Any insights would be greatly appreciated:

If PostgreSQL is listening on port 5433 (as the above seems to imply),
then that's what you should have in the connection string (and what you
should use in the telnet attempt above). You can check by looking for
the "port" setting in postgresql.conf (which should be in the same
directory as pg_hba.conf)... if it's commented out, then PG is listening
on its default port of 5432; if it's not then use whatever it says there.

If you're on Debian or a derivative, then pg_lsclusters is a handy
utility which lists any installed PG clusters and the ports they are using.

Also, you probably need a "host" line in pg_hba.conf, for TCP/IP access;
the "local" lines only allow access via Unix sockets. It'll look
something like this (the file is well documented at the top):

host davical davical_app 127.0.0.1/32 md5

A possible gotcha here is that the first line in pg_hba.conf to match a
connection attempt is the one which will be used, so put your Davical
line above the others to be sure it takes effect. Don't forget to reload
PostgreSQL if you change pg_hba.conf.

I hope that this helps - I don't know Davical at all, but I'm a
long-time PostgreSQL user.

Ray.


--
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: Only get blank pages after installation [ In reply to ]
Hello Ray:

Thanks for your prompt reply. My comments are interleaved below...

On 2020-02-11 11:14 a.m., Ray O'Donnell wrote:

If PostgreSQL is listening on port 5433 (as the above seems to imply), then that's what you should have in the connection string (and what you should use in the telnet attempt above). You can check by looking for the "port" setting in postgresql.conf (which should be in the same directory as pg_hba.conf)... if it's commented out, then PG is listening on its default port of 5432; if it's not then use whatever it says there.

postgresql.conf definitely shows the port as 5432. The 5433 value must have been a typo.
If you're on Debian or a derivative, then pg_lsclusters is a handy utility which lists any installed PG clusters and the ports they are using.
pg_lsclusters shows the clusters listening on port 5432


Also, you probably need a "host" line in pg_hba.conf, for TCP/IP access; the "local" lines only allow access via Unix sockets. It'll look something like this (the file is well documented at the top): host davical davical_app 127.0.0.1/32 md5 A possible gotcha here is that the first line in pg_hba.conf to match a connection attempt is the one which will be used, so put your Davical line above the others to be sure it takes effect. Don't forget to reload PostgreSQL if you change pg_hba.conf.
I have added the line you suggested in the location suggested.

Alas, with all these changes, the result is still a blank page. When I examine the page source, it too is empty.

What do you think might happen if I use the superuser 'postgres" to connect to the database?

Thanks.

Patrick
Re: Only get blank pages after installation [ In reply to ]
Hi Patrick,

[Sorry for top-post... on my phone]

The blank page sounds like a PHP error... I'd look in the PHP log to see if
there's anything there.

By default the Debian PHP installation logs to syslog, I think... I
generally set error_log in php.ini to a file to make life easier. Restart
Apache to pick up the new setting if you do this.

Ray.


On 11 February 2020 17:31:47 Esprimme Support <support@esprimme.com> wrote:
> Hello Ray:
>
> Thanks for your prompt reply. My comments are interleaved below...
>
>
> On 2020-02-11 11:14 a.m., Ray O'Donnell wrote:
>>
>> If PostgreSQL is listening on port 5433 (as the above seems to imply),
>> then that's what you should have in the connection string (and what you
>> should use in the telnet attempt above). You can check by looking for
>> the "port" setting in postgresql.conf (which should be in the same
>> directory as pg_hba.conf)... if it's commented out, then PG is listening
>> on its default port of 5432; if it's not then use whatever it says there.
>
> postgresql.conf definitely shows the port as 5432. The 5433 value must have
> been a typo.
>> If you're on Debian or a derivative, then pg_lsclusters is a handy
>> utility which lists any installed PG clusters and the ports they are using.
> pg_lsclusters shows the clusters listening on port 5432
>
>
>
>> Also, you probably need a "host" line in pg_hba.conf, for TCP/IP access;
>> the "local" lines only allow access via Unix sockets. It'll look
>> something like this (the file is well documented at the top): host davical
>> davical_app 127.0.0.1/32 md5 A possible gotcha here is that the first line
>> in pg_hba.conf to match a
>> connection attempt is the one which will be used, so put your Davical
>> line above the others to be sure it takes effect. Don't forget to reload
>> PostgreSQL if you change pg_hba.conf.
> I have added the line you suggested in the location suggested.
>
> Alas, with all these changes, the result is still a blank page. When I
> examine the page source, it too is empty.
>
> What do you think might happen if I use the superuser 'postgres" to connect
> to the database?
>
> Thanks.
>
> Patrick