Posted on 2010-04-24 01:18
60 阅读(334)
评论(0) 编辑 收藏 所属分类:
Linux笔记
查看操作系统信息
cat /proc/version
查看rpm安装列表
rpm -qa |grep sql
rpm 卸载
rpm -e 查到的名字
ulimit -SHn 51200
pcre安装
./configure --prefix=/usr/local/pcre --enable-shared --enable-static
nginx 安装
./configure --prefix=/usr/local/nginx --with-pcre=[pcre的安装文件] --with-http_stub_status_module --user=www --group=www
启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql --datadir=/usr/local/hdd2/mysql/data
安装jpeg
./configure --prefix=/usr/local/jpeg/ --enable-shared --enable-static
安装png
./configure --prefix=/usr/local/libpng/ --enable-shared --enable-static
安装gd
./configure --prefix=/usr/local/gd --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/jpeg --with-zlib=/usr/local/zlib
php
./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm --enable-mbstring=LANG --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-libxml-dir=/usr/local/libxml --with-zlib-dir=/usr/local/zlib with-gettext=/usr/local/gettext --enable-debug=no --enable-ftp=no --with-config-file-path=/usr/local/php --with-jpeg-dir=/usr/local/jpeg --with-ttf --with-freetype-dir=/usr/local/freetype --with-png-dir=/usr/local/libpng --with-iconv --enable-force-cgi-redirect
升级
gzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.13 -p1
eaccelerator 安装
./configure --enable-eaccelerator --with-php-config=/usr/local/php/bin/php-config
优化linux
vi /etc/sysctl.conf
生效 /sbin/sysctl -p
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 5000 65000
查看网络流量
watch -n 1 "/sbin/ifconfig eth0 | grep bytes"
vnstat -u -tr -i eth0
防火墙设置
[root@localhost php]# cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT