当前位置:文档之家› nginx安装及配置

nginx安装及配置

[root@localhost Desktop]# 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
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
* base: https://www.doczj.com/doc/3a13839402.html,
* extras: https://www.doczj.com/doc/3a13839402.html,.sg
* updates: https://www.doczj.com/doc/3a13839402.html,.sg
Setting up Install Process
Package gcc-4.4.6-3.el6.x86_64 already installed and latest version
Package libjpeg-6b-46.el6.x86_64 already installed and latest version
Package zlib-1.2.3-27.el6.x86_64 already installed and latest version
Package glib2-2.22.5-6.el6.x86_64 already installed and latest version
Package bzip2-1.0.5-7.el6_0.x86_64 already installed and latest version
Package ncurses-5.7-3.20090208.el6.x86_64 already installed and latest version
Package e2fsprogs-1.41.12-11.el6.x86_64 already installed and latest version
No package krb5 available.
Package libidn-1.18-2.el6.x86_64 already installed and latest version
Package openldap-2.4.23-20.el6.x86_64 already installed and latest version
No package nss_ldap available.
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
---> Package bzip2-devel.x86_64 0:1.0.5-7.el6_0 will be installed
---> Package curl.x86_64 0:7.19.7-26.el6_1.2 will be updated
---> Package curl.x86_64 0:7.19.7-26.el6_2.4 will be an update
--> Processing Dependency: libcurl = 7.19.7-26.el6_2.4 for package: curl-7.19.7-26.el6_2.4.x86_64
---> Package e2fsprogs-devel.x86_64 0:1.41.12-11.el6 will be installed
--> Processing Dependency: libcom_err-devel = 1.41.12-11.el6 for package: e2fsprogs-devel-1.41.12-11.el6.x86_64
--> Processing Dependency: pkgconfig(com_err) for package: e2fsprogs-devel-1.41.12-11.el6.x86_64
---> Package freetype.x86_64 0:2.3.11-6.el6_1.7 will be updated
---> Package freetype.x86_64 0:2.3.11-6.el6_2.9 will be an update
---> Package freetype-devel.x86_64 0:2.3.11-6.el6_2.9 will be installed
---> Package gcc-c++.x86_64 0:4.4.6-3.el6 will be installed
--> Processing Dependency: libstdc++-devel = 4.4.6-3.el6 for package: gcc-c++-4.4.6-3.el6.x86_64
---> Package glib2-devel.x86_64 0:2.22.5-6.el6 will be installed
---> Package glibc.x86_64 0:2.12-1.47.el6 will be updated
--> Processing Dependency: glibc = 2.12-1.47.el6 for package: glibc-common-2.12-1.47.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.47.el6 for package: glibc-headers-2.12-1.47.el6.x86_64
---> Package glibc.x86_64 0:2.12-1.47.el6_2.12 will be an update
---> Package glibc-devel.x86_64 0:2.12-1.47.el6 will be updated
---> Package glibc-devel.x86_64 0:2.12-1.47.el6_2.12 will be an update
---> Package krb5-devel.x86_64 0:1.9-22.el6_2.1 will be installed
--> Pro

cessing Dependency: krb5-libs = 1.9-22.el6_2.1 for package: krb5-devel-1.9-22.el6_2.1.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.9-22.el6_2.1.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.9-22.el6_2.1.x86_64
---> Package libcurl-devel.x86_64 0:7.19.7-26.el6_2.4 will be installed
--> Processing Dependency: automake for package: libcurl-devel-7.19.7-26.el6_2.4.x86_64
---> Package libidn-devel.x86_64 0:1.18-2.el6 will be installed
---> Package libjpeg-devel.x86_64 0:6b-46.el6 will be installed
---> Package libpng.x86_64 2:1.2.46-1.el6_1 will be updated
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be an update
---> Package libpng-devel.x86_64 2:1.2.49-1.el6_2 will be installed
---> Package libxml2.x86_64 0:2.7.6-4.el6 will be updated
--> Processing Dependency: libxml2 = 2.7.6-4.el6 for package: libxml2-python-2.7.6-4.el6.x86_64
---> Package libxml2.x86_64 0:2.7.6-4.el6_2.4 will be an update
---> Package libxml2-devel.x86_64 0:2.7.6-4.el6_2.4 will be installed
---> Package ncurses-devel.x86_64 0:5.7-3.20090208.el6 will be installed
---> Package openldap-clients.x86_64 0:2.4.23-20.el6 will be installed
---> Package openldap-devel.x86_64 0:2.4.23-20.el6 will be installed
--> Processing Dependency: cyrus-sasl-devel >= 2.1 for package: openldap-devel-2.4.23-20.el6.x86_64
---> Package openldap-servers.x86_64 0:2.4.23-20.el6 will be installed
---> Package openssl.x86_64 0:1.0.0-20.el6 will be updated
---> Package openssl.x86_64 0:1.0.0-20.el6_2.5 will be an update
---> Package openssl-devel.x86_64 0:1.0.0-20.el6_2.5 will be installed
---> Package zlib-devel.x86_64 0:1.2.3-27.el6 will be installed
--> Running transaction check
---> Package automake.noarch 0:1.11.1-1.2.el6 will be installed
---> Package cyrus-sasl-devel.x86_64 0:2.1.23-13.el6 will be installed
---> Package glibc-common.x86_64 0:2.12-1.47.el6 will be updated
---> Package glibc-common.x86_64 0:2.12-1.47.el6_2.12 will be an update
---> Package glibc-headers.x86_64 0:2.12-1.47.el6 will be updated
---> Package glibc-headers.x86_64 0:2.12-1.47.el6_2.12 will be an update
---> Package keyutils-libs-devel.x86_64 0:1.4-3.el6 will be installed
---> Package krb5-libs.x86_64 0:1.9-22.el6 will be updated
---> Package krb5-libs.x86_64 0:1.9-22.el6_2.1 will be an update
---> Package libcom_err-devel.x86_64 0:1.41.12-11.el6 will be installed
---> Package libcurl.x86_64 0:7.19.7-26.el6_1.2 will be updated
---> Package libcurl.x86_64 0:7.19.7-26.el6_2.4 will be an update
---> Package libselinux-devel.x86_64 0:2.0.94-5.2.el6 will be installed
--> Processing Dependency: libsepol-devel >= 2.0.32-1 for package: libselinux-devel-2.0.94-5.2.el6.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-5.2.el6.x86_64
---> Package libstdc++-devel.x86_64 0:4.4.6-3.el6 will be installed
---> Package libxml2-python.x86_64 0:2.7.6-4.el6 will be updated
---> Package libxml2-python

.x86_64 0:2.7.6-4.el6_2.4 will be an update
--> Running transaction check
---> Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
autoconf noarch 2.63-5.1.el6 base 781 k
bzip2-devel x86_64 1.0.5-7.el6_0 base 250 k
e2fsprogs-devel x86_64 1.41.12-11.el6 base 158 k
freetype-devel x86_64 2.3.11-6.el6_2.9 updates 364 k
gcc-c++ x86_64 4.4.6-3.el6 base 4.7 M
glib2-devel x86_64 2.22.5-6.el6 base 1.3 M
krb5-devel x86_64 1.9-22.el6_2.1 updates 1.2 M
libcurl-devel x86_64 7.19.7-26.el6_2.4 updates 243 k
libidn-devel x86_64 1.18-2.el6 base 137 k
libjpeg-devel x86_64 6b-46.el6 base 100 k
libpng-devel x86_64 2:1.2.49-1.el6_2 updates 112 k
libxml2-devel x86_64 2.7.6-4.el6_2.4 updates 1.1 M
ncurses-devel x86_64 5.7-3.20090208.el6 base 642 k
openldap-clients x86_64 2.4.23-20.el6 base 161 k
openldap-devel x86_64 2.4.23-20.el6 base 1.1 M
openldap-servers x86_64 2.4.23-20.el6 base 2.0 M
openssl-devel x86_64 1.0.0-20.el6_2.5 updates 1.1 M
zlib-devel x86_64 1.2.3-27.el6 base 44 k
Updating:
curl x86_64 7.19.7-26.el6_2.4 updates 192 k
freetype x86_64 2.3.11-6.el6_2.9 updates 359 k
glibc x86_64 2.12-1.47.el6_2.12 updates 3.8 M
glibc-devel x86_64 2.12-1.47.el6_2.12 updates 967 k
libpng x86_64 2:1.2.49-1.el6_2 updates 182 k
libxml2 x86_64 2.7.6-4.el6_2.4 updates 795 k
openssl x86_64 1.0.0-20.el6_2.5 updates 1.4 M
Installing for dependencies:
automake noarch 1.11.1-1.2.el6 base 550 k
cyrus-sasl-devel x86_64 2.1.23-13.el6 base 302 k
keyutils-libs-devel x86_64 1.4-3.el6 base 28 k
libcom_err-devel x86_64 1.41.12-11.el6 base 31 k
libselinux-devel x86_64 2.0.94-5.2.el6 base 136 k
libsepol-devel x86_64 2.0.41-4.el6 b

ase 64 k
libstdc++-devel x86_64 4.4.6-3.el6 base 1.5 M
Updating for dependencies:
glibc-common x86_64 2.12-1.47.el6_2.12 updates 14 M
glibc-headers x86_64 2.12-1.47.el6_2.12 updates 598 k
krb5-libs x86_64 1.9-22.el6_2.1 updates 709 k
libcurl x86_64 7.19.7-26.el6_2.4 updates 163 k
libxml2-python x86_64 2.7.6-4.el6_2.4 updates 320 k

Transaction Summary
================================================================================
Install 25 Package(s)
Upgrade 12 Package(s)

Total download size: 41 M
Downloading Packages:
(1/37): autoconf-2.63-5.1.el6.noarch.rpm | 781 kB 00:05
(2/37): automake-1.11.1-1.2.el6.noarch.rpm | 550 kB 00:03
(3/37): bzip2-devel-1.0.5-7.el6_0.x86_64.rpm | 250 kB 00:01
(4/37): curl-7.19.7-26.el6_2.4.x86_64.rpm | 192 kB 00:00
(5/37): cyrus-sasl-devel-2.1.23-13.el6.x86_64.rpm | 302 kB 00:02
(6/37): e2fsprogs-devel-1.41.12-11.el6.x86_64.rpm | 158 kB 00:00
(7/37): freetype-2.3.11-6.el6_2.9.x86_64.rpm | 359 kB 00:02
(8/37): freetype-devel-2.3.11-6.el6_2.9.x86_64.rpm | 364 kB 00:00
(9/37): gcc-c++-4.4.6-3.el6.x86_64.rpm | 4.7 MB 00:33
(10/37): glib2-devel-2.22.5-6.el6.x86_64.rpm | 1.3 MB 00:05
(11/37): glibc-2.12-1.47.el6_2.12.x86_64.rpm | 3.8 MB 00:15
(12/37): glibc-common-2.12-1.47.el6_2.12.x86_64.rpm | 14 MB 01:11
(13/37): glibc-devel-2.12-1.47.el6_2.12.x86_64.rpm | 967 kB 00:06
(14/37): glibc-headers-2.12-1.47.el6_2.12.x86_64.rpm | 598 kB 00:03
(15/37): keyutils-libs-devel-1.4-3.el6.x86_64.rpm | 28 kB 00:00
(16/37): krb5-devel-1.9-22.el6_2.1.x86_64.rpm | 1.2 MB 00:05
(17/37): krb5-libs-1.9-22.el6_2.1.x86_64.rpm | 709 kB 00:03
(18/37): libcom_err-devel-1.41.12-11.el6.x86_64.rpm | 31 kB 00:00
(19/37): libcurl-7.19.7-26.el6_2.4.x86_64.rpm | 163 kB 00:01
(20/37): libcurl-devel-7.19.7-26.el6_2.4.x86_64.rpm | 243 kB 00:01
(21/37): libidn-devel-1.18-2.el6.x86_64.rpm | 137 kB 00:01
(22/37): libjpeg-devel-6b-46.el6.x86_64.rpm | 100 kB 00:00
(23/37): libpng-1.2.49-1.el6_2.x86_64.rpm | 182 kB 00:00
(24/37): libpng-devel-1.2.49-1.el6_2.x86_64.rpm | 112 kB 00:00
(25/37): libselinux-devel-2.0.94-5.2.el6.x86_64.rpm | 136 kB 00:00
(26/37): libsepol-devel-2.0.41-4.el6.x86_64.rpm | 64 kB 00:00
(27/37): libstdc++-devel-4.4.6-3.el6.x86_64.rpm | 1.5 MB 00:09
(28/37): libxml2-2.7.6-4.el6_2.4.x86_64.r

pm | 795 kB 00:02
(29/37): libxml2-devel-2.7.6-4.el6_2.4.x86_64.rpm | 1.1 MB 00:03
(30/37): libxml2-python-2.7.6-4.el6_2.4.x86_64.rpm | 320 kB 00:01
(31/37): ncurses-devel-5.7-3.20090208.el6.x86_64.rpm | 642 kB 00:04
(32/37): openldap-clients-2.4.23-20.el6.x86_64.rpm | 161 kB 00:00
(33/37): openldap-devel-2.4.23-20.el6.x86_64.rpm | 1.1 MB 00:10
(34/37): openldap-servers-2.4.23-20.el6.x86_64.rpm | 2.0 MB 00:13
(35/37): openssl-1.0.0-20.el6_2.5.x86_64.rpm | 1.4 MB 00:06
(36/37): openssl-devel-1.0.0-20.el6_2.5.x86_64.rpm | 1.1 MB 00:06
(37/37): zlib-devel-1.2.3-27.el6.x86_64.rpm | 44 kB 00:00
--------------------------------------------------------------------------------
Total 175 kB/s | 41 MB 04:02
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key)
Package: centos-release-6-2.el6.centos.7.x86_64 (@anaconda-CentOS-201112091719.x86_64/6.2)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : glibc-common-2.12-1.47.el6_2.12.x86_64 1/49
Updating : glibc-2.12-1.47.el6_2.12.x86_64 2/49
Updating : krb5-libs-1.9-22.el6_2.1.x86_64 3/49
Installing : zlib-devel-1.2.3-27.el6.x86_64 4/49
Updating : openssl-1.0.0-20.el6_2.5.x86_64 5/49
Updating : libcurl-7.19.7-26.el6_2.4.x86_64 6/49
Updating : libxml2-2.7.6-4.el6_2.4.x86_64 7/49
Installing : libcom_err-devel-1.41.12-11.el6.x86_64 8/49
Updating : glibc-headers-2.12-1.47.el6_2.12.x86_64 9/49
Updating : 2:libpng-1.2.49-1.el6_2.x86_64 10/49
Updating : freetype-2.3.11-6.el6_2.9.x86_64 11/49
Installing : cyrus-sasl-devel-2.1.23-13.el6.x86_64 12/49
Installing : libsepol-devel-2.0.41-4.el6.x86_64 13/49
Installing : libselinux-devel-2.0.94-5.2.el6.x86_64 14/49
Installing : libstdc++-devel-4.4.6-3.el6.x86_64 15/49
Installing : libidn-devel-1.18-2.el6.x86_64 16/49
Installing : autoconf-2.63-5.1.el6.noarch 17/49
Installing : automake-1.11.1-1.2.el6.noarch 18/49
Installing : keyutils-libs-devel-1.4-3.el6.x86_64 19/4

9
Installing : krb5-devel-1.9-22.el6_2.1.x86_64 20/49
Installing : openssl-devel-1.0.0-20.el6_2.5.x86_64 21/49
Installing : libcurl-devel-7.19.7-26.el6_2.4.x86_64 22/49
Installing : gcc-c++-4.4.6-3.el6.x86_64 23/49
Installing : openldap-devel-2.4.23-20.el6.x86_64 24/49
Installing : freetype-devel-2.3.11-6.el6_2.9.x86_64 25/49
Installing : 2:libpng-devel-1.2.49-1.el6_2.x86_64 26/49
Updating : glibc-devel-2.12-1.47.el6_2.12.x86_64 27/49
Installing : e2fsprogs-devel-1.41.12-11.el6.x86_64 28/49
Installing : libxml2-devel-2.7.6-4.el6_2.4.x86_64 29/49
Updating : libxml2-python-2.7.6-4.el6_2.4.x86_64 30/49
Updating : curl-7.19.7-26.el6_2.4.x86_64 31/49
Installing : openldap-servers-2.4.23-20.el6.x86_64 32/49
Installing : openldap-clients-2.4.23-20.el6.x86_64 33/49
Installing : glib2-devel-2.22.5-6.el6.x86_64 34/49
Installing : ncurses-devel-5.7-3.20090208.el6.x86_64 35/49
Installing : bzip2-devel-1.0.5-7.el6_0.x86_64 36/49
Installing : libjpeg-devel-6b-46.el6.x86_64 37/49
Cleanup : glibc-devel-2.12-1.47.el6.x86_64 38/49
Cleanup : curl-7.19.7-26.el6_1.2.x86_64 39/49
Cleanup : libcurl-7.19.7-26.el6_1.2.x86_64 40/49
Cleanup : libxml2-python-2.7.6-4.el6.x86_64 41/49
Cleanup : openssl-1.0.0-20.el6.x86_64 42/49
Cleanup : glibc-headers-2.12-1.47.el6.x86_64 43/49
Cleanup : krb5-libs-1.9-22.el6.x86_64 44/49
Cleanup : libxml2-2.7.6-4.el6.x86_64 45/49
Cleanup : freetype-2.3.11-6.el6_1.7.x86_64 46/49
Cleanup : 2:libpng-1.2.46-1.el6_1.x86_64 47/49
Cleanup : glibc-common-2.12-1.47.el6.x86_64 48/49
Cleanup : glibc-2.12-1.47.el6.x86_64 49/49

Installed:
autoconf.noarch 0:2.63-5.1.el6
bzip2-devel.x86_64 0:1.0.5-7.el6_0
e2fsprogs-devel.x86_64 0:1.41.12-11.el6
freetype-devel.x86_64 0:2.3.11-6.el6_2.9
gcc-c++.x86_64 0:4.4.6-3.el6
glib2-devel.x86_64 0:2.22.5-6.el6
krb5-devel.x86_64 0:1.9-22.e

l6_2.1
libcurl-devel.x86_64 0:7.19.7-26.el6_2.4
libidn-devel.x86_64 0:1.18-2.el6
libjpeg-devel.x86_64 0:6b-46.el6
libpng-devel.x86_64 2:1.2.49-1.el6_2
libxml2-devel.x86_64 0:2.7.6-4.el6_2.4
ncurses-devel.x86_64 0:5.7-3.20090208.el6
openldap-clients.x86_64 0:2.4.23-20.el6
openldap-devel.x86_64 0:2.4.23-20.el6
openldap-servers.x86_64 0:2.4.23-20.el6
openssl-devel.x86_64 0:1.0.0-20.el6_2.5
zlib-devel.x86_64 0:1.2.3-27.el6

Dependency Installed:
automake.noarch 0:1.11.1-1.2.el6
cyrus-sasl-devel.x86_64 0:2.1.23-13.el6
keyutils-libs-devel.x86_64 0:1.4-3.el6
libcom_err-devel.x86_64 0:1.41.12-11.el6
libselinux-devel.x86_64 0:2.0.94-5.2.el6
libsepol-devel.x86_64 0:2.0.41-4.el6
libstdc++-devel.x86_64 0:4.4.6-3.el6

Updated:
curl.x86_64 0:7.19.7-26.el6_2.4 freetype.x86_64 0:2.3.11-6.el6_2.9
glibc.x86_64 0:2.12-1.47.el6_2.12 glibc-devel.x86_64 0:2.12-1.47.el6_2.12
libpng.x86_64 2:1.2.49-1.el6_2 libxml2.x86_64 0:2.7.6-4.el6_2.4
openssl.x86_64 0:1.0.0-20.el6_2.5

Dependency Updated:
glibc-common.x86_64 0:2.12-1.47.el6_2.12
glibc-headers.x86_64 0:2.12-1.47.el6_2.12
krb5-libs.x86_64 0:1.9-22.el6_2.1
libcurl.x86_64 0:7.19.7-26.el6_2.4
libxml2-python.x86_64 0:2.7.6-4.el6_2.4


@download
wget "https://www.doczj.com/doc/3a13839402.html,/pub/gnu/libiconv/libiconv-1.13.1.tar.gz"
wget "https://www.doczj.com/doc/3a13839402.html,/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download"
wget "https://www.doczj.com/doc/3a13839402.html,/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz/download"
wget "https://www.doczj.com/doc/3a13839402.html,/get/php-5.4.4.tar.gz/from/https://www.doczj.com/doc/3a13839402.html,/mirror"
wget "https://www.doczj.com/doc/3a13839402.html,/get/Downloads/MySQL-5.5/mysql-5.5.25.tar.gz/from/http://ftp.jaist.ac.jp/pub/mysql/"
wget "https://www.doczj.com/doc/3a13839402.html,/download/nginx-1.2.1.tar.gz"
wget https://www.doczj.com/doc/3a13839402.html,/soft/linux/nginx_php/mysql/mysql-5.5.3-m3.tar.gz
wget https://www.doczj.com/doc/3a13839402.html,/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.6.1.tar.bz2
wget https://www.doczj.com/doc/3a13839402.html,/soft/linux/nginx_php/pcre/pcre-8.10.tar.gz

@php


https://www.doczj.com/doc/3a13839402.html,/get/php-5.4.4.tar.gz/from/https://www.doczj.com/doc/3a13839402.html,/mirror

@mysql
https://www.doczj.com/doc/3a13839402.html,/get/Downloads/MySQL-5.5/mysql-5.5.25.tar.gz/from/http://ftp.jaist.ac.jp/pub/mysql/

@nginx
https://www.doczj.com/doc/3a13839402.html,/download/nginx-1.2.1.tar.gz

@libiconv
./configure --prefix=/usr/local/libiconv-1.13.1
make
make install

@建立软链接
ln -s /usr/local/libiconv-1.13.1/lib/libiconv.so /usr/lib
ln -s /usr/local/libiconv-1.13.1/lib/libiconv.so.2 /usr/lib

@libmcryp install
./configure --preifx=/usr/local/libmcrypt-2.5.8
make
make install

@mhash install
./configure
make
make install

@建立软链接
ln -s /usr/local/libmcrypt-2.5.8/lib/https://www.doczj.com/doc/3a13839402.html, /usr/lib/https://www.doczj.com/doc/3a13839402.html,
ln -s /usr/local/libmcrypt-2.5.8/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/libmcrypt-2.5.8/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/libmcrypt-2.5.8/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/https://www.doczj.com/doc/3a13839402.html, /usr/lib/https://www.doczj.com/doc/3a13839402.html,
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


@mysql install

/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql

./configure --prefix=/usr/local/mysql5.3.3 --enable-assembler --enable-local-infile --enable-thread-safe-client \
--with-big-tables --with-charset=gbk --with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline --with-ssl \
--with-embedded-server --with-pthread --with-mysqld-user=mysql --with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static --with-plugins=partition,innobase,innodb_plugin,myisammrg

@建立软链接
ln -s /usr/local/mysql5.3.3/bin/mysql /usr/bin/mysql
ln -s /usr/local/mysql5.3.3/bin/mysqladmin /usr/bin/mysqladmin
ln -s /usr/local/mysql5.3.3/bin/mysqldump /usr/bin/mysqldump

@create mysql binlog dir
mkdir -p /data/mysql/3306/binlog

@mysql self install
/usr/local/mysql5.3.3/bin/mysql_install_db --basedir=/usr/local/mysql5.3.3 --datadir=/data/mysql/3306/data --user=mysql

@mysql limit
chown -R mysql:mysql /data/mysql/

@mysql config
vim /data/mysql/3306/https://www.doczj.com/doc/3a13839402.html,f

============================================================================
[mysql]
prompt="(\u: 127.0.0.1:)[\d]> "
no-auto-rehash

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

[mysqld]
#default-character-set = utf8
user = mysql
port = 3306
socket = /data/mysql/3306/mysql-3306.sock
basedir = /usr/local/mysql5.3.3/
datadir = /data/mysql/3306/data/
log-error = /data/mysql/3306/mysql_error.log
pid-file = /data/mysql/3306/mysql.pid
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_short_format
log-bin = /data/mysql/3306/binlog/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_repair_threads = 1
myisam_recover
skip-name-resolve

interactive_timeout = 120
wait_timeout = 120

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

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

server-id = 1

#innodb_additional_mem_pool_size = 16M
#innodb_buffer_pool_size = 512M
#innodb_data_file_path = ibdata: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

binlog-ignore-db = mysql
binlog-ignore-db = test
binlog-ignore-db = information_schema

[mysqldump]
quick
max_allowed_packet = 32M
============================================================================

@mysql start
/usr/local/mysql5.3.3/bin/mysqld_safe --defaults-file=/data/mysql/3306/https://www.doczj.com/doc/3a13839402.html,f

@mysql test
mysql -uroot -p -S "/data/mysql/3306/mysql-3306.sock"

@5.3.3 mysql bug 修改
vim /usr/local/mysql5.3.3/include/mysql/my_sys.h
#include => #include

vim /usr/local/mysql5.3.3/include/mysql/m_string.h
#include => #include

vim /usr/local/mysql5.3.3/include/mysql/plugin.h
#include => #include

vim /usr/local/mysql5.3.3/include/mysql/services.h
#include => #include
#include => #include

@php install
./configure --prefix=/usr/local/php-5.4.4 --with-config-file-path=/usr/local/php-5.4.4/etc --with-mysql=/usr/local/mysql5.3.3 --with-mysqli=/usr/local/mysql5.3.3/bin/mysql_config --with-iconv-dir=/usr/local/libiconv-1.13.1 --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt=/usr/local/libmcrypt-2.5.8/ --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip
make

ZEND_EXTRA_LIBS='-liconv'
make install

@编译安装PHP5扩展模块
@eAccelerator install PHP 5.4.4 和 eaccelerator 0.9.6.1不兼容

/usr/local/php-5.4.4/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php-5.4.4/bin/php-config

@配置web目录
[root@localhost ~]# groupadd www
[root@localhost ~]# useradd -g www www
[root@localhost ~]# mkdir /data/
[root@localhost ~]# mkdir /data/web/
[root@localhost ~]# chmod +w /data/web/
[root@localhost ~]# chown -R www:www /data/web/


@fpm config
cp /usr/local/php-5.4.4/etc/php-fpm.conf.default /usr/local/php-5.4.4/etc/php-fpm.conf
vim /usr/local/php-5.4.4/etc/php-fpm.conf

================================================================================================
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;

; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr/local/php-5.4.4). This prefix can be dynamicaly changed by using the
; '-p' argument from the command line.

; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p arguement)
; - /usr/local/php-5.4.4 otherwise
;include=etc/fpm.d/*.conf

;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;

[global]
; Pid file
; Note: the default prefix is /usr/local/php-5.4.4/var
; Default Value: none
pid = run/php-fpm.pid

; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; in a local file.
; Note: the default prefix is /usr/local/php-5.4.4/var
; Default Value: log/php-fpm.log
error_log = log/php-fpm.log

; syslog_facility is used to specify what type of program is logging the
; message. This lets syslogd specify that messages from different facilities
; will be handled differently.
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
; Default Value: daemon
;syslog.facility = daemon

; syslog_ident is prepended to every message. If you have multiple FPM
; instances running on the same server, you can change the default value
; which must suit common needs.
; Default Value: php-fpm
;syslog.ident = php-fpm

; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
log_level = notice

; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
emergency_restart_threshold = 10

; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated. This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Defau

lt Unit: seconds
; Default Value: 0
emergency_restart_interval = 1m

; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
process_control_timeout = 5s

; The maximum number of processes FPM will fork. This has been design to control
; the global number of processes when using dynamic PM within a lot of pools.
; Use it with caution.
; Note: A value of 0 indicates no limit
; Default Value: 0
process.max = 128

; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
daemonize = yes

; Set open file descriptor rlimit for the master process.
; Default Value: system defined value
rlimit_files = 65535

; Set max core size rlimit for the master process.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
rlimit_core = 0

; Specify the event mechanism FPM will use. The following is available:
; - select (any POSIX os)
; - poll (any POSIX os)
; - epoll (linux >= 2.5.44)
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
; - /dev/poll (Solaris >= 7)
; - port (Solaris >= 10)
; Default Value: not set (auto detection)
events.mechanism = epoll

;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;

; Multiple pools of child processes may be started with different listening
; ports and different management options. The name of the pool will be
; used in logs and stats. There is no limitation on the number of pools which
; FPM can handle. Your system will tell you anyway :)

; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[www]

; Per pool prefix
; It only applies on the following directives:
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr/local/php-5.4.4) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = www
group = www

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000

; Set listen(2) backlog.
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
listen.backlog = 128

; Set permissions for unix socket, if one is used. In Linux

, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0666
listen.owner = nobody
listen.group = nobody
listen.mode = 0666

; List of ipv4 addresses of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
listen.allowed_clients = 127.0.0.1

; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; ondemand - no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children - the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = dynamic

; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.

; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 5

; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 2

; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 1

; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3

; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 10s;

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 1024

; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
; pool - the name of the pool;
; process manager - static, dynamic or ondemand;
; start time - the date and time FPM has started;
; start since - number of seconds since FPM has started;
; accepted conn - the number of request accepted by the pool;
; listen queue - the number of request in the queue of pending
; connections (see backlog in listen(2));
; max listen queue - the maximum number of requests in the queue
; of pending connections since FPM has started;
; listen queue len - the size of the socket queue of pending connections;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes;
; max active processes - the maximum number of active processes since FPM
; has started;
; max children reached - number of times, the process limit has been reached,
; when pm tries to start more children (works only for
; pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
; pool: www
; process manager: static
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 62636
; accepted conn: 190460
; listen queue: 0
; max listen queue: 1
; listen queue len: 42
; idle processes: 4
; active processes: 11
; total processes: 15
; max active processes: 12
; max children reached: 0
;
; By default the status p

age output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
; http://www.foo.bar/status?xml&full
; The Full status returns for each process:
; pid - the PID of the process;
; state - the state of the process (Idle, Running, ...);
; start time - the date and time the process has started;
; start since - the number of seconds since the process has started;
; requests - the number of requests the process has served;
; request duration - the duration in s of the requests;
; request method - the request method (GET, POST, ...);
; request URI - the request URI with the query string;
; content length - the content length of the request (only with POST);
; user - the user (PHP_AUTH_USER) (or '-' if not set);
; script - the main script called (or '-' if not set);
; last request cpu - the %cpu the last request consumed
; it's always 0 if the process is not in Idle state
; because CPU calculation is done when the request
; processing has terminated;
; last request memory - the max amount of memory the last request consumed
; it's always 0 if the process is not in Idle state
; because memory calculation is done when the request
; processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
; ************************
; pid: 31330
; state: Running
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 63087
; requests: 12808
; request duration: 1250261
; request method: GET
; request URI: /test_mem.php?N=10000
; content length: 0
; user: -
; script: /home/fat/web/docs/php/test_mem.php
; last request cpu: 0.00
; last request memory: 0
;
; Note: There is a real-time FPM status monitoring sample web page available
; It's available in: ${prefix}/share/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php

extension or it
; may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status

; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping

; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong

; The access log file
; Default: not set
access.log = /data/log/fpm/$pool.access.log

; The access log format.
; The following syntax is allowed
; %%: the '%' character
; %C: %CPU used by the request
; it can accept the following format:
; - %{user}C for user CPU only
; - %{system}C for system CPU only
; - %{total}C for user + system CPU (default)
; %d: time taken to serve the request
; it can accept the following format:
; - %{seconds}d (default)
; - %{miliseconds}d
; - %{mili}d
; - %{microseconds}d
; - %{micro}d
; %e: an environment variable (same as $_ENV or $_SERVER)
; it must be associated with embraces to specify the name of the env
; variable. Some exemples:
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
; %f: script filename
; %l: content-length of the request (for POST request only)
; %m: request method
; %M: peak of memory allocated by PHP
; it can accept the following format:
; - %{bytes}M (default)
; - %{kilobytes}M
; - %{kilo}M
; - %{megabytes}M
; - %{mega}M
; %n: pool name
; %o: ouput header
; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o
; - %{X-Powered-By}o
; - %{Transfert-Encoding}o
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
; %s: status (response code)
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; %u: remote user
;
; Default:

"%R - %u %t \"%m %r\" %s"
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"

; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /data/log/fpm/$pool.log.slow

; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = 5s

; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_terminate_timeout = 0

; Set open file descriptor rlimit.
; Default Value: system defined value
rlimit_files = 65535

; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0

; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =

; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
;chdir = /var/www

; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes

; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; exectute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5

; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same

as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.

; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local/php-5.4.4)

; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@https://www.doczj.com/doc/3a13839402.html,
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

================================================================================================
ulimit -SHn 65535

启动fpm
/usr/local/php-5.4.4/sbin/php-fpm

@install pcre lib for nginx
./configure
make
make install

@nginx install
./configure --user=www --group=www --prefix=/usr/local/nginx-1.2.1 --with-http_stub_status_module --with-http_ssl_module
make
make install

@create nginx log dir
mkdir -p /data/log/log_nginx/
chown www:www /data/log/log_nginx/
chmod +w /data/log/log_nginx/

@create nginx config file
rm -rf /usr/local/nginx-1.2.1/conf/nginx.conf
vim /usr/local/nginx-1.2.1/conf/nginx.conf

==================================================================================================
user www www;

worker_processes 8;

error_log /data/log/log_nginx/nginx_error.log crit;

pid /usr/local/nginx-1.2.1/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;

log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen 80;
server_name https://www.doczj.com/doc/3a13839402.html,;
index index.html index.htm index.php;
root /data/web;

#limit_conn crawler 20;

location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

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

access_log /data/log/log_nginx/access.log access;
}
}
==================================================================================================

@create fcgi file
nginx 1.2.1 已经默认添加了fcgi文件
path:/usr/local/nginx-1.2.1/conf/fastcgi.conf


@test config file
/usr/local/nginx-1.2.1/sbin/nginx -t

@start nginx
/usr/local/nginx-1.2.1/sbin/nginx

@boot-strap start nginx to rc.local
vim /etc/rc.local
ulimit -SHn 65535
/usr/local/php-5.4.4/sbin/php-fpm
/usr/local/nginx-1.2.1/sbin/nginx

@complete

相关主题
文本预览
相关文档 最新文档