Use this command to get nginx compiler arguments:
nginx -V
Of cause, you should make sure that nginx command is in your PATH variable.
Use this command to get php compiler arguments:
php -i |grep configure
The php command also need in your PATH, if not, use the absolute path.
Use the below way to get mysql compiler arguments:
cat /usr/local/mysql/bin/mysqlbug | grep CONFIGURE_LINE
By the way, you should find where is your mysqlbug ^__^
2013年4月2日星期二
rsync @ERROR: chroot failed
1. Q: 出現以下這個訊息,
是怎麼一回事?
@ERROR: auth failed on module xxxxx
rsync: connection unexpectedly closed (90 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at
io.c(150)
A: 這是因為密碼設錯了, 無法登入成功, 請再檢查一下 rsyncd.secrets
中的密碼設定, 二端是否一致?
2. Q: 出現以下這個訊息,
是怎麼一回事?
password
file must not be other-accessible
continuing
without password file
Password:
A: 這表示 rsyncd.secrets 的檔案權限屬性不對, 應設為
600
請下 chmod 600 rsyncd.secrets
3. Q: 出現以下這個訊息,
是怎麼一回事?
@ERROR: chroot failed
rsync: connection unexpectedly closed (75 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at
io.c(150)
A: 這通常是您的 rsyncd.conf 中
的 path 路徑所設的那個目錄並不存在所致.
請先用 mkdir 開設好備份目錄.
的 path 路徑所設的那個目錄並不存在所致.
請先用 mkdir 開設好備份目錄.
PHP 升级后phtml 无法访问一例
nginx 配置包含了phtml
location ~ \.(php|phtml) {
fastcgi_pass fastcgi_upstream_p;
fastcgi_index index.php;
include fastcgi_params;
expires off;
}
访问phtml 文件时出现
Access denied ****
权限没有任何问题;
按照错误提示,看了一下php changelog
查看#55181 ,添加了一个参数 security.limit_extensions = .php (估计.php
是默认支持的,所以加没加无影响)
原来的版本是 5.3.3 新环境版本 5.3.10 不用想都明白了。
2013年4月1日星期一
yum 删除mysql-server 时候出错
错误如下:
error reading information on service mysqld: No such file or
directory
Error in PREUN scriptlet in rpm package m
Erasing :
mysql-connector-odbc 8/9
error: %preun(mysql-server-5.0.95-1.el5_7.1.x86_64) scriptlet failed, exit
status 1
原来装的是yum 下来的rpm 包,后面为了测试osa ,删的时候,先把/etc/ini.d/mysqld 删掉了,后面yum remove 的时候就一直报错。
解决方法: 从别处cp 一个mysqld 文件。(如果没猜错,只是判断这个文件是否存在的话,那就更简单了,新建一个可以搞定,没来得及试)
mosquitto 安装记录
wget http://mosquitto.org/files/source/mosquitto-1.0.3.tar.gz
tar -zxvf mosquitto-1.0.3.tar.gz
cd mosquitto-1.0.3
make WITH_TLS_PSK=no (遇到undefined reference to
`SSL_CTX_set_psk_server_callback' ,添加参数WITH_TLS_PSK=no 禁用SSL PSK 支持)
make install prefix=/home/mosquitto
mkdir /home/mosquitto/etc
mv /etc/mosquitto/* /home/mosquitto/etc/
strip /home/mosquitto/bin/*
strip /homo/mosquitto/sbin/*
strip /homo/mosquitto/lib/*
echo "/home/mosquitto/lib/" >> /etc/ld.so.conf
ldconfig -f /etc/ld.so.conf
修改 /homo/mosquitto/etc/mosquitto.conf 用户:
user nobody
(其它参数目前使用默认值)
启动服务(如有服务相关错误,检查/home/mosquitto/mosquitto.log,端口默认1883)
/home/mosquitto/sbin/mosquitto -d -c /home/mosquitto/etc/mosquitto.conf
> /home/mosquitto/mosquitto.log 2>&1
终端测试:
客户端
mosquitto_sub -h SERVERIP -t test
服务器端执行后
/home/mosquitto/bin/mosquitto_pub -t test -m "123456"
客户端会成功收到"123456"
查看Mqtt订阅者运行状况
mosquitto_sub -v -t \$SYS/#
或者细化为其中一个命令
mosquitto_sub -v -t ‘$SYS/broker/clients/active’
redmine submit issue slowly
Why creating or updating an issue is so slow ?!
由 Mickael Fradin 在 超过 3
年 之前添加
Hello, I'm just wondering why mongrel/webrick is so slow to perform certain
tasks while others are extremely fast?!
I'm using mongrel-1.1.5, mysql-5.0.70-r1 and tried at first with webrick with the same result. When i'm editing something in the wiki section for example it's fast, but doing the same thing on issues is extremly slow, around 60s... :-(
I can't figure out what's going on... Below the production.log:
As you can see this is not the DB the problem, but how to detect the problem
?!
Please help me!
If you need more information tell me!
Thanks.
Mike.
I'm using mongrel-1.1.5, mysql-5.0.70-r1 and tried at first with webrick with the same result. When i'm editing something in the wiki section for example it's fast, but doing the same thing on issues is extremly slow, around 60s... :-(
I can't figure out what's going on... Below the production.log:
Processing IssuesController#edit (for 80.xx.xx.xx at 2009-05-18 11:33:19)
[POST]
Parameters: {"time_entry"=>{"comments"=>"", "activity_id"=>"",
"hours"=>""}, "commit"=>"Submit", "action"=>"edit", "id"=>"27",
"notes"=>"", "controller"=>"issues",
"issue"=>{"start_date"=>"2009-05-06", "estimated_hours"=>"",
"priority_id"=>"4", "lock_version"=>"2", "subject"=>"ERREUR
NUMEROTATION OPE DE GAMME", "description"=>"Lorsque l on rajoute une opé la
numerotation recommence a 2 au lieu de s ajoute a la précédente",
"fixed_version_id"=>"", "category_id"=>"", "done_ratio"=>"0",
"due_date"=>"", "assigned_to_id"=>"6", "status_id"=>"1"},
"attachments"=>{"1"=>{"description"=>"", "file"=>""}}}
Redirected to actionshowidAnomalie #27: ERREUR NUMEROTATION OPE DE
GAMME
Completed in 60154ms (DB: 28) | 302 Found
[http://xxx.xxx.fr/issues/27/edit]
Please help me!
If you need more information tell me!
Thanks.
Mike.
回复 (2)
RE: Why creating or updating an issue is so slow ?! - 由 Mickael Fradin 在 超过 3 年 之前添加
Just answering to myself and maybe for people experiencing the same problem
;)
The problem was my email configuration... It wasn't configured well so the script was waiting until the smtp timeout!
Maybe an improvement would be to notify this kind of thing inside the logs ?!
Thank you for this great project!
The problem was my email configuration... It wasn't configured well so the script was waiting until the smtp timeout!
Maybe an improvement would be to notify this kind of thing inside the logs ?!
Thank you for this great project!
RE: Why creating or updating an issue is so slow ?! - 由 michael fox 在 超过一年 之前添加
Thanks. That was very helpful to me too.
(1-2/2)
找到原因,就要找解决方法:(红色字)
Email Configuration
Configuration Directives
This
page is a work in progress, the following configuration directives are only a
partial list.
authentication
The
type of authentication method expected by your service provider.
Valid
settings:
- :login
- :none
(note:
if you set this to
:none
,
you must not include the user_name
and password
settings)delivery_method
The
mail transport method to be used.
Valid
settings:
- :smtp
- :async_smtp
- :sendmail
- :async_sendmail
Asynchronous delivery_methods
The
:async_smtp
and :async_sendmail
use asynchronous sends, which means Redmine
does not wait for the email to be sent to display the next page. SeeAsynchronous Email Delivery for more details.
NB : if
you want to use asynchronous sends, be careful there's a regression in Redmine
2.x which implies a modification of the "smtp_settings" key in
your
config/configuration.yml
. See #11376 for more informations.Example configuration.yml Configurations
Simple Login Authentication (default settings)
# Outgoing email settings
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: smtp.example.net
port: 25
domain: example.net
authentication: :login
user_name: redmine@example.net
password: redmine
development:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: 127.0.0.1
port: 25
domain: example.net
authentication: :login
user_name: redmine@example.net
password: redmine
If
you want to use GMail/Google Apps and other TLS-requiring SMTP servers,
you'll have to add some TLS-related settings :
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: true
address: "smtp.gmail.com"
port: '587'
domain: "smtp.gmail.com"
authentication: :plain
user_name: "your_email@gmail.com"
password: "your_password"
However,
this will only work with "recent" enough ruby and rails versions (1.8.7 patchset
2xx and 2.3.5).
(See #5814 )
(See #5814 )
No Authentication
Example
for an SMTP service provider with no authentication. Note the colon before
none.
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: smtp.knology.net
port: 25
domain: cybersprocket.com
authentication: :none
Using sendmail command
Example
for a unix system that uses the
/usr/sbin/sendmail
command.
production:
email_delivery:
delivery_method: :sendmail
More information
将原来的
delivery_method: :smtp
smtp_settings:
改成:
delivery_method: :async_smtp
async_smtp_settings:
redhat entprise 6.2 配置 multipath
[root@xwumpsdb ~]# yum -y install device-mapper-multipath
[root@xwumpsdb ~]# multipath -v2
Jan 09 10:49:42 | /etc/multipath.conf does not exist, blacklisting all
devices.
Jan 09 10:49:42 | A sample multipath.conf file is located at
Jan 09 10:49:42 |
/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Jan 09 10:49:42
| You can run /sbin/mpathconf to create or modify /etc/multipath.conf
复制一个配置文件到 /etc 下
[root@xwumpsdb ~]# modprobe dm-multipath 加载模块
[root@xwumpsdb ~]# service multipathd start 启动服务
[root@xwumpsdb ~]# multipath -v2 查看设备状态
Jan 09 10:53:42 | mpatha: ignoring map
create: mpathb (36782bcb00066e968000008f84f049685) undef DELL,MD36xxf
size=1.0T features='0' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=1 status=undef
| `- 1:0:0:0 sdb 8:16 undef ready running
|-+- policy='round-robin 0' prio=0 status=undef
| `- 1:0:1:0 sdc 8:32 undef faulty running
|-+- policy='round-robin 0' prio=1 status=undef
| `- 2:0:1:0 sde 8:64 undef ready running
`-+- policy='round-robin 0' prio=0 status=undef
`- 2:0:0:0 sdd 8:48
undef faulty running
[root@xwumpsdb ~]# fdisk -l
再使用fdisk 看,会出现多个盘符
Disk /dev/mapper/mpathbp1 doesn't contain a valid partition
table
Disk /dev/sda: 146.2 GB, 146163105792 bytes
255 heads, 63 sectors/track, 17769 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000080
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 281 2048000 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 281 17770 140483584 83 Linux
Disk /dev/sdb: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x072cb38e
Device Boot Start End Blocks Id System
/dev/sdb1 1 133674 1073736373+ 83 Linux
Disk /dev/sde: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x072cb38e
Device Boot Start End Blocks Id System
/dev/sde1 1 133674 1073736373+ 83 Linux
Disk /dev/mapper/mpathb: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x072cb38e
Device Boot Start End Blocks Id System
/dev/mapper/mpathbp1 1 133674 1073736373+ 83 Linux
Disk /dev/mapper/mpathbp1: 1099.5 GB, 1099506046464 bytes
255 heads, 63 sectors/track, 133673 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
内核参数引发的思考
问题描述:由于步前路,完成剩下的Load Balance 测试,今天玩的是Haproxy。安装和部署
都只是碰到一些小的问题,基本上问题也不是问题了(此类为可通过Google Baidu 轻松解决)。
确认可以正常访问后,分别给两个web server web1 和web2 写了个静态页面,确认可以正常访问后,
在log 服务器上用 ab 做压力测试,按照测试的基准,从100000 请求数的静态页面开始测试
root@log:~# ab -c 10 -n 100000 http://192.168.104.132:80/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.104.132 (be patient)
apr_poll: The timeout specified has expired
(70007)
Total of 6263 requests
completed
只完成了6263 个请求,这年头,瞎猫子碰死老鼠也不容易,因为这个系统是之前测试过Nginx 的,
理论上跟系统没有关系,不然在测试Nginx 并发的时候,就应该暴露了,检查了Haproxy 的配置文件,把
CPU 的相关东西调大一些,测试,错误依旧;进程数调多一些,测试,错误依旧;把Haproxy 超时时间
降低,错误依旧……
吃饭的时候,也没有点头绪,搞技术怕的就是找不到原因,而不是如何解决,中午休息时间,buffer
一下,睡完了起来接着整吧!
后来再想想,看看是不是TCP 连接数的问题,
root@log:~# ab -c 10 -n 100000 http://192.168.104.132:80/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.104.132 (be patient)
Completed 10000 requests
apr_poll: The timeout specified has expired
(70007)
Total of 15836 requests
completed
root@dispatch:/usr/local/haproxy# netstat -ant |grep TIME_WAIT | wc -l
8187
root@dispatch:/usr/local/haproxy# netstat -ant |grep TIME_WAIT | wc
-l
30
以上两次统计TIME_WAIT 连接数的情况是:8187 此时 ab 正在跑, 30 此数据 ab 已跑完15836
后退出。
这个情况让我觉得算是正常吧,TIME_WAIT 自动清除了,连接占用的时间也很少,放弃了查这个TIME_WAIT
相关参数。
于是还是围绕着超时的参数去转悠,找了个内核参数 /proc/sys/net/ipv4/tcp_fin_timeout 默认值是60
将其值
改成30 后,测试数据基本与上面相同,原因也不在这。
这个,情何以堪,随便再找找原因吧,看了一下/var/log/syslog 日志文件,妈呀,
dispatch kernel: [ 9984.162370] nf_conntrack: table
full, dropping packet.
大量的以上信息,我怎么才想着看系统日志,这么
,有了这个,很快就找到原来还是连接数的限制,看了

一下,系统默认的是31732,
root@dispatch:/usr/local/haproxy# cat
/proc/sys/net/ipv4/netfilter/ip_conntrack_max
31732
将其后面加了个0,再跑 ab 测试,这下OK
root@dispatch:/var/log# echo "317320" >
/proc/sys/net/ipv4/netfilter/ip_conntrack_max
耗时 58秒完成ab,结果虽然重要,过程也相当的,如果早看了系统日志,也不至于花上半天的时间摸索。
关于测试结果,这里不是重点,忽略,谨以此作为处理问题的经验罢了。
proftpd 快速增删改用户
以下操作前提是proftp 安装的base 目录为 /home/proftpd
启动proftpd
/home/proftpd/sbin/proftpd -c /home/proftpd/etc/proftpd.conf
或直接
/home/proftpd/sbin/proftpd
新增用户:
/home/proftpd/bin/ftpasswd --name test -file /home/proftpd/etc/ftpd.passwd
--uid 99 --gid 99 --home /var/ftp/test/ --shell /sbin/nologin --passwd
删除用户:
/home/proftpd/bin/ftpasswd --delete-user --name bbb -file
/home/proftpd/etc/ftpd.passwd --uid 600 --gid 600 --home /var/ftp/bb/ --shell
/sbin/nologin --passwd
更改密码:
/home/proftpd/bin/ftpasswd --name bbb --change-password --passwd
proftpd.conf 文件内容修改部分如下:
日志文件路径:
SystemLog /home/proftpd/var/log/proftpd.syslog
TransferLog /home/proftpd/var/log/proftpd.transferlog
密码文件路径:
AuthUserFile /home/proftpd/etc/ftpd.passwd
另外需要确定服务器上的ftp 目录存在和权限。
订阅:
博文 (Atom)
订阅:
博文 (Atom)