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

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Jan 23 13:19:22 CET 2006


Hi,

be sure that all module you are using have the db_url parameter properly 
set (if param available). By default, the value of this param is 
pointing to localhost.


unplug wrote:

>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")) {
>                www_challenge("","0");
>                return;
>        };
>
>
>        if (!check_to()) {
>                sl_send_reply("401", "Unauthorized");
>                return;
>        };
>
>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 (10.0.0.1)
>mysql installed in mysql.example.com (10.0.0.2)
>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.
>  
>
the first parameter may be the domain name used for authentication - it 
order to work, it must be the same as the domain the users are 
subscribed with (see domain column in subscriber table).


regards,
bogdan

>
>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 10.0.0.1 and mysql is in 10.0.0.2)?  I have
>>configured all mysql statement in the configuration file as
>>"mysql://openser:openserrw@10.0.0.2/openser" 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
>>
>>    
>>
>
>_______________________________________________
>Users mailing list
>Users at openser.org
>http://openser.org/cgi-bin/mailman/listinfo/users
>
>  
>





More information about the sr-users mailing list