Re: OBSD + PHP + Postgresql(chrooted)

2010-03-04 Thread Bryan Irvine
On Tue, Mar 2, 2010 at 9:45 PM, Henry Gall xob...@gmail.com wrote:
 I am trying to replace mysql with postgresql on my openbsd + apache +php
 server.

 I need to install postgresql from source, as I need special options, and
the
 latest version.

 I am runnning openbsd 4.5, php 5.2.8 from packages,
 postgresql-8.4.2 from source. All dependencies from packages.


 Postgresql compiles and installs fine, works fine as a stand alone server.

 Since I have a running mysql server, I have the /var/www/run/ directories
 and subdirectories

 I edited postgresql.conf to have the socket in /var/www/tmp, which it does

 I did put the _postgresql user and processes in their own login class
 (usermod -L postgresql _postgresql)


 I tried to preload the libpd.so.5.2 library, it can't since by the
 time it gets to it,
 php5 is already loaded.

 I put the following in /etc/rc.conf.local

 if [ -x /usr/local/bin/pg_ctl ]; then
echo -n ' postgresql'
su -l _postgresql -c nohup /usr/local/bin/pg_ctl start \
-D /var/postgresql/data -l /var/postgresql/logfile \
-o '-D /var/postgresql/data' /dev/null
 fi
 (that's where I need pg_ctl and data to be) but it won't load at boot
anyway.
 That's even secondary, I can start the pgsql server by hand after
 boot, and restart
 apache, the server is not intended to be rebooted often anyway.

 I can't get postgresql to work with php with the chrooted environment.
 I searched the
 archives and googled quite a bit, without success.

I always found it easier to set postgres to listen on localhost and
connect to it via port 5432.

-B



OBSD + PHP + Postgresql(chrooted)

2010-03-02 Thread Henry Gall
I am trying to replace mysql with postgresql on my openbsd + apache +php
server.

I need to install postgresql from source, as I need special options, and the
latest version.

I am runnning openbsd 4.5, php 5.2.8 from packages,
postgresql-8.4.2 from source. All dependencies from packages.


Postgresql compiles and installs fine, works fine as a stand alone server.

Since I have a running mysql server, I have the /var/www/run/ directories
and subdirectories

I edited postgresql.conf to have the socket in /var/www/tmp, which it does

I did put the _postgresql user and processes in their own login class
(usermod -L postgresql _postgresql)


I tried to preload the libpd.so.5.2 library, it can't since by the
time it gets to it,
php5 is already loaded.

I put the following in /etc/rc.conf.local

if [ -x /usr/local/bin/pg_ctl ]; then
echo -n ' postgresql'
su -l _postgresql -c nohup /usr/local/bin/pg_ctl start \
-D /var/postgresql/data -l /var/postgresql/logfile \
-o '-D /var/postgresql/data' /dev/null
fi
(that's where I need pg_ctl and data to be) but it won't load at boot anyway.
That's even secondary, I can start the pgsql server by hand after
boot, and restart
apache, the server is not intended to be rebooted often anyway.

I can't get postgresql to work with php with the chrooted environment.
I searched the
archives and googled quite a bit, without success.


Henry Gall



Re: OBSD + PHP + Postgresql(chrooted)

2010-03-02 Thread Bret S. Lambert
 I can't get postgresql to work with php with the chrooted environment.

Error output? Logs, etc? Attempting to connect to the /var/www/tmp socket
and seeing if that works? You're giving us OMG I have a problem!!!
without giving us much of a chance to help.

Hell, it's php, so are your programs calling mysql-specific functions
to access the database? Or did they finally get rid of that piece of
stupid?