In the following post I’ll try to show and explain how and why I am using two template engines in every application I’m working on. Also, why and how I am choosing my template engine(s) I’m working with.
drbd not defined in your config (for this host) FIX.
the fix to your problem is in the .res file in /dev/drbd.d/ . check against ‘uname‘ command that the hostnames are correct.
centos postgresql :
PostgreSQL is a powerful, open source object-relational database system.
In the following tutorial I’ll show how to install PostgreSQL on your CentOS box
We can install PostgreSQL in (at-least) two ways:
yum install postgresql-server
If you want to install the latest version of PostgreSQL you should compile from source. it’s recommended for advanced users and one may argue it’s recommended too for production.
Anyway, this article from DigitalOcean covers this area well (and more). If you want to compile using source you better move to that article. If you prefer or installed using repository (yum), continue…
if you’ll try to start PostgreSQL using the service command, you will see an error tells you must init the db first and create the db files in: /var/lib//pgsql/data
to init on centos postgresql service use:
service postgresql initdb
This created a data folder in /var/lib/pgsql. You can’t run this command again without deleting first this folder (and all your data).
Also, when you called the initdb command above from RedHat’s init script configured permissions on the database. These configuration settings are in the pg_hba.conf file inside the data folder.
By default all permissions are ‘Ident’,
means the only user that can get in initially is user “postgres”, so if you’ll try ‘psql’ from root you’ll get error:
psql: FATAL: Ident authentication failed for user “root”
If you want to login and use postgres with other users than `postgres` you can change the permissions method in pg_hba.conf. change from ‘ident’ to ‘md5’ is recommended.
If you want to use phpPgAdmin (described later) you should change from ‘Ident’ to ‘md5’ or else it won’t login to your system.
If you need to change the default port (5432 by default) and Listen Addresses (localhost by default), you can set those vars inside the postgresql.conf inside /var/lib/pgsql/data folder.
#listen_addresses = 'localhost' #port = 5432
and then, to start on centos postgresql service use:
service postgresql start
to make centos postgresql load on boot use the chkconfig command as follows:
chkconfig postgresql on
and That’s it!
As I mentioned, default setup has ident authentication means the only user that can get in initially is user “postgres”, so if you haven’t changed permissions scheme you should su to postgres before.
to start ‘psql’ as postgres:
# change user to postgres su - postgres # start psql manager psql # CTRL + D twice to exit both psql and su. # You can also short the two commands into: # su postgres -c psql
Read this great tutorial.
PostgreSQL visual interface similar to phpMyAdmin? – in short, if you know phpMyAdmin and want phpPgAdmin, you need to add the EPEL repositories, Apache (yum install httpd) and then install using:
If your permissions scheme is currently ‘Ident’ you might need to change that to ‘md5’ as PhpPgAdmin requires it.
yum install phpPgAdmin
Then visit in your browser: http://localhost/phpPgAdmin
Edit /etc/httpd/conf.d/phpPgAdmin.conf if you want to allow access remotly and restart httpd (service httpd restart).
do you use pgsql, postgres, root, administrator as login or even user without password?
if you do, set the $conf[‘extra_login_security’] entry to false in your et/phpPgAdmin/config.inc.php.
If you really want to use the “postgres” role, make sure you set it up a password and $conf[‘extra_login_security’] is false.
use the command:
to change the system user password and
ALTER USER Postgres WITH PASSWORD 'password';
That alters the password for within the database. To change the password inside Postgresql. there is also short code (inside psql):
Which will ask from you a new password to set.
“The nc (or netcat) utility is used for just about anything under the sun involving TCP, UDP, or UNIX-domain sockets.
It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6. Unlike telnet nc scripts nicely, and separates error messages onto standard error instead of sending them to standard output, as telnet does with some.” (NetCat Manual)