准备相应的mysql程序,软件安装在/home/web目录,因不用再花大量时间编译,安装很快,较省时。

安装脚本如下:

cur_dir=$(pwd)

# 配置myisam或innodb方式
read -p "do you want to install the InnoDB Storage Engine? (y/n)" mysqlengineer
if [ "$mysqlengineer" = 'y' ]; then
  echo "mysqlengineer is innoDB"
elif
[ "$mysqlengineer" = 'n' ]; then
  echo "mysqlengineer is MYSIAM"
else
   mysqlengineer="y" && echo "mysqlengineer is innoDB"
fi

#确认后暂停

get_char()
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo ""
echo "Press any key to start..."
char=`get_char`

#开始安装
mkdir -p /home/web

if [ `uname -m` = "x86_64" ] ; then
tar zxvf mysql-5.5.44-linux2.6-x86_64.tar.gz
mv mysql-5.5.44-linux2.6-x86_64 /home/web/mysql
else
tar zxvf mysql-5.5.44-linux2.6-i686.tar.gz
mv mysql-5.5.44-linux2.6-i686 /home/web/mysql
fi

cd /home/web/mysql/
groupadd mysql
useradd -s /sbin/nologin -M -g mysql mysql -d /dev/null
rm -f /etc/my.cnf
cp /home/web/mysql/support-files/my-medium.cnf /etc/my.cnf
sed -i 's/log-bin=mysql-bin/#log-bin=mysql-bin/g' /etc/my.cnf
sed -i 's/binlog_format=mixed/#binlog_format=mixed/g' /etc/my.cnf
sed -i 's/skip-federated/#skip-federated/g' /etc/my.cnf
sed -i 's/skip-locking/skip-locking\nmax_connections = 1000\nwait_timeout = 5/g' /etc/my.cnf
sed -i 's:/usr/local/:/home/web/:g' /etc/my.cnf
if [ $mysqlengineer = "y" ]; then
sed -i 's:#innodb:innodb:g' /etc/my.cnf
else
sed '/skip-external-locking/i\default-storage-engine=MyISAM\nloose-skip-innodb' -i /etc/my.cnf
fi

/home/web/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/home/web/mysql --datadir=/home/web/mysql/data --user=mysql
chown -R mysql /home/web/mysql/data
chgrp -R mysql /home/web/mysql/.
cp /home/web/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
sed -i 's:/usr/local:/home/web:g' /etc/init.d/mysqld
service mysqld start
/home/web/mysql/bin/mysqladmin -u root password no123654
Tags:
nginx自从1.1.8版本发布后将limit_conn更换为limit_conn_zone

1.添加limit_zone   这个变量只能在http使用
nginx.conf中:
http {   } 段内添加:
    limit_conn_zone $binary_remote_addr zone=perip:10m;

2.添加limit_conn   这个变量可以在http, server, location使用
针对某个站点,可以直接加到站内配置文件中,如:

        location / {
                index  index.html index.htm index.php;
        limit_conn perip 1;
        limit_rate 100k;
        }

也可以单独加段 location,并配置上要限制的目录

        location /data/ {
        limit_conn perip 1;
        limit_rate 100k;
        }

说明:
limit_conn perip 10;    每个IP使用10个连接
limit_rate 100k;        限制1个连接速度为100k
Tags:
一、更换域名后原收录的地址转到新域名

安装rewrite组件2.x 版本,如isapi_rwf_x86_2.13.1.73
在httpd.ini规则中增加如下语句:
# For ISAPI_Rewrite 2.x
RewriteCond Host: ^www\.bb\.com$
RewriteRule (.*) http\://www\.cc\.com$1 [I,RP]

如是3.x版本的则增加如下语句:
# For ISAPI_Rewrite 3.x
RewriteCond %{HTTP:Host} ^www\.bb\.com$
RewriteRule (.*) http\://www\.cc\.com$1 [NC,R=301]

二、取消伪静态转向动态,使原收录保持能访问

安装rewrite组件2.x 版本,如isapi_rwf_x86_2.13.1.73
在httpd.ini规则中的第一行增加:
[RP,L]

如是3.x版本的则增加:
[R=301,L]

Tags: ,

mysql5.5.10源码安装教程

[不指定 2011/04/02 09:31 | by xiaoyuwxz ]
本内容为原创内容,转载请注明:
本文来自http://blog.gsywx.com

系统为centos5.5 32位,从官方下载mysql-5.5.10.tar.gz源码包
mysql-5.5.10.tar.gz上传到系统中的/soft/目录


cd /soft/
wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
tar zxvf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./configure
make
make install
cd ../
  
tar zxvf mysql-5.5.10.tar.gz
cd mysql-5.5.10
cmake . -DCMAKE_INSTALL_PREFIX=/web/mysql/ -DMYSQL_DATADIR=/web/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DWITH_DEBUG=0
make && make install
cd /web/mysql/
cp support-files/mysql.server /etc/init.d/mysqld
groupadd mysql
useradd mysql -g mysql -d /dev/null -s /sbin/nologin
chown -R mysql .
chgrp -R mysql .
chmod 755 /etc/init.d/mysqld
cp support-files/my-medium.cnf /etc/my.cnf
sed -i 's/log-bin=mysql-bin/#log-bin=mysql-bin/g' /etc/my.cnf
sed -i 's/binlog_format=mixed/#binlog_format=mixed/g' /etc/my.cnf
sed -i 's/skip-federated/#skip-federated/g' /etc/my.cnf
sed -i 's/skip-locking/skip-locking\nmax_connections = 1000\nwait_timeout = 5/g' /etc/my.cnf
chkconfig --add mysqld
chkconfig mysqld on
./scripts/mysql_install_db --user=mysql
service mysqld start
./bin/mysqladmin -u root password 123654
./bin/mysql -uroot -p
mysql>use mysql;
mysql>show databases;
mysql>quit;
Tags:
分页: 4/26 第一页 上页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]