opensips源码可以从官网下载。

编译安装

$ tar -xzvf opensips-2.2.2.tar.gz
$ cd opensips-2.2.2/
$ sudo make menuconfig

menuconfig中选择--->Configure Compile Options---> Configure Excluded Modules
,方向键向下滚动,按空格选中[*] db_MysqL。按q键返回上一级,选择---> Configure Install Prefix,输入/usr/local/opensips_proxy后按回车(表示安装在/usr/local/opensips_proxy目录下)。 选择---> Save Changes保存修改,按q返回,选择---> Compile And Install OpenSIPS,回车安装。

安装完成后会将配置文件放在/usr/local/opensips_proxy/etc/opensips目录下,运行文件在/usr/local/opensips_proxy/sbin目录下。如果出现依赖错误,先通过apt-get安装依赖。源代码安装软件要注意查看READMEINSTALL等文件,这些文件里有很重要的说明和安装信息,里面有安装Opensips所需要的依赖包。

opensips安装之后的文件目录:

sbin/中的可执行命令:opensipsopensipsctlopensipsdbctlopensipsunixosipsconfigosipsconsole
etc/opensips/中的配置文件:opensips.cfgopensipsctlrcosipsconsolerc
lib/opensips/中的库文件:modulesopensipsctl两个目录,modules为当前opensips所支持的模块。

opensips配置

opensips的配置文件都在/etc/opensips/中,分别为opensips.cfgopensipsctlrcosipsconsolerc

opensips.cfg

opensips.cfg文件主要用于opensips启动的配置,所有应用功能的配置都在这个文件中说明。该配置文件主要由三个部分组成:

a、全局变量,例如:

listen=udp:127.0.0.1:5060
disable_tcp=yes
disable_tls=yes

b、设置加载模块相应参数,如:

loadmodule “db_MysqL.so”
loadmodule “auth.so”
loadmodule “auth_db.so”
modparam(“auth”,“calculate_ha1”,yes)
modparam(“auth_db”,“password_column”,“password”)

c、路由策略和功能应用,如:

route[relay] {

# for INVITEs enable some additional helper routes
if (is_method(“INVITE”)) {
t_on_branch(“per_branch_ops”);
t_on_reply(“handle_nat”);
t_on_failure(“missed_call”);
}

opensipsctlrc

opensipsctlrc文件中包含了数据库配置的信息。

进入/usr/local/opensips_proxy/etc/opensips目录,运行osipsconfig命令,依次选择---> Generate OpenSIPS Script —> Residential Script —> Configure Residential Script,选中如下几项:

[*] ENABLE_TCP
[*] USE_ALIASES
[*] USE_AUTH
[*] USE_DBACC
[*] USE_DBUSRLOC
[*] USE_DIALOG
[*] USE_NAT

q返回,选择---> Generate Residential Script回车,生成新的配置文件。按q(三次)退出命令,将新生成的opensips_residential_*.cfg文件重命名为opensips.cfg,并编辑。

总共改动了3处:

#
# $Id$
#
# OpenSIPS residential configuration script
# by OpenSIPS Solutions <team@opensips-solutions.com>
#
# This script was generated via "make menuconfig",from
#   the "Residential" scenario.
# You can enable / disable more features / functionalities by
#   re-generating the scenario with different options.#
#
# Please refer to the Core CookBook at:
#  http://www.opensips.org/Resources/DocsCookbooks
# for a explanation of possible statements,functions and parameters.
#

####### Global Parameters #########

debug=3
log_stderror=no
log_facility=LOG_LOCAL0

fork=yes
children=4

/* uncomment the following lines to enable debugging */
#debug=6
#fork=no
#log_stderror=yes

/* uncomment the next line to enable the auto temporary blacklisting of
not available destinations (default disabled) */
#disable_dns_blacklist=no

/* uncomment the next line to enable IPv6 lookup after IPv4 dns
lookup failures (default disabled) */
#dns_try_ipv6=yes

/* comment the next line to enable the auto discovery of local aliases
based on revers DNS on IPs */
auto_aliases=no

改动第1处
xxx.xxx.xxx.xxx.xxx是你自己的IP地址,不可以写为127.0.0.1

listen=udp:xxx.xxx.xxx.xxx:5060   # CUSTOMIZE ME
listen=tcp:xxx.xxx.xxx.xxx:5060   # CUSTOMIZE ME

####### Modules Section ########

#set module path
mpath="/usr/local/opensips_proxy//lib64/opensips/modules/"

#### SIGNALING module
loadmodule "signaling.so"

#### StateLess module
loadmodule "sl.so"

#### Transaction Module
loadmodule "tm.so"
modparam("tm","fr_timeout",5)
modparam("tm","fr_inv_timeout",30)
modparam("tm","restart_fr_on_each_reply",0)
modparam("tm","onreply_avp_mode",1)

#### Record Route Module
loadmodule "rr.so"
/* do not append from tag to the RR (no need for this script) */
modparam("rr","append_fromtag",0)

#### MAX ForWarD module
loadmodule "maxfwd.so"

#### SIP MSG OPerationS module
loadmodule "sipmsgops.so"

#### FIFO Management Interface
loadmodule "mi_fifo.so"
modparam("mi_fifo","fifo_name","/tmp/opensips_fifo")
modparam("mi_fifo","fifo_mode",0666)

#### URI module
loadmodule "uri.so"
modparam("uri","use_uri_table",0)
modparam("uri","db_url","MysqL://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

#### MysqL module
loadmodule "db_MysqL.so"

#### USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc","nat_bflag","NAT")
modparam("usrloc","db_mode",2)
modparam("usrloc","MysqL://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

#### REGISTRAR module
loadmodule "registrar.so"
modparam("registrar","tcp_persistent_flag","TCP_PERSISTENT")
modparam("registrar","received_avp","$avp(received_nh)")
/* uncomment the next line not to allow more than 10 contacts per AOR */
#modparam("registrar","max_contacts",10)

#### ACCounting module
loadmodule "acc.so"
/* what special events should be accounted ? */
modparam("acc","early_media",0)
modparam("acc","report_cancels",0)
/* by default we do not adjust the direct of the sequential requests.
if you enable this parameter,be sure the enable "append_fromtag"
in "rr" module */
modparam("acc","detect_direction","Failed_transaction_flag","ACC_Failed")
/* account triggers (flags) */
modparam("acc","db_flag","ACC_DO")
modparam("acc","db_missed_flag","ACC_MISSED")
modparam("acc","MysqL://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

#### AUTHentication modules
loadmodule "auth.so"
loadmodule "auth_db.so"
modparam("auth_db","calculate_ha1",yes)
modparam("auth_db","password_column","password")
modparam("auth_db|uri","MysqL://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME
modparam("auth_db","load_credentials","")

#### ALIAS module
loadmodule "alias_db.so"
modparam("alias_db","MysqL://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

#### DIALOG module
loadmodule "dialog.so"
modparam("dialog","dlg_match_mode",1)
modparam("dialog","default_timeout",21600)  # 6 hours timeout
modparam("dialog",2)
modparam("dialog","MysqL://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

####  NAT modules
loadmodule "nathelper.so"
modparam("nathelper","natping_interval",10)
modparam("nathelper","ping_nated_only",1)
modparam("nathelper","sipping_bflag","SIP_PING_FLAG")
modparam("nathelper","sipping_from","sip:pinger@127.0.0.1") #CUSTOMIZE ME
modparam("nathelper","$avp(received_nh)")

改动第2处
端口号22222可以随便修改,但是必须和后面安装的rtpproxy的端口号相同

loadmodule "rtpproxy.so"
modparam("rtpproxy","rtpproxy_sock","udp:localhost:22222") # CUSTOMIZE ME

改动第3处
增加MediaProxy模块,增加下边这一段

#### MediaProxy module
loadmodule "mediaproxy.so"
modparam("mediaproxy","disable",0)
modparam("mediaproxy","mediaproxy_socket","/var/run/mediaproxy/dispatcher.sock")
modparam("mediaproxy","mediaproxy_timeout",1000)
modparam("mediaproxy","signaling_ip_avp","$avp(nat_ip)")
modparam("mediaproxy","media_relay_avp","$avp(media_relay)")
modparam("mediaproxy","ice_candidate","low-priority")

loadmodule "proto_udp.so"

loadmodule "proto_tcp.so"

####### Routing Logic ########

# main request routing logic

route{
force_rport();
if (nat_uac_test("23")) {
if (is_method("REGISTER")) {
fix_nated_register();
setbflag(NAT);
} else {
fix_nated_contact();
setflag(NAT);
}
}

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {

# validate the sequential request against dialog
if ( $DLG_status!=NULL && !validate_dialog() ) {
xlog("In-Dialog $rm from $si (callid=$ci) is not valid according to dialog\n");
## exit;
}

if (is_method("BYE")) {
setflag(ACC_DO); # do accounting ...
setflag(ACC_Failed); # ... even if the transaction fails
} else if (is_method("INVITE")) {
# even if in most of the cases is useless,do RR for
# re-INVITEs alos,as some buggy clients do change route set
# during the dialog.
record_route();
}

if (check_route_param("nat=yes"))
setflag(NAT);

# route it out to whatever destination was set by loose_route()
# in $du (destination URI).
route(relay);
} else {

if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# non loose-route,but stateful ACK; must be an ACK after
# a 487 or e.g. 404 from upstream server
t_relay();
exit;
} else {
# ACK without matching transaction ->
# ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}

# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}

t_check_trans();

if ( !(is_method("REGISTER")  ) ) {

if (from_uri==myself)

{

# authenticate if from local subscriber
# authenticate all initial non-REGISTER request that pretend to be
# generated by local subscriber (domain from FROM URI is local)
if (!proxy_authorize("","subscriber")) {
proxy_challenge("","0");
exit;
}
if (!db_check_from()) {
sl_send_reply("403","Forbidden auth ID");
exit;
}

consume_credentials();
# caller authenticated

} else {
# if caller is not local,then called number must be local

if (!uri==myself) {
send_reply("403","Rely forbidden");
exit;
}
}

}

# preloaded route checking
if (loose_route()) {
xlog("L_ERR","Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");
exit;
}

# record routing
if (!is_method("REGISTER|MESSAGE"))
record_route();

# account only INVITEs
if (is_method("INVITE")) {

# create dialog with timeout
if ( !create_dialog("B") ) {
send_reply("500","Internal Server Error");
exit;
}

setflag(ACC_DO); # do accounting
}

if (!uri==myself) {
append_hf("P-hint: outbound\r\n");

route(relay);
}

# requests for my domain

if (is_method("PUBLISH|SUBSCRIBE"))
{
sl_send_reply("503","Service Unavailable");
exit;
}

if (is_method("REGISTER"))
{
# authenticate the REGISTER requests
if (!www_authorize("","subscriber"))
{
www_challenge("","0");
exit;
}

if (!db_check_to())
{
sl_send_reply("403","Forbidden auth ID");
exit;
}

if ( proto==TCP ||  0 ) setflag(TCP_PERSISTENT);

if (isflagset(NAT)) {
setbflag(SIP_PING_FLAG);
}

if (!save("location"))
sl_reply_error();

exit;
}

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}

# apply DB based aliases
alias_db_lookup("dbaliases");

# do lookup with method filtering
if (!lookup("location","m")) {
if (!db_does_uri_exist()) {
send_reply("420","Bad Extension");
exit;
}

t_newtran();
t_reply("404","Not Found");
exit;
}

if (isbflagset(NAT)) setflag(NAT);

# when routing via usrloc,log the missed calls also
setflag(ACC_MISSED);
route(relay);
}

route[relay] {
# for INVITEs enable some additional helper routes
if (is_method("INVITE")) {

if (isflagset(NAT)) {
rtpproxy_offer("ro");
}

t_on_branch("per_branch_ops");
t_on_reply("handle_nat");
t_on_failure("missed_call");
}

if (isflagset(NAT)) {
add_rr_param(";nat=yes");
}

if (!t_relay()) {
send_reply("500","Internal Error");
};
exit;
}

branch_route[per_branch_ops] {
xlog("new branch at $ru\n");
}

onreply_route[handle_nat] {
if (nat_uac_test("1"))
fix_nated_contact();
if ( isflagset(NAT) )
rtpproxy_answer("ro");
xlog("incoming reply\n");
}

failure_route[missed_call] {
if (t_was_cancelled()) {
exit;
}

# uncomment the following lines if you want to block client
# redirect based on 3xx replies.
##if (t_check_status("3[0-9][0-9]")) {
##t_reply("404","Not found");
##  exit;
##}

}

local_route {
if (is_method("BYE") && $DLG_dir=="UPSTREAM") {

acc_db_request("200 Dialog Timeout","acc");

}
}

修改opensipsctlrc文件,去掉所有DB相关的注释。

# $Id$
#
# The OpenSIPS configuration file for the control tools.
#
# Here you can set variables used in the opensipsctl and opensipsdbctl setup
# scripts. Per default all variables here are commented out,the control tools
# will use their internal default values.

## your SIP domain
SIP_DOMAIN=xxx.xxx.xxx.xxx  #你自己的IP地址

## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"

## database type: MysqL,PGsql,ORACLE,DB_BERKELEY,or DBTEXT,## by default none is loaded
# If you want to setup a database with opensipsdbctl,you must at least specify
# this parameter.
DBENGINE=MysqL

## database host
DBHOST=localhost

## database name (for ORACLE this is TNS name)
dbnAME=opensips

# database path used by dbtext or db_berkeley
# DB_PATH="/usr/local/etc/opensips/dbtext"

## database read/write user
DBRWUSER=opensips

## password for database read/write user
DBRWPW="opensipsrw"

## database super user (for ORACLE this is 'scheme-creator' user)
DbroOTUSER="root"

# user name column
# USERCOL="username"

opensips新建数据库,增加域名及用户:

cd /usr/local/opensips_proxy/sbin/
sudo ./opensipsdbctl create
sudo ./opensipsctl domain add xdty.org #如果没有域名可不用添加
sudo ./opensipsctl add 10000 123456
sudo ./opensipsctl add 10001 123456

安装配置rtpproxy

$ sudo apt-get install rtpproxy
$ sudo vi /etc/default/rtpproxy

修改为如下内容

# Defaults for rtpproxy

# The control socket.
#CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock"
# To listen on an UDP socket,uncomment this line:
CONTROL_SOCK=udp:127.0.0.1:22222

# Additional options that are passed to the daemon.
EXTRA_OPTS=""
LISTEN_ADDR=xxx.xxx.xxx.xxx #你自己的IP地址
EXTRA_OPTS="-l ${LISTEN_ADDR}"

启动rtpproxy

$ sudo killall rtpproxy
$ sudo /etc/init.d/rtpproxy start

如果rtpproxy启动失败,请检查/etc/init.d/rtpproxy脚本DAEMON路径是否正确,默认DAEMON=/usr/sbin/$NAME,可能要改为DAEMON=/usr/bin/$NAME

安装配置mediaproxy

导入源密钥,增加mediaproxy的源到/etc/apt/sources.list

$ wget http://download.ag-projects.com/agp-debian-gpg.key
$ sudo apt-key add agp-debian-gpg.key
$ sudo vi /etc/apt/sources.list

最后位置添加

deb http://ag-projects.com/ubuntu precise main
deb-src http://ag-projects.com/ubuntu precise main

安装mediaproxy

$ sudo apt-get update
$ sudo apt-get install mediaproxy-dispatcher mediaproxy-relay mediaproxy-web-sessions

media-relay需要内核支持ipv4 forwarding,所以需要执行(以root用户执行):

$ sudo su
$ echo 1 > /proc/sys/net/ipv4/ip_forward

注意:可以vi /proc/sys/net/ipv4/ip_forward查看里面是否为1,有时候还是为0,如果此时为0,继续执行一遍echo 1 > /proc/sys/net/ipv4/ip_forward,直到里面的内容为1。在文件/etc/sysctl.config中打开net.ipv4.ip_forward=1,这样即便重启设备也可以运行mediaproxy了。

另外,mediadispatcherrelay之间需要通过tls通信,故需要在/etc/mediaproxy/tls/中有认证文件,进入/etc/mediaproxy/tls目录,拷本密钥文件,修改配置文件。

$ cd /etc/mediaproxy/tls/
$ sudo cp /usr/share/doc/mediaproxy-common/tls/* .
$ cd ..
$ sudo vi config.ini

修改为类似如下内容

[Relay]
dispatchers = xxx.xxx.xxx.xxx #你自己的地址
passport = None
relay_ip = xxx.xxxx.xxx.xxx #你自己的IP地址
port_range = 50000:60000
log_level = DEBUG
stream_timeout = 90
on_hold_timeout = 7200
reconnect_delay = 10
traffic_sampling_period = 15
[dispatcher]
socket_path = dispatcher.sock
listen = xxx.xxx.xxx.xxx
listen_management = xxx.xxx.xxx.xxx #你自己的IP地址
management_use_tls = yes
passport = None
management_passport = None
log_level = DEBUG
relay_timeout = 5
[TLS]
certs_path = tls
verify_interval = 300
[Database]
[Radius]
[OpenSIPS]
socket_path = /var/run/opensips/socket
max_connections = 10

启动mediaproxy服务

$ sudo media-dispatcher restart
$ sudo media-relay restart

或者:

$ sudo service mediaproxy-dispatcher restart
$ sudo service mediaproxy-relay restart

查看mediaproxy是否正常运行:

$ ps -ef | grep media
root  6592  2110  0 14:25 ?00:00:01 /usr/bin/python /usr/bin/media-dispatcher restart
root  6969  2110  0 14:35 ?00:00:04 /usr/bin/python /usr/bin/media-relay restart

则说明已经正常启动。如果没有正常启动可以在/var/log/syslog中查看原因。

启动服务并检验

opensips的日志保存在/var/log/opensips.log,修改日志文件配置。

$ sudo touch /var/log/opensips.log
$ sudo chmod 777 /var/log/opensips.log
$ sudo vi /etc/rsyslog.d/opensips.conf

增加如下内容

local0.* /var/log/opensips.log

重启syslog服务,启动opensips

$ sudo service rsyslog restart
$ sudo /usr/local/opensips_proxy/sbin/opensipsctl start

如果启动失败,查看/var/log/opensips.log文件查找错误.

服务启动后,防火墙开启tcpudp的端口

$ iptables -I INPUT -p tcp –dport 5060 -j ACCEPT
$ iptables -I INPUT -p udp –dport 5060 -j ACCEPT
$ iptables-save

现在可以用SIP客户端登录上面创建的帐号,测试了。

参考文章

ubuntu下opensips安装配置
基于ubuntu中使用mysql实现opensips用户认证的解决方法
Realtime OpenSIPS - Asterisk Integration

ubuntu下安装配置opensips的更多相关文章

  1. 从iOS应用程序发送帖子到PHP脚本不工作…简单的解决方案就像

    我之前已经做了好几次了但是由于某些原因我无法通过这个帖子…我尝试了设置为_POST且没有的变量的PHP脚本……当它们未设置为发布时它工作精细.这是我的iOS代码:这里是PHP的一大块,POST变量不在正确的位置?我想这对于更有经验的开发人员来说是一个相当简单的答案,感谢您的帮助!解决方法$_POST是一个数组,而不是一个函数.您需要使用方括号来访问数组索引:

  2. Android – 将SQLite与MySQL同步的最佳方式

    参见英文答案>Synchronizingclient-serverdatabases5个我正在开发一个包含网络应用和移动应用程序的项目,该应用程序记录每日用户的数据.用户可以删除,更新他们的数据,他们可以使用许多设备插入数据.我打算这样开发:用户输入他们的数据然后插入sqlite.服务将定期启动(每5小时或每小时)以使用时间戳与MysqL同步.我确实在互联网上使用服务和时间戳搜索了一个样本,但我一

  3. android – 如何将唯一的GCM注册标识存储到MySQL中

    我正在设置GoogleCloudMessaging机制的服务器端,使用MySQL存储移动应用提供的注册ID.Google可以发出最多4k个注册码,我被迫将其存储在TEXT字段中.所有的好,到目前为止,问题是我必须处理这样的情况:>用户登录到应用程序>该应用从google请求注册ID>应用程序将新的注册ID发送到应用服务器>服务器存储该注册ID并将其链接到当前登录的用户>该用户注销并且新用户登录>应

  4. nodeJs链接Mysql做增删改查的简单操作

    本篇文章主要介绍了nodeJs链接Mysql做增删改查的简单操作,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

  5. PHP连接MYSQL数据库的3种常用方法

    这篇文章主要介绍了PHP连接MYSQL数据库的3种常用方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

  6. PHP使用PDO创建MySQL数据库、表及插入多条数据操作示例

    这篇文章主要介绍了PHP使用PDO创建MySQL数据库、表及插入多条数据操作,结合实例形式总结分析了php基于pdo的mysql数据库创建、数据表创建以及多条数据插入操作相关实现技巧,需要的朋友可以参考下

  7. MybatisPlus如何处理Mysql的json类型

    这篇文章主要介绍了MybatisPlus如何处理Mysql的json类型,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

  8. 基于PHP+mysql实现新闻发布系统的开发

    这篇文章主要介绍了基于PHP+mysql实现新闻发布系统的开发,文章通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

  9. nodejs操作mysql实现增删改查的实例

    下面小编就为大家带来一篇nodejs操作mysql实现增删改查的实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

  10. NodeJs使用Mysql模块实现事务处理实例

    本篇文章主要介绍了NodeJs使用Mysql模块实现事务处理 ,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

随机推荐

  1. crontab发送一个月份的电子邮件

    ubuntu14.04邮件服务器:Postfixroot收到来自crontab的十几封电子邮件.这些邮件包含PHP警告.>我已经解决了这些警告的原因.>我已修复每个cronjobs不发送电子邮件(输出发送到>/dev/null2>&1)>我删除了之前的所有电子邮件/var/mail/root/var/spool/mail/root但我仍然每小时收到十几封电子邮件.这些电子邮件来自cronjobs,

  2. 模拟两个ubuntu服务器计算机之间的慢速连接

    我想模拟以下场景:假设我有4台ubuntu服务器机器A,B,C和D.我想在机器A和机器C之间减少20%的网络带宽,在A和B之间减少10%.使用网络模拟/限制工具来做到这一点?

  3. ubuntu-12.04 – 如何在ubuntu 12.04中卸载从源安装的redis?

    我从源代码在Ubuntu12.04上安装了redis-server.但在某些时候它无法完全安装,最后一次makeinstallcmd失败.然后我刚刚通过apt包安装.现在我很困惑哪个安装正在运行哪个conf文件?实际上我想卸载/删除通过源安装的所有内容,只是想安装一个包.转到源代码树并尝试以下命令:如果这不起作用,您可以列出软件自行安装所需的步骤:

  4. ubuntu – “apt-get source”无法找到包但“apt-get install”和“apt-get cache”可以找到它

    我正在尝试下载软件包的源代码,但是当我运行时它无法找到.但是当我运行apt-cache搜索squid3时,它会找到它.它也适用于apt-getinstallsquid3.我使用的是Ubuntu11.04服务器,这是我的/etc/apt/sources.list我已经多次更新了.我尝试了很多不同的debs,并没有发现任何其他地方的错误.这里的问题是你的二进制包(deb)与你的源包(deb-src)不

  5. ubuntu – 有没有办法检测nginx何时完成正常关闭?

    &&touchrestarted),因为即使Nginx没有完成其关闭,touch命令也会立即执行.有没有好办法呢?这样的事情怎么样?因此,pgrep将查找任何Nginx进程,而while循环将让它坐在那里直到它们全部消失.你可以改变一些有用的东西,比如睡1;/etc/init.d/Nginx停止,以便它会休眠一秒钟,然后尝试使用init.d脚本停止Nginx.你也可以在某处放置一个计数器,这样你就可以在需要太长时间时发出轰击信号.

  6. ubuntu – 如何将所有外发电子邮件从postfix重定向到单个地址进行测试

    我正在为基于Web的应用程序设置测试服务器,该应用程序发送一些电子邮件通知.有时候测试是使用真实的客户数据进行的,因此我需要保证服务器在我们测试时无法向真实客户发送电子邮件.我想要的是配置postfix,以便它接收任何外发电子邮件并将其重定向到一个电子邮件地址,而不是传递到真正的目的地.我正在运行ubuntu服务器9.10.先感谢您设置本地用户以接收所有被困邮件:你需要在main.cf中添加:然后

  7. ubuntu – vagrant无法连接到虚拟框

    当我使用基本的Vagrantfile,只配置了两条线:我看到我的虚拟框打开,但是我的流氓日志多次显示此行直到超时:然后,超时后的一段时间,虚拟框框终于要求我登录,但是太久了!所以我用流氓/流氓记录.然后在我的物理机器上,如果我“流氓ssh”.没有事情发生,直到:怎么了?

  8. ubuntu – Nginx – 转发HTTP AUTH – 用户?

    我和Nginx和Jenkins有些麻烦.我尝试使用Nginx作为Jenkins实例的反向代理,使用HTTP基本身份验证.它到目前为止工作,但我不知道如何传递带有AUTH用户名的标头?}尝试将此指令添加到您的位置块

  9. Debian / Ubuntu – 删除后如何恢复/ var / cache / apt结构?

    我在ubuntu服务器上的空间不足,所以我做了这个命令以节省空间但是现在在尝试使用apt时,我会收到以下错误:等等显然我删除了一些目录结构.有没有办法做apt-getrebuild-var-tree或类似的?

  10. 检查ubuntu上安装的rubygems版本?

    如何查看我的ubuntu盒子上安装的rubygems版本?只是一个想法,列出已安装的软件包和grep为ruby或宝石或其他:)dpkg–get-selections

返回
顶部