Simple LNMP architecture for yum installation in Centos 6.4
I. Installation version
Nginx 1.6.3
Pcre-devel 7.8-6
Mysql 5.1.73
Php 5.3.3
Ii. install required packages
[Root @ localhost ~] # Yum-y install lrzsz
[Root @ localhost ~] # Yum-y install gcc pcre-devel zlib-devel
Compile and install nginx
[Root @ localhost ~] #./Configure -- prefix =/usr/local/nginx
[Root @ localhost ~] # Make & make install
Start nginx
[Root @ localhost ~] #/Usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx. conf
Install mysql
[Root @ localhost ~] # Yum-y install mysql-server mysql-devel
[Root @ localhost ~] #/Etc/init. d/mysqld start
Install php
[Root @ localhost ~] # Yum install php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
[Root @ localhost ~] # Yum install php-fpm
[Root @ localhost ~] #/Etc/init. d/php-fpm start
Configure nginx to support php
[Root @ localhost conf] # cat/usr/local/nginx/html/index. php
<? Php
Phpinfo ();
?>
[Root @ localhost 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;
}
Restart nginx
/Usr/local/nginx/sbin/nginx-s reload
Iii. Access domain name Testing
Http://www.webtest.com/index.php