[dspace-tech] Re: ant fresh_install vs postgres

2017-02-07 Thread Walter Rutherford
*Sorry if this post is a bit chatty, but I wanted it to be helpful to 
anybody else who runs into the same problems.*

I had some initial success and was able to complete the 'ant 
fresh_install'. Tomcat didn't display the default page but
I think that may be because I installed it with yum rather than from source 
code like the manual expected and it was
installed in a different directory than DSpace expected. In the end I 
copied the directory ant built to where tomcat
expects to find its pages (symlinks didn't work) and tomcat started with 
the default page.

But it doesn't connect to the postgres database. That may be because it's 
running from a new location or there's still
and issue with the pg_hba.conf file. I tried connecting again as a 
different user as Tom suggested above and got a
new error:
  [walter@irtest ~]$ psql -h localhost -p 5432 -d dspace -U dspace
  psql: FATAL:  no pg_hba.conf entry for host "::1", user "dspace", 
database "dspace", SSL off

It looks like it has skipped over the IPv4 host md5 rule and is trying to 
connect via IPv6. We aren't actively using IPv6 but
just as a sanity check I added a new rule to the pg_hba.conf file:
  host dspace  dspace  ::1/128 md5

Then logged in as a different user. It worked. So why is it ignoring the 
nearly identical IPv4 host rule???
  host dspace dspace 127.0.0.1  255.255.255.255md5

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-02-01 Thread Walter Rutherford
Thanks for clarifying. Tomcat is the dspace "user" accessing the database 
on behalf of a person
searching our repository online, so everything is local as far as the 
database is concerned.

To clarify my side, I didn't add that 'trust' authorization rule and 6543 
was a typing-in-the-dark
typo by a partial touch typist who never quite mastered the top row. :-)

I still have a ways to go to get Tomcat to talk to the database, but 
getting past that ant install was
I'm sure the biggest hurdle. Thanks again.

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] Re: ant fresh_install vs postgres

2017-02-01 Thread Tom Desair
Your PostgreSQL database is not aware of any users that are logged in into
or connected to your DSpace web application. It is the Tomcat process
itself (which serves the DSpace web app) that connects to your database and
since both are on the same host, you should only have the rule "host
dspace dspace127.0.0.1  255.255.255.255md5". You could see
this as Tomcat executing queries on behalf of a user browsing your DSpace
repository.

The extra rule you added is a high security risk. I would strongly
recommend you to remove it.

Just to be sure, in your previous post you mentioned ports 5432 (the
default) and 6543 but I'll assume this is a typo and that you have only one
database server running.

Best regards,
Tom

[image: logo] Tom Desair
250-B Suite 3A, Lucius Gordon Drive, West Henrietta, NY 14586
Esperantolaan 4, Heverlee 3001, Belgium
www.atmire.com


2017-02-01 4:05 GMT+01:00 Walter Rutherford :

> I've previously only interacted with DSpace as a user so please pardon the
> 'newb' questions. I'm trying to (re)create a repository that anyone can
> search
> via a website but only certain authorized local users can modify.
>
> Given these authentication rules:
> host dspace dspace 127.0.0.1  255.255.255.255md5
> localall all peer
> host all all 127.0.0.1/32ident
>
> Aren't all the connections local, (explicitly or due to the 127 address)?
>
> When I have DSpace setup with Tomcat does the database see that as
> a local or host connection? Because if it's a host connection then
> the md5 host rule will kick in and the user will have to supply a password.
> And even then, given the ADDRESS it's still a local connection, right?
> So I assumed DSpace web connections would be translated into local
> (Tomcat => 'dspace') database queries/connections.
>
> If my 'dspace' database user had no authority to do anything dangerous
> and all access attempts are filtered through Tomcat as 'dspace' could I
> just 'trust' the connection since I (hopefully) can trust Tomcat? Then
> users
> wouldn't need a password to search our repository. Something like this:
>
> host dspace dspace127.0.0.1  255.255.255.255md5
> localdspace dspace  trust
> localallall peer
> host allall 127.0.0.1/32ident
>
> Or would that open my site up to all sorts of mischief?
> Note: I don't have the Tomcat interface up so I haven't yet tested any of
> this from a browser.
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Walter Rutherford
I've previously only interacted with DSpace as a user so please pardon the
'newb' questions. I'm trying to (re)create a repository that anyone can 
search
via a website but only certain authorized local users can modify.

Given these authentication rules:
host dspace dspace 127.0.0.1  255.255.255.255md5
localall all peer
host all all 127.0.0.1/32ident

Aren't all the connections local, (explicitly or due to the 127 address)?

When I have DSpace setup with Tomcat does the database see that as
a local or host connection? Because if it's a host connection then
the md5 host rule will kick in and the user will have to supply a password.
And even then, given the ADDRESS it's still a local connection, right?
So I assumed DSpace web connections would be translated into local
(Tomcat => 'dspace') database queries/connections.

If my 'dspace' database user had no authority to do anything dangerous
and all access attempts are filtered through Tomcat as 'dspace' could I
just 'trust' the connection since I (hopefully) can trust Tomcat? Then users
wouldn't need a password to search our repository. Something like this:

host dspace dspace127.0.0.1  255.255.255.255md5
localdspace dspace  trust
localallall peer
host allall 127.0.0.1/32ident

Or would that open my site up to all sorts of mischief?
Note: I don't have the Tomcat interface up so I haven't yet tested any of 
this from a browser.

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Walter Rutherford

 Thank you Tom.

1) I have the md5 line in the pg_hba.conf file
3) Changed dspace.hostname to "localhost" then later to localhost (no 
quotes) since that's the default
4) Postgres complained with I tried to reset dspace's attributes

 postgres=# alter role dspace NOSUPERUSER CREATEDB NOCREATEROLE 
NOCREATEUSER;
 ERROR:  conflicting or redundant options

Not sure what it didn't like but, since it didn't have any superpowers 
before, I just added CREATEDB and that passed.

2) Now I can access the database BUT only if I don't specify '-U dspace'.

[root@irtest config]# su - walter
[walter@irtest ~]$ psql -h localhost -p 5432 -d dspace -U dspace
psql: FATAL:  Ident authentication failed for user "dspace"
[walter@irtest ~]$ psql -d dspace
psql (9.5.5)
Type "help" for help.

dspace=> \du
   List of roles
 Role name | Attributes | 
Member
 of 
---++---
 dspace| Create DB  | {}
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
 walter|| {}

dspace=> \q
[walter@irtest ~]$ psql -d dspace -U dspace
psql: FATAL:  Peer authentication failed for user "dspace"

[walter@irtest ~]$ [walter@irtest ~]$ psql -d dspace -p 5432
psql (9.5.5)
Type "help" for help.

dspace=> \c
You are now connected to database "dspace" as user "walter".
dspace=> \q
[walter@irtest ~]$ 


The mvn command succeeded but, at first, the 'ant fresh_install' failed. :-(
But I realized that was because *somebody* had stopped the database server.
If failed a second time but AFTER it successfully connected to the database!
That is SO much closer - Now it's only complaining about pgcrypto which I 
was
sure I had added weeks ago. Now I wonder if I installed it on a different 
database.

test_database:
 [java] 2017-01-31 13:06:47,925 WARN 
 org.dspace.services.email.EmailServiceImpl @ Couldn't get an email session 
from environment:  Need to specify class name in environment or system 
property, or as an applet parameter, or in an application resource file: 
 java.naming.factory.initial
 [java] 
 [java] Attempting to connect to database
 [java] Connected successfully!
 [java] 
 [java] Database Type: postgres
 [java] Database URL: jdbc:postgresql://localhost:5432/dspace
 [java] Database Schema: public
 [java] Database Username: dspace
 [java] Database Software: PostgreSQL version 9.5.5
 [java] Database Driver: PostgreSQL Native Driver version PostgreSQL 
9.4.1211.jre7
 [java] PostgreSQL 'pgcrypto' extension installed/up-to-date? false 
(not installed)
 [java] 
 [java] WARNING: Required PostgreSQL 'pgcrypto' extension is NOT 
INSTALLED on this database.
 [java] 
 [java] ** DSpace REQUIRES PostgreSQL >= 9.4 AND pgcrypto extension >= 
1.1 **
 [java] 
 [java] To install it, please connect to your DSpace database as a 
'superuser' and manually run the following command: 
 [java] 
 [java]   CREATE EXTENSION pgcrypto;
 [java] 

I added the pgcrypto extension and reran the ant command. Holy Smokes! It 
worked!

 BUILD SUCCESSFUL
 Total time: 19 seconds

 
I haven't gotten to the part where it coordinates with Tomcat but they 
shouldn't conflict because
the database is using port 6543 and Tomcat uses 8080.

Thanks again. I'll walk through the rest of the installation. Wish me luck!



-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Luiz dos Santos
Hi Tom,

It was a very complete answer, you should put it in a wiki page as  a
troubleshooting.

Best
Luiz Claudio Santos
http://luizclaudiosantos.me/

On Tue, Jan 31, 2017 at 4:03 PM, Tom Desair  wrote:

> Hi Walter,
>
> You need to make sure of the following:
>
>1. *Allow the "dspace" PostgreSQL user to connect using a password:* This
>means having the following line to the pg_hba.conf file:
>   - "hostdspace dspace 127.0.0.1  255.255.255.255
>md5"
>   - This tells the Postgres server to allow database connection for
>   user DSpace using password authentication but only when the request 
> comes
>   from ip address *127.0.0.1 *(which is localhost)
>   2. *Test database connection*: On your DSpace server, verify that
>as a user which is not dspace that you can connect to the PostgreSQL
>database using:
>   - psql -h localhost -p 5432 -d dspace -U dspace
>   - This should prompt you for a password
>   3. *local.cfg values: *In your local.cfg file, you should have the
>following property:
>   - db.url = jdbc:postgresql://localhost:5432/dspace
>   - Note that using "localhost" here is important because in step 1
>   we told the Postgres database to only allow connection coming from
>   localhost. If you put "irtest.library.uaf.edu" here, the request to
>   the database will go through the full network stack and the Postgres
>   database will see your external network IP address as the request IP
>   address and not allow access.
>   4. *Make sure the "dspace" user has the correct roles: *Connect to
>your PostgreSQL database and execute:
>   - ALTER ROLE dspace NOSUPERUSER CREATEDB NOCREATEROLE NOCREATEUSER;
>
> Do these steps solve your problem?
>
>
> [image: logo] Tom Desair
> 250-B Suite 3A, Lucius Gordon Drive, West Henrietta, NY 14586
> Esperantolaan 4, Heverlee 3001, Belgium
> www.atmire.com
> 
>
>
> 2017-01-31 21:23 GMT+01:00 Walter Rutherford :
>
>> I remember having some difficulty during the database part of the
>> installation. I'm tempted to rip out the
>> database down to reinstalling Postgres and starting over. But before I
>> do, should the dspace user have
>> an special privileges? I didn't see where any should be set in the
>> instructs so it looks pretty bare:
>>
>>> dspace=> \du
>>>List of roles
>>>  Role name | Attributes
>>> | Member
>>>  of
>>> ---+
>>> +---
>>> 
>>>  dspace|
>>>  | {}
>>>  postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS
>>> | {}
>>>  walter|
>>>  | {}
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "DSpace Technical Support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to dspace-tech+unsubscr...@googlegroups.com.
>> To post to this group, send email to dspace-tech@googlegroups.com.
>> Visit this group at https://groups.google.com/group/dspace-tech.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Tom Desair
Hi Walter,

You need to make sure of the following:

   1. *Allow the "dspace" PostgreSQL user to connect using a password:* This
   means having the following line to the pg_hba.conf file:
  - "hostdspace dspace 127.0.0.1  255.255.255.255
   md5"
  - This tells the Postgres server to allow database connection for
  user DSpace using password authentication but only when the request comes
  from ip address *127.0.0.1 *(which is localhost)
  2. *Test database connection*: On your DSpace server, verify that as
   a user which is not dspace that you can connect to the PostgreSQL database
   using:
  - psql -h localhost -p 5432 -d dspace -U dspace
  - This should prompt you for a password
  3. *local.cfg values: *In your local.cfg file, you should have the
   following property:
  - db.url = jdbc:postgresql://localhost:5432/dspace
  - Note that using "localhost" here is important because in step 1 we
  told the Postgres database to only allow connection coming from
localhost.
  If you put "irtest.library.uaf.edu" here, the request to the database
  will go through the full network stack and the Postgres database will see
  your external network IP address as the request IP address and not allow
  access.
  4. *Make sure the "dspace" user has the correct roles: *Connect to
   your PostgreSQL database and execute:
  - ALTER ROLE dspace NOSUPERUSER CREATEDB NOCREATEROLE NOCREATEUSER;

Do these steps solve your problem?


[image: logo] Tom Desair
250-B Suite 3A, Lucius Gordon Drive, West Henrietta, NY 14586
Esperantolaan 4, Heverlee 3001, Belgium
www.atmire.com



2017-01-31 21:23 GMT+01:00 Walter Rutherford :

> I remember having some difficulty during the database part of the
> installation. I'm tempted to rip out the
> database down to reinstalling Postgres and starting over. But before I do,
> should the dspace user have
> an special privileges? I didn't see where any should be set in the
> instructs so it looks pretty bare:
>
>> dspace=> \du
>>List of roles
>>  Role name | Attributes |
>> Member
>>  of
>> ---+
>> +---
>> 
>>  dspace||
>> {}
>>  postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS |
>> {}
>>  walter||
>> {}
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Luiz dos Santos
Hi Walter,

Are you sure the database is available outside of the server, did you
try to use db.url = jdbc:postgresql://localhost:5432/dspace, and more the
Dspace dspace it should be something like baseUrl =
http://${dspace.hostname}:80/
or dspace.baseUrl = http://${dspace.hostname}:8080/, but have the tomcat in
the same port of the database doesn't make sense.

Best regards

Luiz Claudio Santos
http://luizclaudiosantos.me/

On Tue, Jan 31, 2017 at 3:14 PM, Walter Rutherford 
wrote:

>
> Thanks Mark and Luiz. Unless I'm misunderstanding how it reads variables
> I'm using almost the default
> values in our local.cfg file::
>
> dspace.hostname = "irtest.library.uaf.edu"
> dspace.baseUrl = http://${dspace.hostname}:5432/
> db.url = jdbc:postgresql://${dspace.hostname}:5432/dspace
>
> With db.username and db.password defined exactly as in the database. It
> appears to be choking on the
> dspace.hostname because I've tried both 'localhost' and the systems IP
> address. All that changed was
> the hostname specified in the java.net.UnknownHostExcpetion error message.
>
> But there are a LOT of parameters that can be tweaked so it's very
> possible I missed something.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Walter Rutherford
I remember having some difficulty during the database part of the 
installation. I'm tempted to rip out the
database down to reinstalling Postgres and starting over. But before I do, 
should the dspace user have
an special privileges? I didn't see where any should be set in the 
instructs so it looks pretty bare:

> dspace=> \du
>List of roles
>  Role name | Attributes | 
> Member
>  of 
>
> ---++---
> 
>  dspace|| 
> {}
>  postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | 
> {}
>  walter|| 
> {}
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Walter Rutherford

Thanks Mark and Luiz. Unless I'm misunderstanding how it reads variables 
I'm using almost the default
values in our local.cfg file::

dspace.hostname = "irtest.library.uaf.edu"
dspace.baseUrl = http://${dspace.hostname}:5432/
db.url = jdbc:postgresql://${dspace.hostname}:5432/dspace

With db.username and db.password defined exactly as in the database. It 
appears to be choking on the
dspace.hostname because I've tried both 'localhost' and the systems IP 
address. All that changed was
the hostname specified in the java.net.UnknownHostExcpetion error message.

But there are a LOT of parameters that can be tweaked so it's very possible 
I missed something.


-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Luiz dos Santos
Hi Walter,

I was clarify some points of Mark's e-mail... About you issue, I guess
it is something with config/installation of your database, but I don't have
idea how to solve it, but review the connection info in the
dspace.cfg/local.cfg as Mark said is always a good idea.

Best regards

Luiz Claudio Santos
http://luizclaudiosantos.me/

On Tue, Jan 31, 2017 at 1:45 PM, Walter Rutherford 
wrote:

> Postgres is running as a Linux service if that's what you mean.
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Walter Rutherford
Postgres is running as a Linux service if that's what you mean.

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Luiz dos Santos
Hi Mark,

Maybe I lost that part, but he said that the database is local, right?
if he is using the Dspace 6, he should use local.cfg, it is not an option,
right? The wierd thing here is that he said, he can connect with the linux
user "dspace", but not with others linux user, to me it seem like there is
something wrong with the his database installation, right?  I would install
the database as a service in linux.

Best regards
Luiz Claudio Santos
http://luizclaudiosantos.me/

On Tue, Jan 31, 2017 at 10:03 AM, Mark Wood  wrote:

> On Monday, January 30, 2017 at 7:16:53 PM UTC-5, Walter Rutherford wrote:
>>
>> I think that all makes sense. If I'm logging in from user 'dspace' to
>>  'dspace' in posgres it uses
>> the peer rule and lets me in without a password. Any other user would
>> have to be accessing
>> their own user/database.
>> So, how should the pg_hba.conf file be configured to allow any user to
>> access the DSpace
>> database via a webpage and Tomcat?
>>
>>
> You need an entry that matches the db.* settings in dspace.cfg or
> local.cfg.  db.url specifies the DBMS hostname, db.username the database
> user, and db.password the database user's password.  If your db.url is
> 'jdbc:postgresql://localhost:5432/dspace', db.username is 'dspace', and
> db.password is 'secret', then your existing 'host dspace dspace...' rule
> should work.  The DBMS cluster would have to be on the local host and have
> to have a user 'dspace' with the password 'secret' for this to work.
>
> The PostgreSQL JDBC driver always uses a TCP connection, not a local
> socket, so only 'host' or 'hostssl' rules will apply to DSpace.  The 'psql'
> tool will by default use the local socket, so only 'local' rules will apply
> to it unless you tell it otherwise using the --host option.
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Mark Wood
On Monday, January 30, 2017 at 7:16:53 PM UTC-5, Walter Rutherford wrote:
>
> I think that all makes sense. If I'm logging in from user 'dspace' to 
>  'dspace' in posgres it uses
> the peer rule and lets me in without a password. Any other user would have 
> to be accessing
> their own user/database.
> So, how should the pg_hba.conf file be configured to allow any user to 
> access the DSpace
> database via a webpage and Tomcat?
>
>
You need an entry that matches the db.* settings in dspace.cfg or 
local.cfg.  db.url specifies the DBMS hostname, db.username the database 
user, and db.password the database user's password.  If your db.url is 
'jdbc:postgresql://localhost:5432/dspace', db.username is 'dspace', and 
db.password is 'secret', then your existing 'host dspace dspace...' rule 
should work.  The DBMS cluster would have to be on the local host and have 
to have a user 'dspace' with the password 'secret' for this to work.

The PostgreSQL JDBC driver always uses a TCP connection, not a local 
socket, so only 'host' or 'hostssl' rules will apply to DSpace.  The 'psql' 
tool will by default use the local socket, so only 'local' rules will apply 
to it unless you tell it otherwise using the --host option.

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] Re: ant fresh_install vs postgres

2017-01-31 Thread Luiz dos Santos
Man, it is really weird, I've not ever faced an issue like that, it is hard
to know what is going on. If I was your shoes I could keep try, but right
now, I don't have any idea to offer to you, sorry!

On Mon, Jan 30, 2017 at 8:56 PM Walter Rutherford 
wrote:

>
> Sorry... Correction: "dspace.hostname" not "domain.hostname".
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Luiz Claudio Santos
http://luizclaudiosantos.me/

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-30 Thread Walter Rutherford

Sorry... Correction: "dspace.hostname" not "domain.hostname".

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-30 Thread Walter Rutherford
I tried some of the commented rules in pg_hba.conf. They either wouldn't 
allow the postgres server to
restart or there was no obvious change - I continued to get 
the java.net.UnknownHostException error
which implies to me that the authentication method isn't the immediate 
cause of the ant failure. It's a
problem identifying the DSpace server host.

I changed domain.hostname in my DSpace local.cfg to the IP address and to 
"localhost" and reran
"mvn clean package". Each time it created the ant installer targets and 
each time it failed with the
same error as before except the host it tried to reach changed to the IP 
address and "localhost". I
did an nslookup for both the IP address and the hostname and they both 
resolve to the other so it
doesn't appear DNS is the problem. It's also obvious the local.cfg file is 
being consulted.

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-30 Thread Walter Rutherford
I think that all makes sense. If I'm logging in from user 'dspace' to 
 'dspace' in posgres it uses
the peer rule and lets me in without a password. Any other user would have 
to be accessing
their own user/database.
So, how should the pg_hba.conf file be configured to allow any user to 
access the DSpace
database via a webpage and Tomcat?

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-30 Thread Walter Rutherford

Yes and no.
If I'm logged into Linux as user 'dspace' (which is also the name of the 
postgres user and database) then
'psql -U dspace' drops me in without a password. If I force a password with 
'psql -U dspace -W' I can get
in just fine even with an incorrect password! But if I try from another 
Linux login the connection fails with:
psql: FATAL:  Peer authentication failed for user "dspace"

.The tail end of the pg_hba.conf file looks about like this:
# TYPE  DATABASEUSERADDRESS METHOD

# Tighten security per instructions in DSpace Manual
hostdspace dspace 127.0.0.1  255.255.255.255md5
#hostdspace dspace 127.0.0.1  255.255.255.255peer

# "local" is for Unix domain socket connections only
local   all all peer
#local   all all trust
# IPv4 local connections:
hostall all 127.0.0.1/32ident
# IPv6 local connections:
hostall all ::1/128 ident

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: ant fresh_install vs postgres

2017-01-30 Thread Walter Rutherford
This is the output from the 'ant fresh-install' command. I believe the 
first error is just a non-fatal WARNing, the fatal
problems come when it tries to access the postgres database. But I can't 
tell if the problem stems from postgres,
java, Maven (that created the ant files), ant, DNS, etc..

I'm new enough to both java and postgres that the error messages don't tell 
me anything.

[dspace@irtest dspace]$ cd target/dspace-installer/
[dspace@irtest dspace-installer]$ ant fresh_install
Buildfile: 
/home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/build.xml

init_installation:

prepare_configs:
[mkdir] Created dir: 
/home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp
 [copy] Copying 157 files to 
/home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp
 [copy] Copying 1 file to 
/home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp
 [copy] Copying 16 files to 
/home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp

init_configs:
 [copy] Copying 1 file to /home/dspace/config
   [delete] Deleting directory 
/home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp

test_database:
 [java] 2017-01-30 12:14:37,830 WARN 
 org.dspace.services.email.EmailServiceImpl @ Couldn't get an email session 
from environment:  Need to specify class name in environment or system 
property, or as an applet parameter, or in an application resource file: 
 java.naming.factory.initial
 [java] 
 [java] Error running 'test': 2017-01-30 12:14:38,542 ERROR 
org.dspace.storage.rdbms.DatabaseUtils @ Unable to setup Flyway against 
DSpace database
 [java]  - java.sql.SQLException: Cannot create 
PoolableConnectionFactory (The connection attempt failed.)
 [java] 
 [java] 
 [java] Please see the DSpace documentation for assistance.
 [java] 
 [java] java.sql.SQLException: Cannot create PoolableConnectionFactory 
(The connection attempt failed.)java.sql.SQLException: Cannot create 
PoolableConnectionFactory (The connection attempt failed.)
 [java] 
 [java] at 
org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2294)
 at 
org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2294)
 [java] 
 [java] at 
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2039)
 at 
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2039)
 [java] 
 [java] at 
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
 at 
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
 [java] at 
org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:105)
 [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [java] 
 [java] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 [java] at 
org.dspace.storage.rdbms.DatabaseUtils.setupFlyway(DatabaseUtils.java:473) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [java] 
 [java] at java.lang.reflect.Method.invoke(Method.java:606)
 [java] at 
org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:98)
 [java] at 
org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) 
at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [java] at 
org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
 [java] Caused by: org.postgresql.util.PSQLException: The connection 
attempt failed.
 [java] 
 [java] at 
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:275)
 [java] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at 
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54)
 [java] 
 [java] at 
org.postgresql.jdbc.PgConnection.(PgConnection.java:218) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [java] 
 [java] at org.postgresql.Driver.makeConnection(Driver.java:407)
 [java] at org.postgresql.Driver.connect(Driver.java:275) at 
java.lang.reflect.Method.invoke(Method.java:606)
 [java] 
 [java] at 
org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:39)
 at 
org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
 [java] at 
org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:256)
 [java] 
 [java] at 
org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2304)
 at 
org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
 [java] at 

[dspace-tech] Re: ant fresh_install vs postgres

2017-01-27 Thread Walter Rutherford
Thanks Luiz. I didn't recall if I created the user and DB as root so I 
dropped them both while logged in as 'dspace'.
I'm still getting the same errors which seem to stem from this:
 
 Caused by: java.net.UnknownHostException: 

I've verified the hostname resolves in DNS and even added it to the 
/etc/hosts file and tried
using the IP address for dspace.hostname in my local.cfg file. Nothing has 
worked so far.

I'm stumped..



On Friday, January 27, 2017 at 12:58:56 PM UTC-9, Walter Rutherford wrote:
>
>
> I've proceeded through the DSpace installation but have been stuck during 
> the 'ant fresh_install'.
> It doesn't get very far into test_database before it has a cascade of 
> errors.
>
> [root@irtest dspace-installer]# ant fresh_install
> Buildfile: 
> /home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/build.xml
>
> init_installation:
>
> prepare_configs:
> [mkdir] Created dir: 
> /home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp
>  [copy] Copying 157 files to 
> /home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp
>  [copy] Copying 1 file to 
> /home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp
>  [copy] Copying 16 files to 
> /home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp
>
> init_configs:
>  [copy] Copying 1 file to /home/dspace/config
>[delete] Deleting directory 
> /home/dspace/dspace-6.0-src-release/dspace/target/dspace-installer/config-temp
>
> test_database:
>  [java] 2017-01-27 12:25:08,822 WARN 
>  org.dspace.services.email.EmailServiceImpl @ Couldn't get an email session 
> from environment:  Need to specify class name in environment or system 
> property, or as an applet parameter, or in an application resource file: 
>  java.naming.factory.initial
>  [java] 
>  [java] Error running 'test': 
>  [java]  - java.sql.SQLException: Cannot create 
> PoolableConnectionFactory (The connection attempt failed.)
>  [java] 
>  [java] Please see the DSpace documentation for assistance.
>  [java] 
>  [java] java.sql.SQLException: Cannot create PoolableConnectionFactory 
> (The connection attempt failed.)
> ...
>
>  I suspect there's something wrong with accessing the postgres database. I 
> can access it from
> the command-line (with or without specifying the database) but only if I 
> don't specify localhost.
> [root@irtest dspace-installer]# psql -U dspace -h localhost
> psql: FATAL:  Ident authentication failed for user "dspace"
>
> [root@irtest dspace-installer]# psql -U dspace -W -h localhost
> Password for user dspace: 
> psql: FATAL:  Ident authentication failed for user "dspace"
>
> [root@irtest dspace-installer]# psql -U dspace
> psql (9.5.5)
> Type "help" for help.
> dspace=> \q
>
> [root@irtest dspace-installer]# psql -U dspace -d dspace --list
>   List of databases
>Name|  Owner   | Encoding |   Collate   |Ctype|   Access 
> privileges   
>
> ---+--+--+-+-+---
>  dspace| dspace   | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 
>  postgres  | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 
>  template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres 
>  +
>|  |  | | | 
> postgres=CTc/postgres
>  template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres 
>  +
>|  |  | | | 
> postgres=CTc/postgres
> (4 rows)
>
> Here are the uncommented lines from pg_hba.conf. If I recall it was 
> failing as 'peer' so I set local to 'trust'
> [root@irtest data]# egrep -v "^#|^$" /var/lib/pgsql/9.5/data/pg_hba.conf
> local   all all trust
> hostall all 127.0.0.1/32ident
> hostall all ::1/128 ident
>
> I had had file ownership issues initially but I *think* I've caught all 
> those.
>
> Any assistance is greatly appreciated. Thank you.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.