Simple Postgresql question

Hi All,


I am running debian sarge (stable), and new to installing postgresql. I had a quick look over the postgresql site documentation, and googled around - but I am still having trouble granting permissions -



(trying to enable user matrix access to the db matrix)



Any help/advice greatly appreciated :slight_smile:



Thanks,

Andrew

P.S The product looks very good so far :slight_smile:


[quote]matrix=# \z matrix;

Access privileges for database "matrix"

Schema | Table | Access privileges

--------±------±------------------

(0 rows)



matrix=# select * from pg_user;

usename  | usesysid | usecreatedb | usesuper | usecatupd |  passwd  | valuntil | useconfig

----------±---------±------------±---------±----------±---------±--------- ±----------

postgres |        1 | t          | t        | t        | ******** | |

matrix  |      101 | t          | f        | f        | ******** |[/quote]

[quote]matrix=# GRANT ALL ON matrix TO matrix;

ERROR:  relation "matrix" does not exist[/quote]

The Installer will handle the user permissions for you. :slight_smile: Just setup both DSNs with the correct user and database name and we'll do the rest.

[quote]The Installer will handle the user permissions for you. :slight_smile: Just setup both DSNs with the correct user and database name and we’ll do the rest.
[right][post=“7685”]<{POST_SNAPBACK}>[/post][/right][/quote]





Hi,



Thanks for the advice, I made it past the authentication, and on the final step ran into this error:


[quote]Error text not found for this code and locale [SYS0270] array ( 0 => 'DB Error: unknown error

– creates a function that grants access to the secondary user. – This function should be called after all the tables in the system – have been created CREATE OR REPLACE FUNCTION sq_grant_access(character varying) RETURNS TEXT AS \' DECLARE user_name ALIAS FOR $1; table RECORD; tablename TEXT; BEGIN FOR table IN SELECT c.relname AS name FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN (\'\'r\'\',\'\'v\'\',\'\'S\'\',\'\'\'\') AND n.nspname NOT IN (\'\'pg_catalog\'\', \'\'pg_toast\'\') AND pg_catalog.pg_table_is_visible(c.oid) LOOP tablename=table.name; RAISE NOTICE \'\'tablename is %\'\', tablename; EXECUTE \'\'GRANT ALL ON \'\' || quote_ident(tablename) || \'\' TO \'\' || quote_ident(user_name::text); END LOOP; RETURN \'\'access granted.\'\'; END; \' LANGUAGE plpgsql; [nativecode=ERROR:[/quote]



Any more advice? :slight_smile:

Sounds like your version of PEAR XML_Tree is too old (I ran into this problem yesterday on a client server). Which version of Matrix are you trying to install? Can you post the contents of your mysource_matrix/data/private/conf/main.inc file?

[quote]Sounds like your version of PEAR XML_Tree is too old (I ran into this problem yesterday on a client server). Which version of Matrix are you trying to install? Can you post the contents of your mysource_matrix/data/private/conf/main.inc file?
[right][post=“7724”]<{POST_SNAPBACK}>[/post][/right][/quote]





Hi, Thanks again for the quick reply.



I grabbed the latest files (both installer and matrix from the website yesterday) (v 3.6.2)



I have upgraded all of the pear modules (using the pear command line) - hopefully that helps.



The system is running Debian (stable) - I can upgrade if needed (it is only a testing machine)


  • here is the main.inc file


[quote]<?php

define('SQ_CONF_DB_DSN', 'pgsql://www-data:@unix()/matrix');

define('SQ_CONF_DB2_DSN', 'pgsql://www-data:password@unix()/matrix');

define('SQ_CONF_PEAR_PATH', SQ_SYSTEM_ROOT.'/php_includes');

$inc_dir = ini_get('include_path');

$inc_dir = (substr($inc_dir, 0, 2) == '.:') ? '.:'.SQ_CONF_PEAR_PATH.':'.substr($inc_dir, 2) : SQ_CONF_PEAR_PATH.':'.$inc_dir;

ini_set('include_path', $inc_dir);



define('SQ_CONF_BACKEND_SUFFIX', '_admin');

define('SQ_CONF_LIMBO_SUFFIX', '_edit');

define('SQ_CONF_NOCACHE_SUFFIX', '_nocache');

define('SQ_CONF_ASSET_TREE_BASE', 36);

define('SQ_CONF_ASSET_TREE_SIZE', 4);

define('SQ_CONF_ASSET_CACHE_SIZE_WEB', -1);

define('SQ_CONF_ASSET_CACHE_SIZE_CLI', -1);

define('SQ_CONF_ROLLBACK_ENABLED', 0);

define('SQ_CONF_DEBUG', '0');

define('SQ_CONF_SYSTEM_NAME', 'test 1');

define('SQ_CONF_SYSTEM_OWNER', 'Andrew');

define('SQ_CONF_SYSTEM_ROOT_URLS', '192.168.200.64');

define('SQ_CONF_DEFAULT_EMAIL', 'andrew@donehue.net');

define('SQ_CONF_TECH_EMAIL', 'andrew@donehue.net');

define('SQ_CONF_MAX_LOGIN_ATTEMPTS', 3);

define('SQ_CONF_REFRESH_INTERVAL', 120);

define('SQ_CONF_LOCK_LENGTH', 600);

define('SQ_CONF_LOG_FILE', '/var/www/mysource_matrix_3-6-2/data/private/logs/error.log');

define('SQ_CONF_LOG_ERRORS', true);

ini_set('log_errors', '1');

define('SQ_CONF_ERRORS_HIDE_FRONTEND', false);

define('SQ_CONF_DEFAULT_FRONTEND_LANGUAGE', 'en');

define('SQ_CONF_DEFAULT_BACKEND_LOCALE', 'en_AU');

define('SQ_CONF_DEFAULT_CHARACTER_SET', 'iso-8859-1');

define('SQ_CONF_ALLOW_IP_CHANGE', '0');

define('SQ_CONF_ALLOW_HTTP_LOGIN', '0');

define('SQ_CONF_COMMIT_BUTTON_TEXT', 'Commit');

define('SQ_CONF_LOG_EXTENSION', '.log');

define('SQ_CONF_LOG_FILE_SYSTEM', 'system');

define('SQ_CONF_LOG_FILE_ERROR', 'error');

ini_set('error_log',  SQ_LOG_PATH.'/'.SQ_CONF_LOG_FILE_ERROR.SQ_CONF_LOG_EXTENSION);

define('SQ_CONF_SESSION_GC_MAXLIFETIME', 604800);

ini_set('session.gc_maxlifetime', 604800);

define('SQ_CONF_EDITING_TIME', 3600);

?>[/quote]



Also, out of interest here is some output from the error file


[quote][2005-11-23 20:15:51][0:MySource System][2:php warning][R] (/core/include/mysource.inc:1059) - Cannot modify header information - headers already sent by (output started at /core/include/general.inc:174)

[2005-11-23 20:15:53][0:MySource System][512:mysource warning][R] (/core/include/asset_manager.inc:950) - Error text not found for this code and locale [SYS0209]

array (

  0 => 'public_user',

)

[2005-11-23 20:15:53][0:MySource System][2:php warning][R] (/core/include/mysource.inc:1059) - Cannot modify header information - headers already sent by (output started at /core/include/general.inc:174)

[2005-11-23 20:15:55][0:MySource System][512:mysource warning][R] (/core/include/asset_manager.inc:950) - Error text not found for this code and locale [SYS0209]

array (

  0 => 'public_user',

)

[2005-11-23 20:15:55][0:MySource System][2:php warning][R] (/core/include/mysource.inc:1059) - Cannot modify header information - headers already sent by (output started at /core/include/general.inc:174)

[2005-11-23 20:15:58][0:MySource System][512:mysource warning][R] (/core/include/asset_manager.inc:950) - Error text not found for this code and locale [SYS0209]

array (

  0 => 'public_user',

)

[2005-11-23 20:15:58][0:MySource System][2:php warning][R] (/core/include/mysource.inc:1059) - Cannot modify header information - headers already sent by (output started at /core/include/general.inc:174)

[2005-11-23 20:16:07][0:MySource System][512:mysource warning][R] (/core/include/asset_manager.inc:950) - Error text not found for this code and locale [SYS0209]

array (

  0 => 'public_user',

)

[2005-11-23 20:16:07][0:MySource System][2:php warning][R] (/core/include/mysource.inc:1059) - Cannot modify header information - headers already sent by (output started at /core/include/general.inc:174)

[2005-11-23 20:16:07][0:MySource System][512:mysource warning][R] (/core/include/asset_manager.inc:950) - Error text not found for this code and locale [SYS0209]

array (

  0 => 'root_user',

)[/quote]

Are you running the PHP script from the command-line or via a browser?

[quote]Are you running the PHP script from the command-line or via a browser?
[right][post=“7731”]<{POST_SNAPBACK}>[/post][/right][/quote]





Hi Again :slight_smile:



Via a browser.



(I am running apache 1.33)



The version check gives a ‘tick’ for the version of php.



(4.3.2 I think off the top of my head)



Global variables are currently turned off in php (not sure if they need to be turned on).



Is there a command line option ? (I would be happy to follow this).



Thanks :slight_smile:



Andrew.

Yeah, the step_01.php, step_02.php and step_03.php scripts are designed to run on the command-line (they shouldn't be in at web-accessible location). You should run them like this:

php install/step_01.php /path/to/matrix


You will need a CLI-enabled PHP binary. To check, run php -v and ensure it says (cli) in the version output.

[quote]Yeah, the step_01.php, step_02.php and step_03.php scripts are designed to run on the command-line (they shouldn't be in at web-accessible location). You should run them like this:

php install/step_01.php /path/to/matrix


You will need a CLI-enabled PHP binary. To check, run php -v and ensure it says (cli) in the version output.
[right][post="7733"]<{POST_SNAPBACK}>[/post][/right][/quote]


Hi,
I just noticed that I have php version 4.3.10-16 will this make the install fail?

Thanks,
Andrew

[quote]dev:~/mysource_matrix_3-6-2$ php -v
PHP 4.3.10-16 (cli) (built: Aug 24 2005 20:25:01)
Copyright © 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies[/quote]

Nope, that's just fine. :slight_smile:

[quote]Nope, that’s just fine. :slight_smile:
[right][post=“7750”]<{POST_SNAPBACK}>[/post][/right][/quote]



Hi,



I am running this as the apache user (via the cli) and I get the following output, does this mean I am on the right path? (I expected to be asked questions about the db, etc?).



Thanks,

Andrew.


[quote]dev:~/mysource_matrix_3-6-2$ php install/step_01.php /var/www/mysource_matrix_3-6-2



Notice: Constant SQ_CONF_PEAR_PATH already defined in /var/www/mysource_matrix_3-6-2/data/private/conf/main.inc on line 4



Notice: Constant SQ_CONF_DEFAULT_EMAIL already defined in /var/www/mysource_matrix_3-6-2/data/private/conf/main.inc on line 21



Notice: Constant SQ_CONF_TECH_EMAIL already defined in /var/www/mysource_matrix_3-6-2/data/private/conf/main.inc on line 22

PHP Notice:  Use of undefined constant SQ_LOG_PATH - assumed 'SQ_LOG_PATH' in /var/www/mysource_matrix_3-6-2/data/private/conf/main.inc on line 39



Notice: Use of undefined constant SQ_LOG_PATH - assumed 'SQ_LOG_PATH' in /var/www/mysource_matrix_3-6-2/data/private/conf/main.inc on line 39

----------------------------------

<?php

define('SQ_CONF_DB_DSN', '');

define('SQ_CONF_DB2_DSN', '');

define('SQ_CONF_PEAR_PATH', SQ_SYSTEM_ROOT.'/php_includes');

$inc_dir = ini_get('include_path');

$inc_dir = (substr($inc_dir, 0, 2) == '.:') ? '.:'.SQ_CONF_PEAR_PATH.':'.substr($inc_dir, 2) : SQ_CONF_PEAR_PATH.':'.$inc_dir;

ini_set('include_path', $inc_dir);



define('SQ_CONF_BACKEND_SUFFIX', '_admin');

define('SQ_CONF_LIMBO_SUFFIX', '_edit');

define('SQ_CONF_NOCACHE_SUFFIX', '_nocache');

define('SQ_CONF_ASSET_TREE_BASE', 64);

define('SQ_CONF_ASSET_TREE_SIZE', 4);

define('SQ_CONF_ASSET_CACHE_SIZE_WEB', -1);

define('SQ_CONF_ASSET_CACHE_SIZE_CLI', -1);

define('SQ_CONF_ROLLBACK_ENABLED', '0');

define('SQ_CONF_DEBUG', 0);

define('SQ_CONF_SYSTEM_NAME', 'The System');

define('SQ_CONF_SYSTEM_OWNER', '');

define('SQ_CONF_SYSTEM_ROOT_URLS', '');

define('SQ_CONF_DEFAULT_EMAIL', 'matrix-team@squiz.net');

define('SQ_CONF_TECH_EMAIL', 'matrix-team@squiz.net');

define('SQ_CONF_MAX_LOGIN_ATTEMPTS', 3);

define('SQ_CONF_REFRESH_INTERVAL', 120);

define('SQ_CONF_LOCK_LENGTH', 600);

define('SQ_CONF_LOG_FILE', '');

define('SQ_CONF_LOG_ERRORS', true);

ini_set('log_errors', '1');

define('SQ_CONF_ERRORS_HIDE_FRONTEND', false);

define('SQ_CONF_DEFAULT_FRONTEND_LANGUAGE', 'en');

define('SQ_CONF_DEFAULT_BACKEND_LOCALE', 'en_AU');

define('SQ_CONF_DEFAULT_CHARACTER_SET', 'iso-8859-1');

define('SQ_CONF_ALLOW_IP_CHANGE', '0');

define('SQ_CONF_ALLOW_HTTP_LOGIN', '0');

define('SQ_CONF_COMMIT_BUTTON_TEXT', 'Commit');

define('SQ_CONF_LOG_EXTENSION', '.log');

define('SQ_CONF_LOG_FILE_SYSTEM', 'system');

define('SQ_CONF_LOG_FILE_ERROR', 'error');

ini_set('error_log',  SQ_LOG_PATH.'/'.SQ_CONF_LOG_FILE_ERROR.SQ_CONF_LOG_EXTENSION);

define('SQ_CONF_SESSION_GC_MAXLIFETIME', 604800);

ini_set('session.gc_maxlifetime', 604800);

define('SQ_CONF_EDITING_TIME', 3600);

?>

----------------------------------

Remember to give your system's Apache user write access to

the cache and data directories of your Matrix install
[/quote]

[quote]I am running this as the apache user (via the cli) and I get the following output, does this mean I am on the right path? (I expected to be asked questions about the db, etc?).
[right][post=“7755”]<{POST_SNAPBACK}>[/post][/right][/quote]



The CLI install doesn’t prompt for anything. Step_01.php creates the mysource_matrix/data/private/conf/main.inc file – you should edit that file with the settings for your installation before running step_02.php (or any of the other scripts). An explanation of the configuration options that are required can be found in this thread.

[quote]The CLI install doesn’t prompt for anything. Step_01.php creates the mysource_matrix/data/private/conf/main.inc file – you should edit that file with the settings for your installation before running step_02.php (or any of the other scripts). An explanation of the configuration options that are required can be found in this thread.
[right][post=“7758”]<{POST_SNAPBACK}>[/post][/right][/quote]



Thank you, I will follow the instructions in that thread.





Cheers,

Andrew

Hi,


I managed to make some progress (the installers went without any noticed errors) - and I can see activity on the database




when I go to the url, I get this error


[quote]MySource Notice

Error text not found for this code and locale [SYS0218]

array (

0 => '192.168.200.64/mysource_matrix_3-6-2',

)[/quote]



I had a look at the wiki for documentation, but it suggested this was an error when the site was already setup? (I haven't managed to log into anything yet)



Cheers,

Andrew

You need to run "php /path/to/matrix/install/compile_locale.php /path/to/matrix"

Hi,


Thanks for all your help so far, I managed to get through the steps, and then I received this error (when viewing the url)



MySource Notice

URL "192.168.200.66/matrix" not found [SYS0218]





Any suggestion as to where I should look?





Cheers,

Andrew

That’s error is correct (means Matrix is working!). You haven’t configured a Site for that URL yet, so Matrix can’t serve anything.


Try visiting http://192.168.200.66/matrix/_admin to login to the Administration Interface. The default username/password combination is root/root.

Hi,


Thanks for that, I managed to get to the log-in screen, however it is rejecting my root/root user/pass (I tried multiple times, and made sure caps lock is off, etc.



(I have never logged in before) - so I suspect something is wrong



Is there a way I can reset the password (via the db or config files)? - And any way to turn on debugging?





Cheers,

Andrew

What error message are you getting?

[quote]What error message are you getting?
[right][post=“7969”]<{POST_SNAPBACK}>[/post][/right][/quote]



“Login Key Incorrect” (in red)