存档

‘√linux’ 分类的存档

iptables限速

2010年5月28日 vi 没有评论

-A RH-Firewall-1-INPUT –source 74.117../16 -m limit –limit 1/s -j ACCEPT
-A RH-Firewall-1-INPUT –source 74.117../16 -j DROP

# -A OUTPUT –destination 74.117../16 -m limit –limit 20/s -j ACCEPT

本来以为要双向定义 。试过后,input就行了。

分类: √linux 标签: ,

在 Linux 上通过 Xen运行 FreeBSD

2010年5月7日 vi 没有评论

 ™ hypervisor 是一个开放源代码的并行虚拟化产品, 并由商业的 XenSource 公司提供支持。 在这种系统中,客户操作系统称为 domU 域, 而宿主系统则称为 dom0。 在 Linux 上运行 虚拟机实例的第一步, 是安装用于 Linux dom0 的 。 在这个例子中, 宿主系统采用的发行版本是 Slackware Linux
在 Linux dom0 上安装 3
1.从 XenSource 下载 3.

从 http://www.xensource.com/ 下载 -3..4_1-src.tgz。

2.解压缩源代码包

# cd -3..4_1-src
# KERNELS=”linux-2.6-xen0 linux-2.6-xenU” make world
# make install
注意: 为 dom0 重新编译内核:

# cd -3..4_1-src/linux-2.6.16.33-xen0
# make menuconfig
# make
# make install
对于较早版本的 ,可能需要指定 make ARCH= menuconfig
3.在 Grub 的 menu.lst 中增加一个对应的菜单项

编辑 /boot/grub/menu.lst 并在其中增加下列配置:

title -3..4
root (hd0,)
kernel /boot/-3..4-1.gz dom0_mem=262144
module /boot/vmlinuz-2.6.16.33-xen0 root=/dev/hda1 ro
4.重新启动计算机并进入

阅读全文…

history命令记录

2010年5月4日 vi 1 条评论

unset HISTORY HISTFILE HISTSAVE HISTZONE HISTORY HISTLOG; export HISTFILE=/dev/null; export HISTSIZE=; export HISTFILESIZE=

分类: √linux 标签:

freebsd下apache+nginx+php+mysql+eaccelerator+memcache安装配置

2010年4月19日 vi 没有评论

+nginx++++安装配置
太长了。到后面没那么细心了。直接复制粘贴上来。就不加说明了。
1.安装

bsd1# pwd
/usr/ports/www/apache22
bsd1# make install clean

2.安装
./configure –prefix=/usr/local/ –enable-assembler –with-charset=utf8 –enable-thread-safe-client –with-extra-charsets=all –with-big-tables –with-readline –with-ssl –with-embedded-server –enable-local-infile –with-plugins=innobase

make -j 5
make install
groupadd
useradd -g
cp /usr/local//share//my-medium.cnf /etc/my.cnf
/usr/local//bin/mysql_install_db –user=
chown -R /usr/local//var
chgrp -R /usr/local//.
cp /usr/local//share//.server /etc/init.d/
chmod 755 /etc/init.d/
这是linux的安装命令。BSD照着改一下

2.安装
先装组件jpeg,libpng,freetype,zlib,gd,curl,libxml2,libxslt,libmcrypt
pkg_add -r gd
pkg_add -r freetype
pkg_add -r curl
pkg_add -r libxml2
pkg_add -r libxslt
pkg_add -r libmcrypt
pkg_add -r mhash
./configure –prefix=/usr/local/ –with-config-file-path=/etc –with-apxs2=/usr/local/sbin/apxs –with-=/usr/local/ –with-mysqli=/usr/local//bin/mysql_config –with-iconv-dir –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir –enable-xml –disable-rpath –enable-discard-path –enable-magic-quotes –enable-safe-mode –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –with-curlwrappers –enable-mbregex –enable-force-cgi-redirect –enable-mbstring –with-mcrypt –enable-ftp –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap –without-pear –with-gettext –with-mime-magic –enable-suhosin
make &&make install
cp .ini-dist /etc/.ini
阅读全文…

SSH密钥配置

2010年4月15日 vi 1 条评论

linux 创建
#-keygen -t rsa

[root@viyin.net ~]# ls ~/./
id_rsa id_rsa.pub known_hosts

CRT-工具-创建公钥-RSA

生成密钥.

上传CRT所生成的Identity.pub 到~/./

-keygen -X -f Identity.pub >> /root/./ (配置文件里默认文件名)

修改Mysql数据储存目录.Freebsd

2010年4月14日 vi 没有评论

Ports安装默认的数据文件存储目录为/var/db/,现要移到/usr/local//下.
最简单的方法是采用符号链接,但符号链接在频繁读写时可能有效率问题.
#ln -s /usr/local/ /var/db/

建立目录
mkdir /usr/local/
权限
chown -R : /usr/local/
停止服务进程
mysqladmin -u root -p shutdown
移动数据
mv /var/db/ /usr/local/data
修改配置文件
vi /etc/my.cnf
(如果没有,到/usr/local/share//下找到my-*.cnf文件,cp一个到/etc/my.cnf)中

增加mysql_dbdir=”/usr/local/
修改启动脚本
vi /usr/local/etc/rc.d/-server
修改datadir=/usr/local/data/
重新启动服务
/usr/local/etc/rc.d/-server start
查看是否启动成功

阅读全文…

分类: √freebsd, √linux 标签: , ,

nginx 404 php页面

2010年4月10日 vi 没有评论

配置文件中增加
fastcgi_intercept_errors on;