一、安装版本
nginx 1.6.3
pcre-devel 7.8-6
mysql 5.1.73
php 5.3.3
二、安装需要的包
[[email protected] ~]#yum -y install lrzsz
[[email protected] ~]#yum -y install gcc pcre-devel zlib zlib-devel
编译安装nginx
[[email protected] ~]#./configure --prefix=/usr/local/nginx
[[email protected] ~]#make && make install
启动nginx
[[email protected] ~]#/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
安装mysql
[[email protected] ~]#yum -y install mysql mysql-server mysql-devel
[[email protected] ~]#/etc/init.d/mysqld start
安装php
[[email protected] ~]#yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
[[email protected] ~]#yum install php-fpm
[[email protected] ~]#/etc/init.d/php-fpm start
配置nginx支持php
[[email protected] conf]# cat /usr/local/nginx/html/index.php
<?php
phpinfo();
?>
[[email protected] conf]#vi /usr/local/nginx/conf/nginx.conf
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;
}
重启nginx
/usr/local/nginx/sbin/nginx -s reload
三、访问域名测试
http://www.webtest.com/index.php