[Users] connection between openser and mysql both in different machine

unplug maillisting at gmail.com
Sat Jan 21 09:56:10 CET 2006

I find that we need to set the SQL_HOST in openserctl.  Or write
SQL_HOST=db in /usr/local/etc/openser/.openserctlrc.
After setting it up, I am facing the other problem.

I am confused for the below functions in the register method.

        if (!www_authorize("","subscriber")) {

        if (!check_to()) {
                sl_send_reply("401", "Unauthorized");

If openser and mysql are installed in the same machine, above
statement will work.  However, if they are installed in different
machine, about statements will failed.  for example.
openser installed in openser.example.com (
mysql installed in mysql.example.com (
In subscriber table, we have some accounts and the value of domain
field is openser.example.com
What should be filled in the functions
www_authorize("[input]","subscriber")) and
www_challenge("[input]","0") for the above case?  If I fill with
openser.example.com, the above functions will still failed.

On 1/21/06, unplug <maillisting at gmail.com> wrote:
> How does openser connect to mysql which is not in the same machine
> (say openser is in and mysql is in  I have
> configured all mysql statement in the configuration file as
> "mysql://openser:openserrw@" but openser failed to
> start.  Below is the error message from the log.
> Jan 21 14:25:51 owthkems01 /usr/local/sbin/openser[12298]:
> new_connection: Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (2)
> Jan 21 14:25:51 owthkems01 /usr/local/sbin/openser[12298]:
> ERROR:domain_db_init: cannot initialize database connection
> Jan 21 14:25:51 owthkems01 /usr/local/sbin/openser[12298]: ERROR:
> domain:child_init(): Unable to connect to the database
> Jan 21 14:25:51 owthkems01 /usr/local/sbin/openser[12298]:
> ERROR:init_mod_child: Error while initializing module domain, rank 1

More information about the Users mailing list