Compiling opensips using the connection source installed MySQL

Source: Internet
Author: User
Tags openssl syslog

Due to the project requirements, the low version of MySQL does not meet our needs in performance, and now needs to be replaced with a higher version of MySQL 5.5.44. New version of MySQL 5.5.44 in performance, compared to the CentOS 5.11 comes with the low version of MySQL 5.0.95, at least one times higher.


MySQL 5.5.44 installation, we do not use the source code installation, but directly using the compiled version.

Yum -y install gcc gcc-devel gcc-c++ gcc-c++-devel libaio-devel boost  boost-devel autoconf* automake* zlib* libxml* ncurses-devel ncurses  libgcrypt* libtool* cmake openssl openssl-devel bison bison-devel  unzipgroupadd -g 10001 mysql useradd -u 10001 -s /sbin/nologin -d  /dev/null -g mysql mysqlmkdir /datawget http://mirrors.sohu.com/mysql/mysql-5.5 /mysql-5.5.44-linux2.6-x86_64.tar.gztar zxf mysql-5.5.44-linux2.6-x86_64.tar.gzmv  mysql-5.5.44-linux2.6-x86_64 /data/mysql5.5.44echo  "127.0.0.1  $HOSTNAME" >>/etc/hostschown  -r mysql.mysql /data/mysql5.5.44/data/data/mysql5.5.44/scripts/mysql_install_db --user= mysql --group=mysql --basedir=/data/mysql5.5.44  --datadir=/data/mysql5.5.44/datacp / Data/mysql5.5.44/support-files/my-medium.cnf /etc/my.cnfcp /data/mysql5.5.44/support-files/mysql.server /etc/init.d/mysqldsed  -i  ' s#^basedir=$ #basedir =/data/mysql5.5.44#g '  /etc/init.d/mysqldsed -i  ' s#^datadir=$# Datadir=/data/mysql5.5.44/data#g '  /etc/init.d/mysqldchmod 750 /etc/init.d/mysqldservice  Mysqld startln -s /data/mysql5.5.44/bin/* /usr/bin/mysqladmin -uroot password  123456mysql -uroot -p123456 -e  ' delete from mysql.user where  Password= "" ' mysql -uroot -p123456 -e  ' drop database test '

The above MySQL has been installed and used normally.


Source installation See: http://fengwan.blog.51cto.com/508652/1363566


Now compile and install opensips, you will find that cannot compile

This is because Opensips can't find the MySQL library, if Yum installs at least MySQL and mysql-devel.

We don't have Yum installed here, because MySQL is already installed.

Ln-s/data/mysql5.5.44/bin/*/usr/bin/ln-s/data/mysql5.5.44/include//usr/include/mysqlln-s/data/mysql5.5.44/lib/ /usr/lib64/mysqlln-s/data/mysql5.5.44/lib/*/usr/lib64/

The above library and include file soft link can be normal.

Yum -y install gcc make zlib-devel wget yum -y install flex  bison ncurses-devel openssl-develyum -y install lynx svn libxsltwget  http://opensips.org/pub/opensips/1.11.5/src/opensips-1.11.5-latest_src.tar.gztar zxf  Opensips-1.11.5-latest_src.tar.gzcd opensips-1.11.5-tls/make prefix=/data/opensips1.11.5 all  include_modules= "Db_mysql"  make prefix=/data/opensips1.11.5 install include_modules= "Db_mysql" cdsed -i  ' s/\# dbengine=mysql/dbengine=mysql/g '  /data/opensips1.11.5/etc/ opensips/opensipsctlrc sed -i  ' s/\# dbhost=localhost/dbhost=localhost/g '  /data/ opensips1.11.5/etc/opensips/opensipsctlrcsed -i  ' s/\# dbname=opensips/dbname=opensips/g '  / data/opensips1.11.5/etc/opensips/opensipsctlrc sed -i  ' s/\# dbrwuser=opensips/dbrwuser= Opensips/g '  /data/opensips1.11.5/etc/opensips/opensipsctlrc sed -i  ' s/\# dbrwpw= "OPENSIPSRW"/dbrwpw= "OPENSIPSRW"/g " / data/opensips1.11.5/etc/opensips/opensipsctlrc sed -i  ' s/\# dbrootuser= "root"/DBROOTUSER= " Root "/g '  /data/opensips1.11.5/etc/opensips/opensipsctlrc ln -s /data/opensips1.11.5/etc/ opensips/ /etc/echo  ' export path= $PATH:/data/opensips1.11.5/sbin/'  >>/etc/ profilesource /etc/profile/data/opensips1.11.5/sbin/opensipsdbctl create/data/opensips1.11.5/sbin/ osipsconfig rm -f /data/opensips1.11.5/etc/opensips/opensips.cfgmv /data/opensips1.11.5/ etc/opensips/opensips_residential_*.cfg /data/opensips1.11.5/etc/opensips/opensips.cfgsed -i  ' s /disable_tcp=no/disable_tcp=yes/g '  /data/opensips1.11.5/etc/opensips/opensips.cfg sed -i  ' S/listen=udp:127.0.0.1:5060/listen=udp:eth0:5060/g '  /data/opensips1.11.5/etc/opensips/opensips.cfg  sed -i  ' s#mpath= '/USr/local/lib/opensips/modules/"#mpath ="/data/opensips1.11.5/lib64/opensips/modules/"#g '  /data/ opensips1.11.5/etc/opensips/opensips.cfg sed -i -e  '/modparam ("uri",  "use_uri_table",  0)/a\modparam ("uri",  "Db_url", "mysql://opensips:[email protected]/opensips") '  /data/ opensips1.11.5/etc/opensips/opensips.cfg echo  "Local0.* /var/log/opensips.log"  >>  /etc/syslog.conf service syslog restart mysql -uroot -p123456 -e   "Insert into opensips.domain (domain)  values (' 192.168.1.245 ')"   #192.168.1.245 for your SIP domain, can be for ipcp /root/opensips-1.11.5-tls/packaging/fedora/opensips.init /etc/init.d/opensips sed  -i  ' s#cfgdir= "/etc/$prog" #cfgdir = "/data/opensips1.11.5/etc/$prog" #g '  /etc/init.d/opensipssed -i   ' s#opensips=/usr/sbin/$prog #opensips=/data/opensips1.11.5/sbin/$prog #g '  /etc/init.d/opensips  Chmod +x /etc/init.d/opensips groupadd opensips useradd -g opensips -s /sbin/nologin -d / Dev/null opensips service opensips start

If you do not understand, see http://fengwan.blog.51cto.com/508652/1655265


If you start Opensips, it appears.

error:core:sr_load_module: could not open modu                                                            le </data/opensips1.11.5/lib64/opensips/modules/db_mysql.so>: libmysqlclient.so.                                                            18: cannot open shared object file: No such file or  Directory 

Run

Ln-s/data/mysql5.5.44/lib/*/usr/lib64/

Link the library to

This article is from "Maple Night" blog, please be sure to keep this source http://fengwan.blog.51cto.com/508652/1669752

Compiling opensips using the connection source installed MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.