寻觅生命中的那一片浅草......

文章带标签 Linux

Acronis for Linux的snapapi module安装错误

Acronis True Image Server has not found precompiled snapapi module for running kernel. It is suggested to compile it now.
You may choose “Skip” and compile snapapi module later. Please read readme.txt and HOWTO.INSTALL for compile instructions.
Acronis True Image Server Setup failed to build kernel modules. Consult /var/log/trueimage-setup.log  and /var/lib/dkms/snapapi26/0.7.10/build/make.log for error messages.  Launching ‘/usr/sbin/dkms ldtarball –force –archive

今天在CentOS5上安装Acronis.True.Image.Server.v9.1.3530.Linux出现以上错误,网上查找了资料,说要安装kernel-devel和kernel-hearders,于是就yum -y install kernel-devel kernel-hearders,安装好后,发现依然不可以。

用rpm -qa |grep kernel查看了几个包,发现kernel的版本是2.6.18-8,而kernel-devel和kernel-hearders是2.6.18-128,用yum -y install kernel-2.6.18-128安装新内核,并用 kernel-2.6.18-128内核启动,安装Acronis一切顺利。但创建acronis secure zone出现问题,查找了一些网上的资料,对acronis secure zone的要求有以下2点:
1、必须是主分区,不能是逻辑分区
2、不支持在使用了LVM的分区上通过调整分区大小来创建secure zone

分区规划好才是王道啊!

CentOS 5.3下安装ispCP后proftpd启动失败和无法登陆的故障

在CentOS5.3下安装ispCP后,进入管理后台,建立用户和ftp帐号,一开始proftpd无法启动,一启动就失败,后来修改过后终于可以启动 了,但是启动后无论如何都无法使用ftp登录建立好的网站,采用域名访问和使用PUTTY登录服务器查看,显示网站已经建立。经过一番查看后,终于把问题 解决了。
先解决无法启动proftpd的问题,因为ispCP自带的proftpd的配置文件与目前安装的proftpd文件在版本上可能有一些出入,而安装 ispCP的过程中,将使用ispCP的模板来替换原有的proftpd配置文件,最终导致出现启动失败,启动失败的问题出在这一行:
DisplayFirstChdir          message
我们只要在他前面增加个“#”来屏蔽这行配置或者将其删除即可,可改为如下:
DisplayChdir          message
而启动后不能FTP,老是用户验证失败的问题,经过仔细查看,最后目光落在proftpd的配置文件/etc/proftpd.conf这个文件中的一行,内容如下:
AuthOrder                  mod_sql.c mod_auth_pam.c* mod_auth_unix.c
这里分别采用了几种验证方式,莫非因为验证方式过多引起的??于是把多余的验证方式删除,改成如下内容:
AuthOrder                  mod_sql.c mod_auth_pam.c mod_auth_unix.c
再次FTP登录,结果成功了。我猜想可能是由于登录的验证方式过多,而且优先级不同,结果造成了验证无法通过。当然,这种猜想不一定正确,但是确实解决了无法ftp的问题。

转载自:http://www.ispcpcn.com/article/15/

Howto setup Postfix and policyd-weight

1. Read the changelog
1.1. Download policyd-weight
Depending on the bugfixes (see changelog) download the appropriate release:

or if quot;devel" sounds more exciting:

Move policyd-weight to the proper location for your operating system (example shows *BSD

):

# mv policyd-weight /usr/local/libexec/postfix/policyd-weight
# chmod 0555 /usr/local/libexec/postfix/policyd-weight

Check the default settings

# /usr/local/libexec/postfix/policyd-weight defaults

If these settings seem appropriate you don't need a configuration file at all. In case you like to change some settings, create a file (i.e. /usr/local/etc/policyd-weight.conf) and add only the variables that differ from the defaults. For example if you want only DNSBL checks and a different port use:

# —————————————————————-
#  minimal configuration for policyd-weight
# —————————————————————-
$dnsbl_checks_only = 1;
$TCP_PORT          = 12336;

There is another option, which is not recommended:

# /usr/local/libexec/postfix/policyd-weight defaults > /usr/local/etc/policyd-weight.conf
# chmod 0644 /usr/local/etc/policyd-weight.conf

This will write the default configuration to a file. However, this is not good practice, because it will make maintaining the configuration file difficult and changed defaults will not picked up automatically.
2.1 Add a system account for policyd-weight
Use the appropriate commands for your operating system to add a new user and a new group named polw. This unprivileged user does not need a valid shell.
2.2 Create an init script
Either create an rc-init script or manage otherwise that policyd-weight gets started at boot-time. The command to start policyd-weight in daemon mode is:

# /path/to/policyd-weight start

You need to be root to do that.
3. Edit Postfix main.cf
This example shows a minimal setup. Do NOT copy & paste, instead adjust your main.cf to meet the minimal requirements. Please keep old authentication restrictions (such as SASL) and so forth:

01:  smtpd_helo_required = yes                          # required
02:  smtpd_delay_reject = yes                           # suggested
03:
04:  smtpd_helo_restrictions =
05:      permit_mynetworks,                             # suggested
06:      reject_invalid_hostname                        # suggested
07:
08:  smtpd_client_restrictions = permit_mynetworks      # suggested
09:
10:  smtpd_sender_restrictions = permit_mynetworks      # suggested
11:
12:  smtpd_recipient_restrictions =
13:      permit_mynetworks,                             # required
14:      … other authed permits …
15:      … (permit_sasl_authenticated) …
16:      reject_unauth_destination,                     # required
17:      reject_unauth_pipelining,                      # suggested
18:      … whitelists (role accounts, clients) …
19:      reject_non_fqdn_recipient,                     # suggested
20:      check_policy_service inet:127.0.0.1:12525      # required

Lines 6: makes sure to only allow valid DNS Names (in terms of [RFC 2821] Sect. 2.3.5, [RFC 1123] Sect. 5.2.5 and [RFC 1035] Sect. 2.3.1) in the HELO command. reject_invalid_hostname (or reject_invalid_helo_hostname as of Postfix 2.3.x) makes sure that no bogus characters are used. It's a safety and RFC setting.

Line 20: calls the policy daemon on host 127.0.0.1 (localhost) at port 12525.
For whitelisting hosts read the FAQ.

To prevent that a proper MTA can use your own domain as sender please read and unterstand Ralf Hildebrandts receipe

If you don't understand some settings or don't know their meaning please read Postfix SMTP relay and access control first, respectively the postconf.5 manpage.
4. Score tuning and other configurations
To tune scores or turn on/off some features such as X-headers, read and edit /usr/local/etc/policyd-weight.conf
The configuration file is Perl syntax. If you make Perl syntax errors there, policyd-weight won't work.
It is not required to restart or reload postfix. Changes made to the configuration are picked up by each new policyd-weight instance. To have changes take effect immediately you can a) kill each policyd-weight instance, or b) restart Postfix if running in master.cf mode.

转载自:http://www.thismail.org/bbs/thread-2044-1-1.html

fuser查看什么进程使用了目录

fuser -m /dev/sdb1

杀死使用目录的进程
fuser -km /dev/sdb1

Nginx跑在线代理网站慢解决办法

鉴于Nginx对高并发的优良性能,故配了个Nginx+php-fpm来跑在线代理程序,是按照张宴文章配的,刚配置好时运行正常,但运行一段时间后,网站打开很慢,打开网站后,在输入框输入要访问的网站,也慢得不行。在网站打开慢时,在SSH终端上输入命令也慢,怀疑是机房网速问题,但在ssh上输入

w3m www.example.com

这个打开也慢,基本可以排除机房的网速问题。

当打开网站慢时,把服务器重启后,就会快起来,后来发现,用

/usr/local/webserver/php/sbin/php-fpm restart

把fastcgi重启下也会快起来,最把它加入计划任务,每小时重启下,基本保证网站不会慢,但终究不是办法。

查看了nginx.log和php-fpm.log,根据里面的错误,找了以上转载的几篇文章,总算是把问题解决了,主要修改了两个地方
1、
问题:
发现/usr/local/webserver/php/etc/php-fpm.conf文件里定义的打开文件描述符的限制数量是
<value name=”rlimit_files”>51200</value>
但用 命令ulimit -n查看,发现只有1024

我已在/etc/rc.local里添加了
ulimit -SHn 51200

竟然没生效

解决:
vi  /etc/security/limits.conf

文件最后加上
*        soft    nofile  51200
*        hard    nofile  51200

2、
问题:
用命令

netstat -np | grep 127.0.0.1:9000 |wc -l

发现只有100多

解决:
根据服务器内存情况,可以把PHP FastCGI子进程数调到100或以上,在4G内存的服务器上200就可以
服务器上内存为8G,我把PHP FastCGI子进程数调整到300

vi /usr/local/webserver/php/etc/php-fpm.conf
将max_children修改为300
<value name=”max_children”>300</value>

重启服务器,这样,网站打开速度快,而且稳定了。

2025年七月
« 5月    
 123456
78910111213
14151617181920
21222324252627
28293031