奥门巴黎人手机网址【app】

CentOS5.5安装Nginx、PHP(法斯特CGI卡塔尔、MySQL --搭建LNMP情形设置wordpress

2019-12-03 12:20·巴黎人线上开户

1、编写翻译安装PHP 5.2.14所需的帮助库:注意:上面包车型地铁libiconv举例装在/usr/local下因为php在make会需求tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1/
./configure --prefix=/usr/local
make
make install
cd ../

严重参谋:

营造地点源

生机勃勃、首先下载软件源码包
wget
wget http:/.s135.com/soft/Linux/nginx_php/php/php-5.2.10.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz
wget http:/.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.38.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz
wget http:/.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/pcre/pcre-7.9.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.5.3.tar.bz2
wget http:/.s135.com/soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz
wget http:/.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/imagick/imagick-2.2.2.tgz
二、安装PHP 5.2.10(FastCGI模式)
1、首先安装PHP 5.2.10所需的支撑库
tar zxvf libiconv-1.13.tar.gz
cd libiconv-1.13/
./configure –prefix=/usr/local
make
make install
cd ..
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
cd ..
#在make中途出错的话, apt-get install g++ ,然后再一次再做一方面

tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd ../../

风华正茂.黄金年代体化介绍

1、首先将光盘挂载到系统/media/cdrom下
          mount /dev/cdrom /media/cdrom/
2、进入到/etc/yum.repos.d目录CentOS-Base.repo重命名。

ln -s /usr/local/lib/libmcrypt.la  /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ../

系统情况  CentOS release 5.5 (Final卡塔尔   ,kernel  2.6.18-194.el5

          cd /etc/yum.repos.d
          mv CentOS-Base.repo CentOS-Base.repo.bak
          让系统找不到这几个文件
      vi CentOS-Media.repo
    修改为
    gpgcheck=0
    enabled=1

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ..

ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

安装 Nginx 、 PHP(FastCGI)   、 MySQL  、  wordpress
本子如下
 nginx-0.8.46    php-5.2.14   mysql-5.5.3-m3  wordpress-3.1.1-zh_CN

3、将具有的CentOS安装包链接到/media/CentOS
ln -s /media/cdrom/CentOS/ /media/CentOS

2、编写翻译安装MySQL 5.1.38
增加mysql顾客组和客户
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
tar zxvf mysql-5.1.38.tar.gz
cd mysql-5.1.38/
./configure –prefix=/usr/local/webserver/mysql/ –enable-assembler –with-extra-charsets=complex –enable-thread-safe-client –with-big-tables –with-readline –with-ssl –with-embedded-server –enable-local-infile –with-plugins=innobase
make && make install
chmod +w /usr/local/webserver/mysql
chown -R mysql:mysql /usr/local/webserver/mysql
cd ..

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../

二.装置计划

***************************假如用记事本张开此文件,不要采纳机动换行******************************

#即使编写翻译进度中冒出如下错误
#checking for tgetent in -ltermcap… no
#checking for termcap functions library… configure: error: No curses/termcap library found
#证实 curses/termcap 库未有安装去下载五个ncurses-5.6.tar.gz,
#wget
#tar zxvf ncurses-5.6.tar.gz
#cd ncurses-5.6
# ./configure –prefix=/usr –with-shared –without-debug
# make
# make install clean
#接下来再重复编写翻译Mysql实行设置。
#只要又越过如下错误:
make[2]: *** [do_abi_check] 错误 1
make[2]: Leaving directory `/tmp/mysql-5.5.3-m3′
make[1]: *** [abi_check] 错误 2
make[1]: Leaving directory `/tmp/mysql-5.5.3-m3′
make: *** [all-recursive] 错误 1
#在互连网搜了一下,说是Mysql的三个Bug,衰亡方法是展开Makefile将do_abi_check:前面包车型客车讲话删除,注意do_abi_check:要求留下来,然后再 make && make install


1.景况设置
sudo -s
LANG=C
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

校订重视包(更新前先依照1.地面源制作.txt配置卡塔尔国
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers patch

附:以下为附加步骤,倘使您想在此台服务器上运转MySQL数据库,则推行以下两步。如若您只是梦想让PHP帮助MySQL扩充库,能够接连别的服务器上的MySQL数据库,那么,以下两步不要求实践。
1卡塔尔(英语:State of Qatar)、成立MySQL数据库寄放目录
mkdir -p /var/webserver/mysql/3306/data
chown -R mysql:mysql /var/webserver/mysql/3306

  2、编写翻译安装MySQL 5.5.3-m3/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
tar zxvf mysql-5.5.3-m3.tar.gz
cd mysql-5.5.3-m3/
./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg
make && make install
chmod +w /usr/local/webserver/mysql
chown -R mysql:mysql /usr/local/webserver/mysql
cd ../

2.下载软件 
瞩目,全体软件都下载到了 /home/root/data1上面  生机勃勃共4个软件

安装mysql
/usr/sbin/groupadd mysql           ************添加mysql用户组
/usr/sbin/useradd -g mysql mysql   ************在mysql客商组中增加mysql顾客
tar zxvf mysql-5.5.7-rc.tar.gz     ************解压mysql
cd mysql-5.5.7-rc                  ************进入mysql目录
./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg
************配置mysql
make
************编译mysql
make install
************安装mysql
chmod +w /usr/local/webserver/mysql **************给mysql写的权杖
chown -途达 mysql:mysql /usr/local/webserver/mysql   -昂Cora是递归的乐趣  让mysql所属子目录也更改
************更改mysql所属客商和所属组
cd ../

2卡塔尔(قطر‎、以mysql顾客帐号的地位创建数据表:
/usr/local/webserver/mysql/bin/mysql_install_db –basedir=/usr/local/webserver/mysql –datadir=/var/webserver/mysql/3306/data –user=mysql


mkdir -p /home/root/data1
cd   /home/root/data1
wget
wget
wget
wget
wget
wget
wget
wget
wget
wget
wget
wget
wget
wget

开创目录
mkdir -p /data0/mysql/3306/data/              -p递归创设目录
mkdir -p /data0/mysql/3306/binlog/
mkdir -p /data0/mysql/3306/relaylog/
chown -R mysql:mysql /data0/mysql/

3卡塔尔(英语:State of Qatar)、创制my.cnf配置文件:
vim /var/webserver/mysql/3306/my.cnf
输入以下内容:
[client]
default-character-set = utf8
port    = 3306
socket  = /tmp/mysql.sock

  附:以下为附加步骤,要是您想在这里台服务器上运营MySQL数据库,则进行以下几步。假诺您只是梦想让PHP支持MySQL扩展库,能够接连其余服务器上的MySQL数据库,那么,以下两步无需实施。


三.安装PHP 5.2.14(FastCGI模式)

1.编写翻译安装 PHP 5.2.14所需的支撑库
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1/
./configure --prefix=/usr/local
make
make install
cd ../

以mysql顾客帐号的身价建构数据表:

[mysql]
prompt=”(\u:blog.s135.com:)[\d]> ”
no-auto-rehash

  ①、创造MySQL数据库寄放目录mkdir -p /data0/mysql/3306/data/
mkdir -p /data0/mysql/3306/binlog/
mkdir -p /data0/mysql/3306/relaylog/
chown -R mysql:mysql /data0/mysql/

tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd ../../

/usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/data0/mysql/3306/data --user=mysql
vi /data0/mysql/3306/my.cnf

[mysqld]
#default-character-set = utf8
user    = mysql
port    = 3306
socket  = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /var/webserver/mysql/3306/data
open_files_limit    = 10240
back_log = 600
max_connections = 3000
max_connect_errors = 6000
table_cache = 614
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 2M
join_buffer_size = 2M
thread_cache_size = 300
thread_concurrency = 8
query_cache_size = 32M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
default_table_type = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 246M
max_heap_table_size = 246M
long_query_time = 1
log_long_format
log-bin = /var/webserver/mysql/3306/binlog
binlog_cache_size = 4M
binlog_format = MIXED
max_binlog_cache_size = 8M
max_binlog_size = 512M
expire_logs_days = 7
key_buffer_size = 256M
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
skip-name-resolve
#master-connect-retry = 10
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396
server-id = 1
innodb_additional_科技世界,mem_pool_size = 16M
innodb_buffer_pool_size = 2048M  #只要开发银行不了Mysql把它改为1024照旧增大swap分区的大小
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 8
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = 0
[mysqldump]
quick
max_allowed_packet = 32M

  ②、以mysql客户帐号的地位建构数据表:/usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/data0/mysql/3306/data --user=mysql

tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ../

输入
[client]
character-set-server = utf8
port    = 3306
socket  = /tmp/mysql.sock

4卡塔尔国、成立管理MySQL数据库的shell脚本:
vim /etc/init.d/mysql
输入以下内容:
#!/bin/sh
mysql_port=3306
mysql_username=”root”
mysql_password=”root”
function_start_mysql()
{
printf “Starting MySQL…\n”
/bin/sh /usr/local/webserver/mysql/bin/mysqld_safe –defaults-file=/var/webserver/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &
}

  ③、创造my.cnf配置文件:vi /data0/mysql/3306/my.cnf
  输入以下内容:援用[client]
character-set-server = utf8
port    = 3306
socket  = /tmp/mysql.sock

ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

[mysqld]
character-set-server = utf8
replicate-ignore-db = mysql
replicate-ignore-db = test
replicate-ignore-db = information_schema
user    = mysql
port    = 3306
socket  = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /data0/mysql/3306/data
log-error = /data0/mysql/3306/mysql_error.log
pid-file = /data0/mysql/3306/mysql.pid
open_files_limit    = 10240
back_log = 600
max_connections = 5000
max_connect_errors = 6000
table_cache = 614
external-locking = FALSE
max_allowed_packet = 4M
sort_buffer_size = 1M
join_buffer_size = 1M
thread_cache_size = 300
#thread_concurrency = 8
query_cache_size = 4M
query_cache_limit = 1M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 4M
max_heap_table_size = 16M
long_query_time = 3
log-slave-updates
log-bin = /data0/mysql/3306/binlog/binlog
binlog_cache_size = 1M
binlog_format = MIXED
max_binlog_cache_size = 2M
max_binlog_size = 1G
relay-log-index = /data0/mysql/3306/relaylog/relaylog
relay-log-info-file = /data0/mysql/3306/relaylog/relaylog
relay-log = /data0/mysql/3306/relaylog/relaylog
expire_logs_days = 30
key_buffer_size = 8M
read_buffer_size = 1M
read_rnd_buffer_size = 2M
bulk_insert_buffer_size = 4M
myisam_sort_buffer_size = 16M
myisam_max_sort_file_size = 1G
myisam_repair_threads = 1
myisam_recover

function_stop_mysql()
{
printf “Stoping MySQL…\n”
/usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown
}

[mysqld]
character-set-server = utf8
replicate-ignore-db = mysql
replicate-ignore-db = test
replicate-ignore-db = information_schema
user    = mysql
port    = 3306
socket  = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /data0/mysql/3306/data
log-error = /data0/mysql/3306/mysql_error.log
pid-file = /data0/mysql/3306/mysql.pid
open_files_limit    = 10240
back_log = 600
max_connections = 5000
max_connect_errors = 6000
table_cache = 614
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 1M
join_buffer_size = 1M
thread_cache_size = 300
#thread_concurrency = 8
query_cache_size = 512M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 246M
max_heap_table_size = 246M
long_query_time = 3
log-slave-updates
log-bin = /data0/mysql/3306/binlog/binlog
binlog_cache_size = 4M
binlog_format = MIXED
max_binlog_cache_size = 8M
max_binlog_size = 1G
relay-log-index = /data0/mysql/3306/relaylog/relaylog
relay-log-info-file = /data0/mysql/3306/relaylog/relaylog
relay-log = /data0/mysql/3306/relaylog/relaylog
expire_logs_days = 30
key_buffer_size = 256M
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../

interactive_timeout = 120
wait_timeout = 120

function_restart_mysql()
{
printf “Restarting MySQL…\n”
function_stop_mysql
sleep 5
function_start_mysql
}

interactive_timeout = 120
wait_timeout = 120

2.编写翻译安装MySQL 5.5.3-m3
(1)

skip-name-resolve
#master-connect-retry = 10
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396

function_kill_mysql()
{
kill -9 $(ps -ef | grep ‘bin/mysqld_safe’ | grep ${mysql_port} | awk ‘{printf $2}’)
kill -9 $(ps -ef | grep ‘libexec/mysqld’ | grep ${mysql_port} | awk ‘{printf $2}’)
}

skip-name-resolve
#master-connect-retry = 10
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396

/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
tar zxvf mysql-5.5.3-m3.tar.gz
cd mysql-5.5.3-m3/
./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg
make && make install
chmod +w /usr/local/webserver/mysql
chown -R mysql:mysql /usr/local/webserver/mysql
cd ../

#master-host     =   192.168.1.2
#master-user     =   username
#master-password =   password
#master-port     =  3306

if [ "$1" = "start" ]; then
function_start_mysql
elif [ "$1" = "stop" ]; then
function_stop_mysql
elif [ "$1" = "restart" ]; then
function_restart_mysql
elif [ "$1" = "kill" ]; then
function_kill_mysql
else
printf “Usage: /var/webserver/mysql/${mysql_port}/mysql {start|stop|restart|kill}\n”
fi

#master-host     =   192.168.1.2
#master-user     =   username
#master-password =   password
#master-port     =  3306

(2卡塔尔(قطر‎ 创造MySQL数据库寄放目录
mkdir  -p /media/raid10/mysql/3306/data/
mkdir  -p /media/raid10/mysql/3306/binlog/
mkdir  -p /media/raid10/mysql/3306/relaylog/
chown  -R mysql:mysql  /media/raid10/mysql/

server-id = 1

5卡塔尔(قطر‎、增添实施权限
sudo chmod +x /etc/init.d/mysql

server-id = 1

瞩目:因为要贮存数据库文件,所以自个儿把 这一个文件,存放在 RAID10的设备上
落实 软RAID10,能够查阅在此之前的篇章共三篇


innodb_additional_mem_pool_size = 8M
innodb_buffer_pool_size = 64M
innodb_data_file_path = ibdata1:256M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 8
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 4M
innodb_log_file_size = 32M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = 0

6卡塔尔、增多mysql服务(ubuntu卡塔尔国,并运营服务加多自定义shell命令
#添加mysql服务
sudo update-rc.d mysql defaults 100

innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 512M
innodb_data_file_path = ibdata1:256M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 8
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = 0

(3卡塔尔(قطر‎.以mysql客商帐号的地点建构数量表 /usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/media/raid10/mysql/3306/data --user=mysql

#log-slow-queries = /data0/mysql/3306/slow.log
#long_query_time = 10

#启动mysql服务
service mysql start

#log-slow-queries = /data0/mysql/3306/slow.log
#long_query_time = 10

(4卡塔尔(英语:State of Qatar).成立my.cnf配置文件
vi /media/raid10/mysql/3306/my.cnf

[mysqldump]
quick
max_allowed_packet = 8M

#增进自写义shell命令,方便步向mysql
sudo vim ~/.bashrc
#在最终蓬蓬勃勃行参预以下内容
mysql () {
/usr/local/webserver/mysql/bin/mysqlr
}

[mysqldump]
quick
max_allowed_packet = 32M

[client]
character-set-server = utf8
port    = 3306
socket  = /tmp/mysql.sock

===========================================================================
开创shell管理脚本
vi /data0/mysql/3306/mysql
输入
#!/bin/sh

#让其及时生效
source ~/.bashrc

  ④、创制管理MySQL数据库的shell脚本:vi /data0/mysql/3306/mysql
  输入以下内容这里的客户名admin和密码12345678接下去的步调会成立):#!/bin/sh

[mysqld]
character-set-server = utf8
replicate-ignore-db = mysql
replicate-ignore-db = test
replicate-ignore-db = information_schema
user    = mysql
port    = 3306
socket  = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /media/raid10/mysql/3306/data
log-error = /media/raid10/mysql/3306/mysql_error.log
pid-file = /media/raid10/mysql/3306/mysql.pid
open_files_limit    = 10240
back_log = 600
max_connections = 5000
max_connect_errors = 6000
table_cache = 614
external-locking = FALSE
max_allowed_packet = 16M
sort_buffer_size = 1M
join_buffer_size = 1M
thread_cache_size = 300
#thread_concurrency = 8
query_cache_size = 20M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 20M
max_heap_table_size = 20M
long_query_time = 3
log-slave-updates
log-bin = /media/raid10/mysql/3306/binlog/binlog
binlog_cache_size = 4M
binlog_format = MIXED
max_binlog_cache_size = 8M
max_binlog_size = 20M
relay-log-index = /media/raid10/mysql/3306/relaylog/relaylog
relay-log-info-file = /media/raid10/mysql/3306/relaylog/relaylog
relay-log = /media/raid10/mysql/3306/relaylog/relaylog
expire_logs_days = 30
key_buffer_size = 10M
read_buffer_size = 1M
read_rnd_buffer_size = 6M
bulk_insert_buffer_size = 4M
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 20M
myisam_repair_threads = 1
myisam_recover

mysql_port=3306
mysql_username="root"
mysql_password="12345678"

7卡塔尔国、登入mysql以上增加好之后,间接输入mysql就可以登录进去了

mysql_port=3306
mysql_username="admin"
mysql_password="12345678"

interactive_timeout = 120
wait_timeout = 120

function_start_mysql()
{
    printf "Starting MySQL...\n"
    /bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/data0/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &
}

8卡塔尔(英语:State of Qatar)、输入以下SQL语句,创设一个具有root权限的客商
GRANT ALL PRIVILEGES ON *.* TO ‘root’@'localhost’ IDENTIFIED BY ”;
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’127.0.0.1′ IDENTIFIED BY ”;

function_start_mysql()
{
   printf "Starting MySQL...\n"
   /bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/data0/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &
}

skip-name-resolve
#master-connect-retry = 10
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396

function_stop_mysql()
{
    printf "Stoping MySQL...\n"
    /usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown
}

3、编译安装PHP(法斯特CGI格局)
tar zxvf php-5.2.10.tar.gz
gzip -cd php-5.2.10-fpm-0.5.11.diff.gz | patch -d php-5.2.10 -p1
cd php-5.2.10/
./configure –prefix=/usr/local/webserver/php –with-config-file-path=/usr/local/webserver/php/etc –with-mysql=/usr/local/webserver/mysql –with-mysqli=/usr/local/webserver/mysql/bin/mysql_config –with-iconv-dir=/usr/local –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-discard-path –enable-safe-mode –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –with-curlwrappers –enable-mbregex –enable-fastcgi –enable-fpm –enable-force-cgi-redirect –enable-mbstring –with-mcrypt –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-ldap –with-ldap-sasl –with-xmlrpc –enable-zip –enable-soap –without-pear

function_stop_mysql()
{
   printf "Stoping MySQL...\n"
   /usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown
}

#master-host     =   192.168.1.2
#master-user     =   username
#master-password =   password
#master-port     =  3306

function_restart_mysql()
{
    printf "Restarting MySQL...\n"
    function_stop_mysql
    sleep 5
    function_start_mysql
}

#若是现身上面包车型地铁荒谬提醒
#checking for xml2-config… no
#checking for xml-config… no
#configure: error: XML configuration could not be found
#安装  apt-get install libxml2-dev
#若是现身上面的错误提醒
#checking for pkg-config… /usr/bin/pkg-config
#configure: error: Cannot find OpenSSL’s <evp.h>
#安装   apt-get install libssl-dev”
#假定现身下边包车型大巴荒诞提醒
#checking for cURL in default path… not found
#configure: error: Please reinstall the libcurl distribution –  easy.h should be in <curl-dir>/include/curl/
#安装:  apt-get install libcurl4-gnutls-dev
#假诺现身:
#configure: error: libjpeg.(a|so) not found.
#安装:  apt-get install libjpeg-dev
#万黄金年代现身:
#configure: error: libpng.(a|so) not found.
#安装:  apt-get install libpng12-dev
#风流倜傥经现身:configure: error: freetype.h not found.
#安装:  apt-get install libfreetype6-dev
#要是现身:configure: error: sasl.h not found!
#安装:  apt-get install libsasl2-dev
若是现身:

function_restart_mysql()
{
   printf "Restarting MySQL...\n"
   function_stop_mysql
   sleep 5
   function_start_mysql
}

server-id = 1

function_kill_mysql()
{
    kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
    kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
}

+——————————————————————–+

function_kill_mysql()
{
   kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
   kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
}

innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 20M
innodb_data_file_path = ibdata1:56M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 8
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 20M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = 0

if [ "$1" = "start" ]; then
    function_start_mysql
elif [ "$1" = "stop" ]; then
    function_stop_mysql
elif [ "$1" = "restart" ]; then
function_restart_mysql
elif [ "$1" = "kill" ]; then
function_kill_mysql
else
    printf "Usage: /data0/mysql/${mysql_port}/mysql {start|stop|restart|kill}\n"
fi

|                       *** ATTENTION ***                            |

if [ "$1" = "start" ]; then
   function_start_mysql
elif [ "$1" = "stop" ]; then
   function_stop_mysql
elif [ "$1" = "restart" ]; then
function_restart_mysql
elif [ "$1" = "kill" ]; then
function_kill_mysql
else
   printf "Usage: /data0/mysql/${mysql_port}/mysql {start|stop|restart|kill}\n"
fi注意:就算地点报错语法错误{注释掉function_kill_mysql方法和调用}  ⑤、授予shell脚本可推行权限:chmod +x /data0/mysql/3306/mysql

#log-slow-queries = /media/raid10/mysql/3306/slow.log
#long_query_time = 10

============================================================================================================
chmod +x /data0/mysql/3306/mysql
启动mysql
/data0/mysql/3306/mysql start
登陆mysql
/usr/local/webserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock
创办客户并授予权力
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY

|                                                                    |

  ⑥、启动MySQL:/data0/mysql/3306/mysql start

[mysqldump]
quick
max_allowed_packet = 32M

'12345678';

安装php
首先安装注重库
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1/
./configure --prefix=/usr/local
make
make install
cd ../

tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install    ----------------------------------------------
/sbin/ldconfig  
【ldconfig是二个动态链接库管理命令 位了让动态链接库位系统所共享还需运转动态链接库的管住命令
  用场:主假使在暗中同意搜索目录(/lib和/usr/lib)及动态库配置文件/etc/ld.so.conf内所列的目录下,寻觅出可分享的动态链接库(格式如前介绍,lib*.so*),进而成立出动态装入程序(   ld.so)所需的三回九转和缓存文件,缓存文件默认为/etc/ld.so.cache,此文件保留已排好序的动态链接库名字列表 ldconfig 经常在系统运转时运营,而当顾客安装了以个新的动态链接库时  ,就要求手工业运转那些命令。
  Linux下的分享库机制选择了近乎于高速缓存的建制,将库消息保存在/etc/ld.so.cache里面。程序连接的时候首先从那么些文件之中找找,然后再到ld.so.conf的渠道里面去详细找,那正是  为何修稿了ld.so.conf要重国民党的新生活运动行一下ldconfig的由来

cd libltdl/
./configure --enable-ltdl-install
make
make install
cd

tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ../

ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../

tar zxvf php-5.2.14.tar.gz

gzip -cd php-5.2.14-fpm-0.5.14.diff.gz | patch -d php-5.2.14 -p1
cd php-5.2.14/
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-dist /usr/local/webserver/php/etc/php.ini
cd ../

编写翻译扩充模块
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../

tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1/
/usr/local/webserver/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../

tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-pdo-mysql=/usr/local/webserver/mysql
make
make install
cd ../

tar zxvf ImageMagick.tar.gz
cd ImageMagick-6.5.1-2/
./configure
make
make install
cd ../

tar zxvf imagick-2.3.0.tgz
cd imagick-2.3.0/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../

修改php.ini文件
  手工业更改:查找/usr/local/webserver/php/etc/php.ini中的extension_dir = "./"
  修改为extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"
  并在那行后扩张以下几行,然后保留:
  extension = "memcache.so"
  extension = "pdo_mysql.so"
  extension = "imagick.so"

  再查找output_buffering = Off
  修改为output_buffering = On

  再查找; cgi.fix_pathinfo=0  去掉;
  并且改良为cgi.fix_pathinfo=1    打开pathinfo支持  

  自动校订:若嫌手工业修正麻烦,可奉行以下shell命令,自动完毕对php.ini文件的修改:

sed -i 's#extension_dir = "./"#extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"\nextension = "memcache.so"\nextension = "pdo_mysql.so"\nextension = "imagick.so"\n#' /usr/local/webserver/php/etc/php.ini
sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/webserver/php/etc/php.ini
sed -i "s#; always_populate_raw_post_data = On#always_populate_raw_post_data = On#g" /usr/local/webserver/php/etc/php.ini
sed -i "s#; cgi.fix_pathinfo=0#cgi.fix_pathinfo=1#g" /usr/local/webserver/php/etc/php.ini

配置eAccelerator加速PHP:

mkdir -p /usr/local/webserver/eaccelerator_cache
vi /usr/local/webserver/php/etc/php.ini

  文件的最末尾,加上以下配置消息:

=================================================================================================================
[eaccelerator]
zend_extension="/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="64"
eaccelerator.cache_dir="/usr/local/webserver/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

===================================================================================================================

创设www顾客和组
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
mkdir -p /data0/htdocs/blog
chmod +w /data0/htdocs/blog
chown -R www:www /data0/htdocs/blog
mkdir -p /data0/htdocs/www
chmod +w /data0/htdocs/www
chown -R www:www /data0/htdocs/www

配置fpm
rm -f /usr/local/webserver/php/etc/php-fpm.conf
vi /usr/local/webserver/php/etc/php-fpm.conf
输入
<?xml version="1.0" ?>
<configuration>

  All relative paths in this config are relative to php's install prefix

  <section name="global_options">

    Pid file
    <value name="pid_file">/usr/local/webserver/php/logs/php-fpm.pid</value>

    Error log file
    <value name="error_log">/usr/local/webserver/php/logs/php-fpm.log</value>

    Log level
    <value name="log_level">notice</value>

    When this amount of php processes exited with SIGSEGV or SIGBUS ...
    <value name="emergency_restart_threshold">2</value>

    ... in a less than this interval of time, a graceful restart will be initiated.
    Useful to work around accidental curruptions in accelerator's shared memory.
    <value name="emergency_restart_interval">1m</value>

    Time limit on waiting child's reaction on signals from master
    <value name="process_control_timeout">5s</value>

    Set to 'no' to debug fpm
    <value name="daemonize">yes</value>

  </section>

  <workers>

    <section name="pool">

      Name of pool. Used in logs and stats.
      <value name="name">default</value>

      Address to accept fastcgi requests on.
      Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
      <value name="listen_address">127.0.0.1:9000</value>

      <value name="listen_options">

        Set listen(2) backlog
        <value name="backlog">-1</value>

        Set permissions for unix socket, if one used.
        In Linux read/write permissions must be set in order to allow connections from web server.
        Many BSD-derrived systems allow connections regardless of permissions.
        <value name="owner"></value>
        <value name="group"></value>
        <value name="mode">0666</value>
      </value>

      Additional php.ini defines, specific to this pool of workers.
      <value name="php_defines">
        <value name="sendmail_path">/usr/sbin/sendmail -t -i</value>
        <value name="display_errors">1</value>
      </value>

      Unix user of processes
      <value name="user">www</value>

      Unix group of processes
      <value name="group">www</value>

      Process manager settings
      <value name="pm">

        Sets style of controling worker process count.
        Valid values are 'static' and 'Apache-like'
        <value name="style">static</value>

        Sets the limit on the number of simultaneous requests that will be served.
        Equivalent to Apache MaxClients directive.
        Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
        Used with any pm_style.
        <value name="max_children">2</value>

        Settings group for 'apache-like' pm style
        <value name="apache_like">

          Sets the number of server processes created on startup.
          Used only when 'apache-like' pm_style is selected
          <value name="StartServers">20</value>

          Sets the desired minimum number of idle server processes.
          Used only when 'apache-like' pm_style is selected
          <value name="MinSpareServers">5</value>

          Sets the desired maximum number of idle server processes.
          Used only when 'apache-like' pm_style is selected
          <value name="MaxSpareServers">35</value>

        </value>

      </value>

      The timeout (in seconds) for serving a single request after which the worker process will be terminated
      Should be used when 'max_execution_time' ini option does not stop script execution for some reason
      '0s' means 'off'
      <value name="request_terminate_timeout">0s</value>

      The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
      '0s' means 'off'
      <value name="request_slowlog_timeout">0s</value>

      The log file for slow requests
      <value name="slowlog">logs/slow.log</value>

      Set open file desc rlimit
      <value name="rlimit_files">65535</value>

      Set max core size rlimit
      <value name="rlimit_core">0</value>

      Chroot to this directory at the start, absolute path
      <value name="chroot"></value>

      Chdir to this directory at the start, absolute path
      <value name="chdir"></value>

      Redirect workers' stdout and stderr into main error log.
      If not set, they will be redirected to /dev/null, according to FastCGI specs
      <value name="catch_workers_output">yes</value>

      How much requests each process should execute before respawn.
      Useful to work around memory leaks in 3rd party libraries.
      For endless request processing please specify 0
      Equivalent to PHP_FCGI_MAX_REQUESTS
      <value name="max_requests">1024</value>

      Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
      Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
      Makes sense only with AF_INET listening socket.
      <value name="allowed_clients">127.0.0.1</value>

      Pass environment variables like LD_LIBRARY_PATH
      All $VARIABLEs are taken from current environment
      <value name="environment">
        <value name="HOSTNAME">$HOSTNAME</value>
        <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
        <value name="TMP">/tmp</value>
        <value name="TMPDIR">/tmp</value>
        <value name="TEMP">/tmp</value>
        <value name="OSTYPE">$OSTYPE</value>
        <value name="MACHTYPE">$MACHTYPE</value>
        <value name="MALLOC_CHECK_">2</value>
      </value>

    </section>

  </workers>

| Something is likely to be messed up here, because the configure    |

  ⑦、通过命令行登入管理MySQL服务器提示输入密码时直接回车):/usr/local/webserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock

注意:由于用的虚构机,只分红了512M内存,所以,相应的参数配置的相当小。依据自身需求布署

</configuration>

启动
ulimit -SHn 65535
/usr/local/webserver/php/sbin/php-fpm start

安装Nginx 0.8.53
  1、安装Nginx所需的pcre库:

tar zxvf pcre-8.10.tar.gz
cd pcre-8.10/
./configure
make && make install    
cd ../

  2、安装Nginx

tar zxvf nginx-0.8.53.tar.gz
cd nginx-0.8.53/
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
cd ../

  3、成立Nginx日志目录

mkdir -p /data1/logs
chmod +w /data1/logs
chown -R www:www /data1/logs


  4、创造Nginx配置文件
  ①、在/usr/local/webserver/nginx/conf/目录中开创nginx.conf文件:

rm -f /usr/local/webserver/nginx/conf/nginx.conf
vi /usr/local/webserver/nginx/conf/nginx.conf

输入
user  www www;

worker_processes 2;

error_log  /data1/logs/nginx_error.log  crit;

pid        /usr/local/webserver/nginx/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;

events
{
  use epoll;
  worker_connections 65535;
}

http
{
  include       mime.types;
  default_type  application/octet-stream;

  #charset  gb2312;
      
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 8m;
      
  sendfile on;
  tcp_nopush     on;

  keepalive_timeout 60;

  tcp_nodelay on;

  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 64k;
  fastcgi_buffers 4 64k;
  fastcgi_busy_buffers_size 128k;
  fastcgi_temp_file_write_size 128k;

  gzip on;
  gzip_min_length  1k;
  gzip_buffers     4 16k;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_types       text/plain application/x-javascript text/css application/xml;
  gzip_vary on;

  #limit_zone  crawler  $binary_remote_addr  10m;

  server
  {
    listen       80;
    server_name  www.sunny.com;
    index index.html index.htm index.php;
    root  /data0/htdocs/blog;

    #limit_conn   crawler  20;    
                             
    location ~* .*\.php($|/){
        include  fcgi.conf;
    }
    
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
      expires      30d;
    }

    location ~ .*\.(js|css)?$
    {
      expires      1h;
    }    

    log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
              '$status $body_bytes_sent "$http_referer" '
              '"$http_user_agent" $http_x_forwarded_for';
    access_log  /data1/logs/access.log  access;
      }

  server
  {
    listen       80;
    server_name  mysql.sunny.com;
    index index.html index.htm index.php;
    root  /data0/htdocs/www;

    location ~* .*\.php($|/){

        include  fcgi.conf;
    }

    log_format  wwwlogs  '$remote_addr - $remote_user [$time_local] "$request" '
               '$status $body_bytes_sent "$http_referer" '
               '"$http_user_agent" $http_x_forwarded_for';
    access_log  /data1/logs/wwwlogs.log  wwwlogs;
  }

}

=====================编辑cgi配置文件==============
vi /usr/local/webserver/nginx/conf/fcgi.conf
输入:

if ($request_filename ~* (.*)\.php) {
            set $php_url $1;
      }
      if (!-e $php_url.php) {
            return 403;
      }

fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;

set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
        set $real_script_name $1;
        set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
## 以上是永葆pathinfo的根本部分

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx;

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

#fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
#fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

启动nginx
ulimit -SHn 65535
/usr/local/webserver/nginx/sbin/nginx
构造开机自运行
vi /etc/rc.local
输入
ulimit -SHn 65535
/usr/local/webserver/php/sbin/php-fpm start
/usr/local/webserver/nginx/sbin/nginx
/data0/mysql/3306/mysql start

/usr/local/webserver/nginx/sbin/nginx -t 测验配置文件的正确、
/usr/local/webserver/nginx/sbin/nginx -s reload  平滑重启

svn配置

1.设置svn服务器端
yum install subversion      从镜像下载安装svn服务器端
cd /usr/local/              //踏向目录,思谋开创svn目录
mkdir svn                   //创制八个svn目录
chmod -揽胜 777 svn            //修正目录权限为777
svnadmin create /usr/local/svn/sunny  //创制叁个svn版本饭店sunny(sunny能够随意起名字卡塔尔(قطر‎
cd svn/sunny/conf               //步入sunny版本旅馆下的布置文件目录

上面要校勘那几个目录下的多个构造文件
(1卡塔尔国vi svnserve.conf    //配置版本库新闻和客户文件和顾客密码文件的不二秘诀、版本库路线

# anon-access = read
# auth-access = write
# password-db = passwd
//这四行,前面的#号和空格去掉(注意去掉#要顶格写,不要留有多余空格卡塔尔,形成
anon-access = none      //改成none
auth-access = write
password-db = passwd
realm = sunny           //改成自身的版本库
保存

(2卡塔尔国vi authz     //文件,创设svn组和组客商的权柄
[group]
sunny = gep,wce //创造三个sunny的组,并点名七个客商gep和wce

[/]             //制订根目录下的权能
@sunny = rw     //sunny组客户权限为读写
* = r           //别的顾客唯有读权限
保存退出

(3卡塔尔(英语:State of Qatar) vi passwd   //创立或改正客户密码
[users]
gep = 123456    //客户名字为gep的客户的密码为123456
wce = 123456    //。。。
保存退出

启动svn:
svnserve -d -r /usr/local/svn/     //这里运用多版本库的情势运行  借使是单版本库 能够svnserve -d -r /usr/local/svn/sunny
累积风华正茂行
然后要安装自运行
vi /etc/rc.local    张开自运行文件增加
/usr/bin/svnserve -d -r /usr/local/svn/ -d 守护进程
  -r制订版本库的目录
到此甘休可以从服务端检出文件了.

svn命令:
netstat -tnl |grep :3690   查看svn是不是运营
ps aux |grep 'svn'  查找全部svn运行的进度
kill -9 2505    杀死2505以此查找到的svn进度
接连时关闭防火墙

svn checkout svn://172.19.5.2/sunny /data0/htdocs/blog  //检出蓬蓬勃勃份版本库文件到钦赐目录
svn up                        //更新文件

自动更新
在vi /usr/local/svn/sunny/hooks/post-commit中加入

#!/bin/sh
#设置有个别变量
SVN=/usr/bin/svn
WEB=/home/testsvn #要立异的目录
export LANG=en_US.UTF-8
$SVN update $WEB --username xxx --password xxx

当中SVN=左边改成 svn 命令地点 日常默以为/usr/bin/svn
    WEB=左边改成你其实的web目录
赋予可进行权限
chmod 777 /usr/local/svn/sunny/hooks/post-commit
安装完成

=========================================================================
此外操作

#svn commit -m "注释" xxx.php  //提交文件
svn ci -m'aaa' test.php       //提交文件

#svn add file               //新建文件并添加到svn
svn add *.php               //(增多当前目录下具备的php文件卡塔尔(英语:State of Qatar)
svn delete test.php         //删除test.php
svn log test.php            //查看test文件的log信息
svn cleanup                 //清理当前目录

svn switch --relocate svn://192.168.1.253  svn://172.19.10.250      //重新定位SVN版本库地址

// SVN版本库起动情势,未来SVN上面有 sunny、test 多少个版本库
1:单版本库起动    svnserve -d -r /usr/local/svn/sunny
2:多版本库起动    svnserve -d -r /usr/local/svn
差异在于起动svn时候的授命中的运行参数-r钦点的目录。

约束分裂的客商对两样的版本库操作权限,更改版本库中的conf目录下的 authz文件

以布署 sunny 版本库为例
vi authz
[groups]
teacher = sunny,sunny1
[sunny:/]             //钦定版本库跟目录下的权限
@teacher = rw     //teacher组顾客权限为读写
* = r           //其余顾客独有读权限
保留退出

vi passwd 设置组中客商的账号和密码
[users]
sunny  = 123456
sunny1 = 123456


| script was not able to detect a simple feature on your platform.   |

  ⑧、输入以下SQL语句,创制二个存有root权限的客商admin)和密码12345678):GRANT ALL P奥迪Q5IVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1' IDENTIFIED BY '12345678';

(5卡塔尔.创造多少个shell脚本,处理MySQL
vi  /media/raid10/mysql/3306/mysql
输入以下内容(这里的客户名是admin 密码是 12345678 ,接下去会创造这些客商并授权卡塔尔(英语:State of Qatar)

| This is often caused by incorrect configuration parameters. Please |

  ⑨、可选)停止MySQL:/data0/mysql/3306/mysql stop

#!/bin/sh

| see the file debug.log for error messages.                         |


mysql_port=3306
mysql_username="admin"
mysql_password="12345678"

|                                                                    |

  3、编写翻译安装PHP法斯特CGI方式)tar zxvf php-5.2.14.tar.gz
gzip -cd php-5.2.14-fpm-0.5.14.diff.gz | patch -d php-5.2.14 -p1
cd php-5.2.14/
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-dist /usr/local/webserver/php/etc/php.ini
cd ../注意:借使安顿php报错,且机器是61位系统:{

function_start_mysql()
{
    printf "Starting MySQL.../n"
    /bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/media/raid10/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &
}

| If you are unable to fix this, send the file debug.log to the      |

1.假诺提示"configure: error: libjpeg.(a|so卡塔尔国 not found"错误

function_stop_mysql()
{
    printf "Stoping MySQL.../n"
    /usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown
}

| php-install@lists.php.net mailing list and include appropiate      |

故而这边我们需求复制大器晚成份libjpeg.so到/usr/lib/目录里才具够.再度施行./configure命令就可以.

function_restart_mysql()
{
    printf "Restarting MySQL.../n"
    function_stop_mysql
    sleep 5
    function_start_mysql
}

| information about your setup.                                      |

cp -frp /usr/lib64/libjpeg.* /usr/lib/

function_kill_mysql()
{
    kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
    kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
}

+——————————————————————–+

2.只顾进度中还或者会唤醒" Configure: error: libpng.(also卡塔尔国 not found."错误,消除办法和方面包车型大巴肖似.

if [ "$1" = "start" ]; then
    function_start_mysql
elif [ "$1" = "stop" ]; then
    function_stop_mysql
elif [ "$1" = "restart" ]; then
function_restart_mysql
elif [ "$1" = "kill" ]; then
function_kill_mysql
else
    printf "Usage: /media/raid10/mysql/${mysql_port}/mysql {start|stop|restart|kill}/n"
fi

| License:                                                           |

cp -frp /usr/lib64/libpng* /usr/lib/

(6卡塔尔(英语:State of Qatar).授予shell脚本 mysql 施行权限

| This software is subject to the PHP License, available in this     |

3.只要提醒"configure: error: Cannot find ldap libraries in /usr/lib."的话.

chmod +x /media/raid10/mysql/3306/mysql

| distribution in the file LICENSE.  By continuing this installation |

cp -frp /usr/lib64/libldap* /usr/lib/

(7).启动MySQL

| process, you are bound by the terms of this license agreement.     |

4.纵然提醒:/usr/bin/ld: cannot find -liconv

/media/raid10/mysql/3306/mysql start

| If you do not agree with the terms of this license, you must abort |

内需查阅是或不是安装了libiconv 和是还是不是在/usr/local下。且/usr/lib 下存在libiconv.so文件,若是荒诞不经须求查找libiconv.so到/usr/lib下。

(8卡塔尔(英语:State of Qatar).通过以下命令登入处理MySQL服务器(提示输入密码直接回车,那是用root登陆的卡塔尔(英语:State of Qatar)

| the installation process at this point.                            |

说明:

/usr/local/webserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock

(9卡塔尔(قطر‎.输入以下SQL语句,用于创立二个具备root权限的客户 ,顾客名是 上边提到的 admin 密码  是 12345678  
 

+——————————————————————–+

通过上边的搜求其实就驾驭某些缘由了,configure通常的检索编写翻译路径为/usr/lib/下,因为php暗许就在/usr/lib/下找相关库文件,而x64机器上是在:/usr/lib64.那时候你就能够一贯把须要的库文件从/usr/lib64中拷贝到/usr/lib/中去就能够了.

GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1' IDENTIFIED BY '12345678';

Thank you for using PHP.

}上边的make之后要运转make install,况且意气风发旦是陆十四人操作系统 则大概报错。假设报错:缺乏libicon.so.2 那么只须求转移/etc/ld.so.conf 扩充生机勃勃行: /usr/local/lib然后运转:/sbin/sdconfig即便继续报错:/usr/lib64/mysqlclient.so is empty 那么则须要删除这些空文件,并复制/usr/local/webserver/mysql/lib/mysqlclient.so文件过来继续实施/sbin/sdconfig

因为接下去要设置wordpress,所以最棒再加一条

#到php安装程序目录(编写翻译PHP的目录卡塔尔(قطر‎去查看debug.log最后几行即使有以下警报


GRANT ALL PRIVILEGES ON *.* TO 'admin'@'172.29.141.112' IDENTIFIED BY '12345678';

A   conftest.c:3: warning: incompatible implicit declaration of built-in function ‘exit’

  4、编译安装PHP5扩充模块tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../

注意:
那边的 172.29.141.112 是同意 连接 MySQL服务器的顾客端IP地址 ;
*.* 表示 全部 库和全数表   比如  blog.wordpress  表示 blog库的wordpress表

B   ./conftest: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1/
/usr/local/webserver/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../

最终再增添

#增加LD_LIBRARY_PATH=/usr/local/mysql/lib/mysql到情形变量,方法为编辑/etc/profile文 件,添 加:export LD_LIBRARY_PATH=/usr/local/webserver/mysql/lib/mysql
#倘使不想重启使用 . /etc/profile 就足以了,注意.和/etc中间有空格,然后再重复编写翻译