1
|
[root@yong ~]
# cd /usr/local/src
|
1
2
|
[root@yong src]
# wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
--2015-04-27 09:23:01-- http:
//syslab
.comsenz.com
/downloads/linux/mysql-5
.1.40-linux-i686-icc-glibc23.
tar
.gzResolving syslab.comsenz.com... 101.227.130.115Connecting to syslab.comsenz.com|101.227.130.115|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 123633020 (118M) [application
/octet-stream
]Saving to: “mysql-5.1.40-linux-i686-icc-glibc23.
tar
.gz”
|
1
|
[root@yong src]
# tar -zxvf mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
|
1
|
[root@yong src]
# mv mysql-5.1.40-linux-i686-icc-glibc23 /usr/local/mysql
|
1
|
[root@yong src]
# useradd -s /sbin/nologin mysql
|
1
2
3
4
5
6
7
8
|
[root@yong src]
# cd /usr/local/mysql/
[root@yong mysql]
# mkdir -p /data/mysql
[root@yong mysql]
# chown -R mysql:mysql /data/mysql/
[root@yong mysql]
# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql/
Installing MySQL system tables...
OK
Filling help tables...
OK
|
1
|
[root@yong mysql]
# cp support-files/my-large.cnf /etc/my.cnf
|
1
2
|
[root@yong mysql]
# cp support-files/mysql.server /etc/init.d/mysqld
[root@yong mysql]
# chmod 755 /etc/init.d/mysqld
|
1
|
[root@yong mysql]
# vim /etc/init.d/mysqld
|
1
2
3
4
|
[root@yong mysql]
# chkconfig --add mysqld
[root@yong mysql]
# chkconfig mysqld on
[root@yong mysql]
# service mysqld start
Starting MySQL.. [ OK ]
|
1
2
3
|
[root@localhost mysql]
# ps aux |grep mysqld
root 1341 0.0 0.1 6680 1328 pts
/0
S 20:22 0:00
/bin/sh
/usr/local/mysql/bin/mysqld_safe
--datadir=
/data/mysql
--pid-
file
=
/data/mysql/localhost
.localdomain.pid
mysql 1456 0.3 4.2 381608 43504 pts
/0
Sl 20:22 0:01
/usr/local/mysql/bin/mysqld
--basedir=
/usr/local/mysql
--datadir=
/data/mysql
--user=mysql --log-error=
/data/mysql/localhost
.localdomain.err --pid-
file
=
/data/mysql/localhost
.localdomain.pid --socket=
/tmp/mysql
.sock --port=3306
|
1
2
3
|
[root@localhost src]
# wget http://cn2.php.net/distributions/php-5.4.37.tar.bz2
[root@localhost src]
# tar -jxvf php-5.4.37.tar.bz2
[root@localhost src]
# cd php-5.4.37
|
1
|
[root@localhost php-5.4.37]
# useradd -s /sbin/nologin php-fpm
|
1
|
[root@localhost php-5.4.37]
#./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --with-curl
|
1
|
[root@localhost php-5.4.37]
# yum install -y gcc
|
1
|
[root@localhost php-5.4.37]
# yum install -y libxml2-devel
|
1
|
[root@localhost php-5.4.37]
# yum install -y libcurl-devel
|
1
|
[root@localhost php-5.4.37]
# yum install -y libjpeg-devel
|
1
|
[root@localhost php-5.4.37]
# yum install -y libpng-devel
|
1
|
[root@localhost php-5.4.37]
# yum install -y freetype-devel
|
1
2
|
[root@localhost php-5.4.37]
# yum install -y epel-release
[root@localhost php-5.4.37]
# yum install -y libmcrypt-devel
|
1
2
3
|
[root@localhost php-5.4.37]
# make && make install
[root@localhost php-5.4.37]
# echo $?
0
|
1
|
[root@localhost php-5.4.37]
# cp php.ini-production /usr/local/php/etc/php.ini
|
1
2
|
[root@localhost php-5.4.37]
# cp /usr/local/src/php-5.4.37/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@localhost php-5.4.37]
# mv /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
|
1
2
3
4
5
|
[root@localhost php-5.4.37]
# chmod 755 /etc/init.d/php-fpm
[root@localhost php-5.4.37]
# chkconfig --add php-fpm
[root@localhost php-5.4.37]
# service php-fpm start
Starting php-fpm
done
[root@localhost php-5.4.37]
# chkconfig php-fpm on
|
1
2
3
4
|
[root@localhost ~]
# cd /usr/local/src/
[root@localhost src]
# wget http://nginx.org/download/nginx-1.6.2.tar.gz
[root@localhost src]
# tar zxvf nginx-1.6.2.tar.gz
[root@localhost src]
# cd nginx-1.6.2
|
1
|
[root@localhost nginx-1.6.2]
# ./configure --prefix=/usr/local/nginx --with-pcre
|
1
|
[root@localhost nginx-1.6.2]
# yum install -y pcre-devel
|
1
2
3
|
[root@localhost nginx-1.6.2]
# make && make install
[root@localhost nginx-1.6.2]
# echo $?
0
|
1
2
3
4
|
[root@localhost nginx-1.6.2]
# /usr/local/nginx/sbin/nginx
[root@localhost ~]
# ps aux |grep nginx
root 986 0.0 0.0 3552 528 ? Ss 08:56 0:00 nginx: master process
/usr/local/nginx/sbin/nginx
-c
/usr/local/nginx/conf/nginx
.conf
nobody 988 0.0 0.0 3752 884 ? S 08:56 0:00 nginx: worker process
|
1
|
[root@localhost nginx-1.6.2]
# vi /etc/init.d/nginx
|
1
2
3
4
5
|
[root@localhost nginx-1.6.2]
# chmod a+x /etc/init.d/nginx
[root@localhost nginx-1.6.2]
# ls -l /etc/init.d/nginx
-rwxr-xr-x. 1 root root 1211 5月 11 17:37
/etc/init
.d
/nginx
[root@localhost nginx-1.6.2]
# chkconfig --add nginx
[root@localhost nginx-1.6.2]
# chkconfig nginx on
|
1
2
3
4
5
6
7
8
|
[root@localhost nginx-1.6.2]
# vi /usr/local/nginx/conf/nginx
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/usr/local/nginx/html
$fastcgi_script_name;
include fastcgi_params;
}
|
1
|
[root@localhost nginx-1.6.2]
# /usr/local/nginx/sbin/nginx -s reload
|
1
2
3
4
|
[root@localhost nginx-1.6.2]
# vi /usr/local/nginx/html/phpinfo.php
<?php
phpinfo();
?>
|
1
2
3
4
5
6
7
8
|
[root@localhost nginx-1.6.2]
# curl localhost/phpinfo.php -I
HTTP
/1
.1 200 OK
Server:
nginx
/1
.6.2
Date: Mon, 11 May 2015 09:49:36 GMT
Content-Type: text
/html
Connection: keep-alive
X-Powered-By: PHP
/5
.4.37
|