Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27
  1. #11
    Master Untangler
    Join Date
    Feb 2009
    Posts
    171

    Default

    I've made a linked server in SQL Server 2005 to the postgresql in untangle. Now what?

  2. #12
    Untanglit
    Join Date
    Feb 2008
    Posts
    26

    Default What is the configuration

    Could you please tell me what files you edited and what you entered to get the postgresql database to listen on port 5432? I've edited the postgresql.conf, the pg_hba.conf file and nothing seems to allow postgresql to listen. I just set up a postgresql database from scratch on CentOS5 and managed to connect to it via network, so what is different about Untangle?

    thanks

  3. #13
    Master Untangler
    Join Date
    Feb 2009
    Posts
    171

    Default

    I edited pg_hba.conf to allow access to all computers on my subnet based on trust. Didn't work.

    Then I edited postgresql.conf and changed the virtual host to 0.0.0.0 in place of 127.0.0.1. This I did based on the netstat result on ports that were open to other computers. But really did not make any difference.

    Then I tried playing with iptables to open port 5432. But with my limited knowledge, not successful. Then I stopped iptables, and ......wait for it............it worked.
    I know that it's not a good solution at all. Maybe some linux gurus can enlighten us on how to open port 5432.

    I found this post that might be helpful:
    http://forums.untangle.com/networkin...te-access.html
    Last edited by sa_un; 02-19-2009 at 10:56 AM. Reason: Found related posts

  4. #14
    Untanglit
    Join Date
    Feb 2008
    Posts
    26

    Default

    sa_un, that link helped. I found /etc/untangle-net-alpaca/iptables-rules.d/ that has some interesting stuff but I think
    /usr/share/untangle-net-alpaca/scripts/uvm/iptable is where everything starts (or at least is really close). I see some mention of antisub but I couldn't find anything in any other file. If anyone could point me at the right file to antisub port 5432, I would appreciate it.

  5. #15
    Untangle Junkie dmorris's Avatar
    Join Date
    Nov 2006
    Location
    San Carlos, CA
    Posts
    17,486

    Default

    DHUntangle, thats just the bypass and packet filter rules mechanism.

    you need to add a packet filter rule allowing port 5432 from remote. If you hack it into the scripts it will break on upgrade.
    Attention: Support and help on the Untangle Forums is provided by volunteers and community members like yourself.
    If you need Untangle support please call or email support@untangle.com

  6. #16
    Untanglit
    Join Date
    Feb 2008
    Posts
    26

    Default PostgreSQL db access How-To

    OK, I finally got it. Thank you to everyone that posted. Here is how I was able to connect. For this example I am running Untangle in bridged mode with ip addresses 192.168.99.2 My Untangle version is 6.0.2.

    This can all be done on the console or you can...
    Enable SSH on Untangle:
    http://wiki.untangle.com/index.php/Enable_SSH

    -------------------------------------------------
    Backup files:
    Code:
    cp /etc/postgresql/postgresql.conf /etc/postgresql/postgresql.conf.orig1
    cp /etc/postgresql/pg_hba.conf /etc/postgresql/pg_hba.conf.orig1
    -------------------------------------------------
    /etc/postgresql/postgresql.conf
    These lines should be UNCOMMENTED:
    Code:
    tcpip_socket = true
    password_encryption = true
    Add this line:
    Code:
    port = 5432
    Update this line, change the 192.168.99.2 to your untangle servers IP address:
    Code:
    virtual_host='127.0.0.1 192.168.99.2'
    -------------------------------------------------
    /etc/postgresql/pg_hba.conf
    Add this line below the this comment and existing lines, change the 192.168.99 to your IP range
    Code:
    # All IPv4 Connections from localhost
    host	all	all	127.0.0.1	255.255.255.255	ident sameuser
    host	all	all	192.168.99.0	255.255.255.0	password
    -------------------------------------------------
    Restart postgresql:
    Code:
    /etc/init.d/postgresql restart
    -------------------------------------------------
    Check that postgresql is listening:
    Code:
    netstat -an | grep 5432
    Should result in this (along with some localhost results):
    Code:
    tcp	0	0 192.168.99.2:5432	0.0.0.0:*	LISTEN
    -------------------------------------------------
    Log into postgresql database locally and create root user in db. You must be root in the linux shell to complete these commands:
    Get to postgres user:
    Code:
    su - postgres
    Login to db "uvm":
    Code:
    psql -U postgres -d uvm
    -------------------------------------------------
    Commands to create your own login to db (postgresql commands, ver 7.4):
    Code:
    create user “root” with password 'big.long.complicated.password';
    grant all on database uvm to “root”;
    alter user “root” createuser;
    -------------------------------------------------
    Login to Untangle's web interface and set iptables to allow the postgresql port:
    Config tab > Networking > Advanced button (this will put you into advanced mode)
    Once in Advanced mode go to Advancec button > Packet Filter
    Add a User Packet Filter Rule
    • Description: PostgreSQL port to Untangle
    • Action: Pass
    • Souce Address: 192.168.99.0/24
    • Destined Local:
    • Destinaction Port: 5432
    • Protocal: TCP, UDP


    -------------------------------------------------
    Install pgAdmin on your reporting workstation:
    http://www.pgadmin.org/

    -------------------------------------------------
    You can connect with pgAdmin by using the same login as before with database "uvm"
    Once connected, create a new user that will do the reporting.

    -------------------------------------------------
    Some helpful psql command line parameters:
    \? lists all the switch commands (YOUR BEST FRIEND)
    \l to show databases
    \du to show users
    \h or \h ALTER USER for help

    To change db user password:
    ALTER USER postgres with encrypted password 'your_password';

  7. #17
    Untangler
    Join Date
    Oct 2008
    Posts
    84

    Default

    I am going to break some stuff messing with this! Thank you for the write up. I know diddly about databases but this should help me start playing around. I look forward to screwing a lot of stuff up on my test box in the future

  8. #18
    Untanglit
    Join Date
    Jan 2009
    Posts
    15

    Default Instructions for 6.2

    Hi,
    Looks like the post by DHUntangle is now outdated. I'm kinda new to linux. My basic domain is windows but I thought I could update the post for other users. My version of Untangle is 6.2. In this version of UT, there are 2 postgesql running. According to mrunkel in another post,8.0 is for new installs and 7.4 is for installs that have upgraded from previous versions of untangle.
    http://forums.untangle.com/installat...eing-used.html
    I will be focusing on 7.4 but new install users should change the path to 8.0.

    I will be using DHUntangle's article and so I'm sticking to 192.168.99.2. Again, this can all be done on the console or you can...
    Enable SSH on Untangle:
    http://wiki.untangle.com/index.php/Enable_SSH

    -------------------------------------------------
    Backup files:
    Code:
    cp /etc/postgresql/7.4/main/postgresql.conf /etc/postgresql/7.4/main/postgresql.conf.orig1
    cp /etc/postgresql/7.4/main/pg_hba.conf /etc/postgresql/7.4/main/pg_hba.conf.orig1
    -------------------------------------------------
    /etc/postgresql/7.4/main/postgresql.conf:

    I found that
    Code:
    tcpip_socket = true
    was uncommented but others should this first.

    Check to see if
    Code:
    port = 5432
    is present. It was for me.

    Uncomment
    Code:
    password_encryption = true
    Update this line, change the 192.168.99.2 to your untangle servers IP address:
    Code:
    virtual_host='127.0.0.1 192.168.99.2'
    -------------------------------------------------

    /etc/postgresql/7.4/main/pg_hba.conf
    Add this line below the this comment and existing lines, change the 192.168.99 to your IP range
    Code:
    # All IPv4 Connections from localhost
    host    all    all    127.0.0.1    255.255.255.255    ident sameuser
    host    all    all    192.168.99.0    255.255.255.0    password
    -------------------------------------------------
    Restart postgresql:
    Code:
    /etc/init.d/postgresql-7.4 restart
    -------------------------------------------------
    Check that postgresql is listening:
    Code:
    netstat -an | grep 5432
    Should result in this (along with some localhost results):
    Code:
    tcp    0    0 192.168.99.2:5432    0.0.0.0:*    LISTEN
    -------------------------------------------------
    Log into postgresql database locally and create root user in db. You must be root in the linux shell to complete these commands:

    Get to postgres user:
    Code:
    su - postgres
    Login to db "uvm":
    Code:
    psql -U postgres -d uvm
    -------------------------------------------------
    Commands to create your own login to db (postgresql commands, ver 7.4):
    Code:
    create user “root” with password 'big.long.complicated.password';
    grant all on database uvm to “root”;
    alter user “root” createuser;
    If you are using putty for this ensure that the double quotes for root remain as double quotes. For me, they changed to periods. I had to backspace the periods and put double quotes instead.

    -------------------------------------------------
    Login to Untangle's web interface and set iptables to allow the postgresql port:
    Config tab > Networking > Advanced button (this will put you into advanced mode)
    Once in Advanced mode go to Advanced button > Packet Filter
    Add a User Packet Filter Rule
    • Description: PostgreSQL port to Untangle
    • Action: Pass
    • Souce Address: 192.168.99.0/24
    • Destined Local:
    • Destination Port: 5432
    • Protocal: TCP, UDP

    -------------------------------------------------
    Install pgAdmin on your reporting workstation:
    http://www.pgadmin.org/

    -------------------------------------------------
    You can connect with pgAdmin by using the same login as before with database "uvm"
    Once connected, create a new user that will do the reporting.

    -------------------------------------------------
    Some helpful psql command line parameters:
    \? lists all the switch commands (YOUR BEST FRIEND)
    \l to show databases
    \du to show users
    \h or \h ALTER USER for help

    To change db user password:
    ALTER USER postgres with encrypted password 'your_password';

    Thanks to DHUntangle for the post. I have now updated it for use with UT 6.2 UPGRADES. Hope this is useful for someone.
    Last edited by ssriram23; 06-12-2009 at 06:52 AM.

  9. #19
    Newbie
    Join Date
    Dec 2008
    Posts
    13

    Default

    Ok, so I too am finding the reports lacking in some key information.

    I just want to view total bandwidth used by openvpn users.

    SELECT
    *
    FROM
    events.n_openvpn_connect_evt
    WHERE
    n_openvpn_connect_evt.client_name = '<client name>';

    is returning everything except ACTIVE connections (I figure I'd just add up all of the data used for each connection). I've been scouring the UVM db ...and I haven't got the foggiest clue where the OpenVPN client event log is getting the active connections from.

  10. #20
    Untangler
    Join Date
    Jul 2009
    Posts
    64

    Default

    can anyone update this theard with the info for untangle 6.2 and postgress 8.3 because i just cant connect

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO 3.6.0 PL2