[Serusers] Running SER in chroot and separating SER with serweb

Atle Samuelsen clona at camaro.no
Tue Feb 17 10:07:50 CET 2004


Im running SER in a jail on FreeBSD. No problems there :-)


- Atle

* zeusng <zeus.ng at isquare.com.au> [040217 08:59]:
> Having playing with for 2 weeks, I get the SER running as I want. The next
> things I am trying are:
> 
> 1. Run SER in chroot mode with MySQL
> 2. Separate SER and serweb on two servers.
> 
> With 1, I have a partially successful config. When I can start SER with
> /usr/sbin/ser -u ser -g ser -t /var/ser, I got
> A. positive result if the DB connection string is
> "sql://ser:heslo@127.0.0.1/ser". 
> 
> B. However, if I use the DB connection string as,
> "sql://ser:heslo@localhost/ser", I got the following error message:
> 
> Feb 16 19:46:09 sip /usr/sbin/ser[2452]: connect_db(): Can't connect to
> local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
> 
> Fair enough, coz SER is in a chroot environment and cannot stat the MySQL
> UNIX socket. There is no /var/ser/var/lib/mysql/mysql.sock. But, what is the
> difference between localhost and 127.0.0.1 here? Both should resolve back to
> 127.0.0.1, right? Why one use UNIX socket and the other use DOMAIN socket?
> Also, should SER open the DB connection before chrooting itself?
> 
> Also, when running in chroot mode, SER cannot use DNS to resolve hostname. I
> get the following errors:
> 
> Feb 16 20:19:03 sip /usr/sbin/ser[2873]: INFO: fifo process starting: 2873 
> Feb 16 20:19:03 sip /usr/sbin/ser[2873]: SER: open_uac_fifo: fifo server up
> at /
> tmp/ser_fifo... 
> Feb 16 21:01:13 sip /usr/sbin/ser[2867]: ERROR: mk_proxy: could not resolve
> host
> name: "iptel.org" 
> Feb 16 21:01:13 sip /usr/sbin/ser[2867]: ERROR: uri2proxy: bad host name in
> URI 
> <sip:gcc008 at iptel.org> 
> Feb 16 21:01:13 sip /usr/sbin/ser[2867]: ERROR: t_forward_nonack: failure to
> add
>  branches 
> Feb 16 21:02:09 sip /usr/sbin/ser[2867]: ERROR: mk_proxy: could not resolve
> host
> name: "iptel.org" 
> Feb 16 21:02:09 sip /usr/sbin/ser[2867]: ERROR: uri2proxy: bad host name in
> URI 
> <sip:gcc008 at iptel.org> 
> 
> This is a result of doing INVITE sip:abcdefg at iptel.org SIP/2.0 from my
> domain. If I put an entry into my chrooted /var/ser/etc/hosts, the request
> goes fine. Is it because of my chroot environment (later in the mail) or I
> have to compile SER in static mode? 
> 
> 
> 2. Have anyone successfully put SER and serweb on different boxes? There is
> no problem connecting to the DB. However, I'm not sure about the
> /tmp/ser_fifo part. I'm not a programmer and can only manage to understand
> php code, no programming. How do I work around the /tmp/ser_fifo when it is
> on another server?
> 
> 
> Chroot environment:
> 
> [root]# ls -lR /var/ser                                                 
> /var/ser:
> total 16
> drwxr-xr-x    2 root     root         4096 Feb 16 19:41 dev
> drwxr-xr-x    3 root     root         4096 Feb 17 17:30 etc
> drwxrwxrwx    2 root     root         4096 Feb 17 17:26 tmp
> 
> /var/ser/dev:
> total 0
> srw-rw-rw-    1 root     root            0 Feb 16 19:41 log
> crw-rw-rw-    1 root     root       1,   3 Feb 11 11:44 null
> crw-r--r--    1 root     root       1,   8 Feb 11 11:45 random
> crw-rw-rw-    1 root     root       1,   5 Feb 11 15:16 zero
> 
> /var/ser/etc:
> total 48
> -rw-r--r--    1 root     root          210 Feb 16 21:08 hosts
> -rw-r--r--    1 root     root          785 Feb 10 17:11 localtime
> -rw-r--r--    1 root     root         5834 Jul  7  2001 protocols
> -rw-r--r--    1 root     root           43 Feb 16 14:52 resolv.conf
> 
> /var/ser/tmp:
> total 0
> prw-rw----    1 ser      ser             0 Feb 17 17:26 ser_fifo
> 
> Chroot resolv.conf:
> Nameserver 127.0.0.1
> 
> And yes, the DNS is running on localhost and happily serving request.
> 
> 
> Any comment?
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
> 




More information about the sr-users mailing list