HOWTO: Install phpPgAdmin to support Postgresql db's using C

O

ozzi4648

Guest
MySQL is a very fast, easy to use database that is very popular and used by a wide variety of web sites on the Internet today. Sites such as the hugely popular Slashdot.org rely on Mysql to power their dynamic data-driven web sites.

PostgreSQL is a high quality, feature rich relational database. PostgreSQL offers features such as transaction support that normally aren't available with MySQL. PostgreSQL is reknowned for its rock solid stability and scalable performance. You will find that very few web hosts offer PostgreSQL because of its complexity.

Offer your users Postgresql support on your Cpanel box and watch your subscriptions increase. Not many hosting companies offer it, but you can. I will show you how to install, configure and use the tool that allows you manage your postgresql db's. Its called phpPgadmin, just like the tool your using for your MySql.

View my demo and log in at http://216.40.226.215/phpPgAdmin/
with userid: testuser password: tester

I have attached a &testdatabase& Feel free to add tables and views if you know sql!

You can pick up the link here: http://linux.cvf.net then click on the LINUX link at the top of the page. Scroll down and find the link to the Cpanel tutorial.

;)
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
Sweet! thanks a lot!

Anyone else try this out?
 
O

ozzi4648

Guest
[quote:891e00f46e][i:891e00f46e]Originally posted by iminteractive[/i:891e00f46e]

Sweet! thanks a lot!

Anyone else try this out?[/quote:891e00f46e]

Your very welcome!:p
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
Anyone know how to limit the amount of databases a perticular user can use?
 
O

ozzi4648

Guest
[quote:342b03017d][i:342b03017d]Originally posted by iminteractive[/i:342b03017d]

Anyone know how to limit the amount of databases a perticular user can use?[/quote:342b03017d]

Say you have a customer who requires a postgresql db for his site. Lets also say that on this plan he is allowed (1) postgresql database and any additional ones have to be purchased for say $8 additional per month. But he only wants (1) so lets give it to him.


First, log in as postgres

Click on USER ADMIN&NEW USER
Enter his USERNAME, Place check mark in the CREATEDB box, and enter his PASSWORD. Click SAVE

Logout

Log in as the user. You will see that he has no db's yet so create one for him. In the center of your screen you will see a box that says, CREATE NEW DATABASE. Enter the name of the new database.

Logout

Now you want to make sure that he cannot create any more databases because our scenerio says he can only have one so we need to remove his access to create anymore.

Log back in as superuser, postgres:

Click on USER ADMIN&then click on the EDIT tab for the user.
REMOVE the check make from the users CREATE DB TAB and SAVE.

DONE!

Log back in as the user to check. You will notice that the CREATE DATABASE BOX is now gone and he has access to only one database, his own.

REMEMBER, a database created by a user is OWNED by that user. This is not true in the case of the postgres account. It has access to all databases including roots.
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
Anyone have any advice as to what the best ./configure line options might be?
 
O

ozzi4648

Guest
[quote:ce98560f8b][i:ce98560f8b]Originally posted by iminteractive[/i:ce98560f8b]

Anyone have any advice as to what the best ./configure line options might be?[/quote:ce98560f8b]

Not happy with my example? Get yourself a copy of SQL and learn the commands from the command line.
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
Your example? Im wondering what the best ./configure would be when installing postgre.
 
O

ozzi4648

Guest
[quote:ae1f8f3e3f][i:ae1f8f3e3f]Originally posted by iminteractive[/i:ae1f8f3e3f]

Your example? Im wondering what the best ./configure would be when installing postgre.[/quote:ae1f8f3e3f]

Sorry, dont understand you question!
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
Ok, your tutorial shows how to install phppgadmin, but it doesn't show how to install postgresql itself.. what im wondering as per the postgre install instructions ( http://postgresql.planetmirror.com/users-lounge/docs/7.2/postgres/install-procedure.html ) is what the best ./configure line might be to take advantage of as many features with postgre as possible.
 
O

ozzi4648

Guest
[quote:6f63b0512f][i:6f63b0512f]Originally posted by iminteractive[/i:6f63b0512f]

Ok, your tutorial shows how to install phppgadmin, but it doesn't show how to install postgresql itself.. what im wondering as per the postgre install instructions ( http://postgresql.planetmirror.com/users-lounge/docs/7.2/postgres/install-procedure.html ) is what the best ./configure line might be to take advantage of as many features with postgre as possible.[/quote:6f63b0512f]

Then you need to read those docs again because what i said in my docs is its already installed you just need to turn it on. Postgresql is a standard install on ALL linux installations as far as i know. Have you looked at your php info? You probably dont have php compiled using postgres, again this is in my installation tutorial. Your PHP MUST be compiled with postgres for it to work.
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
Yeah, I started off by doing the ./configure for php ( without even thinking of installing postgre ) and it came up with an error for post gre.. I then had a look around and couldn't find anything to suggest that postgre might already be installed. This is on a rh 7.2 box.. ill have a look at my other boxes.
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
strange it is on my 7.1 box. This is anoying.
 
O

ozzi4648

Guest
[quote:9e22e30e4c][i:9e22e30e4c]Originally posted by iminteractive[/i:9e22e30e4c]

strange it is on my 7.1 box. This is anoying.[/quote:9e22e30e4c]

Well thats strange, have you thought about applying the latest build of apache to take your box to 1.3.27? I'm also running RH 7.2 Server Version: Apache/1.3.27 (Unix) DAV/1.0.3 mod_perl/1.26 mod_log_bytes/0.3 mod_bwlimited/1.0 PHP/4.2.3 FrontPage/5.0.2.2510 mod_ssl/2.8.11 OpenSSL/0.9.6b
Server Built: Oct 24 2002 12:03:43

I just dont believe postgresql is not on your server. Thats pretty much impossible.
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
I've got the latest apache, but buildapache doesn't come with postgre.. and its not there at all, ive looked and looked again.
 
O

ozzi4648

Guest
[quote:3a4e0e16ae][i:3a4e0e16ae]Originally posted by iminteractive[/i:3a4e0e16ae]

I've got the latest apache, but buildapache doesn't come with postgre.. and its not there at all, ive looked and looked again.[/quote:3a4e0e16ae]

It should be locate here:

/usr/share/doc/postgresql-7.1.3

do a locate postgresql

If not, you will have to install it!
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
I've already done that, and I've already come to that conclusion, thats why im wondering what the best ./configure would be :)
 
O

ozzi4648

Guest
[quote:c51d178c8a][i:c51d178c8a]Originally posted by iminteractive[/i:c51d178c8a]

I've already done that, and I've already come to that conclusion, thats why im wondering what the best ./configure would be :)[/quote:c51d178c8a]

Check webhosting manger select RPM Package installer the scroll down to postgresql. It should say the following:

postgresql(reinstall)
postgresql-devel(resinstall)
postgresql-libs(resinstall)
postgresql-server(resinstall)

If those options are installed then select the options above and force and install. After that compile php-4.2.3 using the example in my tutorial with postgresql support. It seems we should take this to private.
 
O

ozzi4648

Guest
Your best config for php would be --with-pgsql=/usr. You need to add that to the ./config if its not already there. I think thats what your asking but im not sure. WOW!
 

haze

Well-Known Member
Dec 21, 2001
1,540
3
318
I'll try the rpm method, tho I would have preffered to do it from source. I already have the --with-pgsql=/usr as per the tutorial in the URL you gave me.. I was reffering to the ./config when you compile postgre from source, but I suppose I won't need that with the RPM install. Anyways.. here I go.