Unix/Linux技术

1:安装imagemagick
cd /usr/ports/graphics/ImageMagick
make install clean;
rehash
然后# convert --version
Version: ImageMagick 6.3.6 02/29/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
说明安装成功。

» 阅读全文

阅读全文

 

 

mod_cband是一个通过Apache 2模块来解决限制用户和虚拟主机带宽问题的应用,当前版本可以调整虚拟主机和用户带宽限额,最高下载速度(like in mod_bandwidth),每秒访问请求速度和最高并发访问ip连接数(like in mod_limitipconn)。
"我告诉主机服务提供商使用mod_cband,想要限制他们用户数据传输,像“每月10 Gb流量”这样。但已有了mod_curb模块,可以限制流量,但无法工作在虚拟主机和Apache 2下,所以我写了自己的模块完全适合于Apache 2 API同时支持每用户和每虚拟主机带宽限制。"(此段翻译自官方网站)

FreeBSD ports path and pkg-descr info
/usr/ports/www/mod_cband
mod_cband is an Apache 2 module provided to solve the problem of limiting virtualhosts bandwidth usage. When the configured virtualhost’s transfer limit is exceeded, mod_cband will redirect all further requests to a location specified in the configuration file.

好了,说道这里我想这个模块的精髓之处在于完美的支持Apache 2并实现了原有两个模块的全部功能(2in1)且支持每用户和每虚拟主机带宽限制。这在进行web平台应用与整合之时给我们提供了又一易用的方法。准备动手吧!文中实例与系统平台均基于freebsd6.1平台。

 

» 阅读全文

阅读全文

如何修正 MySQL ?料?的 encoding?

最近 gslin 的 blog 因? MySQL ?料?的 encoding ??,?生?常?象,只好?零?始。??有偶地,Pesty 最近也?理了 MySQL 使用 utf-8 的相???。

?些??之所以??生,是因?越?越多的 web application 套件使用 UTF-8 ?存?料,但大家在?定 MySQL ??都?有注意到??,仍然使用??的 latin1 作??料?的 encoding。Web application ?入 UTF-8 ?料,MySQL ??作 latin1 在?,?然 web application ?回?的?候,因??好是反向?理,?料看似?有任何?常,但??上 collation 是?的,??行移?、?份甚至?? web application ?,也都??生??。

我一年多前也有遇到?似的??,原本在公司有?用 phpBB2 架的 forum,?用 big5 ??,但??上 mysql-3.23 ?是用 latin1 存。想要??成 UTF-8,移?到 FreeBSD 5 上改用 mysql-4.1,就?生??了。我那??有解?,所以 phpBB2 移?????了一年多,但?在是多跑一? virtual machine 只?了??移不??的 phpBB2,?在浪????。?好看到 gslin ? pesty 最近也在弄????,就重新?了一遍步?如下:

用 mysqldump 自 mysql-3.23 倒出?,??必?加上 --default-character-set=latin1 的??,才能正?倒出??上是用 big5 的 phpBB2 的?料?。
用 iconv -c -f CP950 -t UTF-8 ?倒出?的 SQL ?成 UTF-8。必?要加 -c,否??死在半路。?句??,其?中?已?有?西?掉了。
? mysql 用 SET GLOBAL/SESSION character_set_XXX=utf8 ?整 system variables,? charset ? collation 通通改成 UTF-8,然後做 CREATE DATABASE phpbb2。
再用 SOURCE 指令把??用 iconv ?出?的 SQL ?倒回?。
?果在第四?步??,mysql (client) 就 core dump 了。猜?有可能是第二步用 -c 硬??,把某?指令搞?了。不? mysql (client) 是直接 core dump 而不是跑 error message 出?指出??何在,所以?下??了,只能靠 iconv 不加 -c 想?法慢慢抓??。

» 阅读全文

阅读全文

FreeBSD就是一种运行在Intel平台上、可以自由使用的Unix系统,它可以从Internet上免费获得.而它又具备极其优异的性能,使它得到了计算机研究人员和网络专业人士的认可.
因此,不但专业科研人员把它用作个人使用的Unix工作站,很多企业,特别是 ISP(Internet服务提供商)都使用运行FreeBSD的高档PC服务器来为他们的众多用户提供网络服务.

下载:FreeBSD 7.0 Beta 1

2007 年 10月

  • 10月 22 日: The final stage of the FreeBSD-7.0 Release cycle has begun with the first beta release. The FreeBSD 7.0-BETA1 ISO images for Tier-1 architectures are now available for download on most of the FreeBSD mirror sites. The more people that test and report bugs, the better FreeBSD 7.0-RELEASE will be. For more information about the FreeBSD 7.0 release process, please check the official schedule and the todo list.

» 阅读全文

阅读全文

解决方法是修改/etc/mysql/my.cnf,添加以下一行:
set-variable = max_connections=500

或在启动命令中加上参数 max_connections=500
就是修改最大连接数,然后重启mysql.默认的连接数是100,太少了,所以容易出现如题错误.
以下是mysql.com网站的相关说明:
If you get a Too many connections error when you try to connect to the mysqld server, this means that all available connections are in use by other clients.

The number of connections allowed is controlled by the max_connections system variable. Its default value is 100. If you need to support more connections, you should restart mysqld with a larger value for this variable.

mysqld actually allows max_connections+1 clients to connect. The extra connection is reserved for use by accounts that have the SUPER privilege. By granting the SUPER privilege to administrators and not to normal users (who should not need it), an administrator can connect to the server and use SHOW PROCESSLIST to diagnose problems even if the maximum number of unprivileged clients are connected. See Section 13.5.4.19, “SHOW PROCESSLIST Syntax”.

The maximum number of connections MySQL can support depends on the quality of the thread library on a given platform. Linux or Solaris should be able to support 500-1000 simultaneous connections, depending on how much RAM you have and what your clients are doing. Static Linux binaries provided by MySQL AB can support up to 4000 connections.

 

 PS:方法2

还有个办法就是到/usr/local/share/mysql/下面拷贝个配置文件my-large.cnf 到/etc目录下为my.cnf,再改最大连接数可以把mysql发挥到最大性能

/usr/local/share/mysql/

下有三个配置文件

my-large.cnf   大型数据库应用

my-medium.cnf  中型数据库应用

my-small.cnf    小型数据库应用

在选择 my-large.cnf的时候对内存要求比较高

在到webmin中mysql服务器的配置文件中修改mysql的最大连接数到4000就可以完美解决MySQL的“too many connections”错误了;

mysql连接数增加后内存占用也比较严重;

mysql1.png(缩略图)

mysql1.png

大小: 30.25 K
尺寸: 350 x 262
浏览: 37 次
点击打开新窗口浏览全图

mysql2.png(缩略图)

mysql2.png

大小: 17.42 K
尺寸: 350 x 176
浏览: 27 次
点击打开新窗口浏览全图

阅读全文

Total: 36Page 5 of 8« First‹ Prev2345678Next ›