download install run opensips you should be operactered as the root or add sudo before the commoneline 1. download from ftp 2. mv downloadfiles to /usr/src and cd /usr/src 3. tar -zxvf opensips-xx-xxx.tar.gz , then mv opensips-xx-xxx.tar.gz opensips 4. cd opensips 5. make all include_modules="db_mysql" 6. make prefix=/usr/local install include_modules=”db_mysql” if you have been install mysql databases,then go to 7,not, please install mysql at first
7. cp /usr/src/opensips/packaging/gentoo/opensips.init /etc/init.d/ 8. cp /usr/src/opensips/modules/db_mysql/db_mysql.so /usr/local/lib/opensips/modules/ 9. cp /usr/src/opensips/scripts/opensipsctl.mysql /usr/local/lib/opensips/opensipsctl/ 10. cp /usr/src/opensips/scripts/opensipsdbctl.mysql /usr/local/lib/opensips/opensipsctl 11. cp -r /usr/src/opensips-1.4.2-notls/scripts/mysql /usr/local/share/opensips/ 12. configuration opensips's files
vim /usr/local/etc/opensips/opensips.cfg /* copy that item,put them under the primitived lines*/ # log_stderror=yes log_stderror=yes /* this is an example,*/ # disable_tcp=yes # loadmodule "db_mysql.so" # loadmodule "auth.so" # loadmodule "auth_db.so" # modparam("usrloc", "db_mode", 2) # modparam("auth_db", "calculate_ha1", yes) # modparam("auth_db", "password_column", "password") # if (!www_authorize("192.168.123.18", "subscriber")) /* 192.168.123.18 is you domain*/ # { # www_challenge("192.168.123.18", "0"); # exit; # }; 13. add # to this line :modparam("usrloc","db_mode",0)
delect this line: # log_stderror=no 14. change opensips's files vi /usr/local/etc/opensips/opensipsctlrc /*copy that item,put them under the primitived lines*/ # SIP_DOMAIN=192.168.123.18 /*192.168.123.18 is you domain*/ SIP_DOMAIN=192.168.123.18 /* like this */ # DBENGINE=MYSQL # DBHOST=localhost # DBNAME=opensips # DB_PATH="/usr/local/etc/opensips/dbtext" # DBRWUSER=opensips # DBRWPW="opensipsrw" # DBROUSER=opensipsro # DBROPW=opensipsro # DBROOTUSER="root" # USERCOL="username" # ALIASES_TYPE="DB" # CTLENGINE="FIFO" # VERIFY_ACL=1 # ACL_GROUPS="local ld int voicemail free-pstn" # VERBOSE=1 15. create databases if you install for the first time : /usr/local/sbin/opensipsdbctl create [root@localhost sbin]# ./opensipsdbctl create MySQL password for root: /* nothing to do ,press Enter*/ INFO: test server charset INFO: creating database opensips … INFO: Core OpenSIPS tables succesfully created. /* and so on */ or you machines has been install opensips: /usr/local/sbiun/opensipsctl migrate
16. configuration the users: /usr/local/sbin/opensipsctl start /usr/local/sbin/opensipsctl add <username> <passwd> /* /usr/local/sbin/opensipsctl add 1001 1001 */
|
|
来自: shangat > 《Linux 文章》