Debian quickly build lamp and lnmp environments
Operating system environment: debian7.7
Install the lamp environment
Apt-get install apache2 mysql-server php5 php-pear php5-mysql php5-gd php5-curl php5-common php5-dev php5-xcache-y
Echo "<? Php phpinfo ();?> ">/Var/www/index. php
[Email protected]: ~ # Curl-I http: // 192.168.5.44/index. php
HTTP/1.1 200 OK
Date: Thu, 06 Nov 2014 08:57:05 GMT
Server: Apache/2.2.22 (Debian)
X-Powered-By: PHP/5.4.34-0 + deb7u1
Vary: Accept-Encoding
Content-Type: text/html
Install the lnmp environment
Apt-get install nginx mysql-server php5 php5-fpm php-pear php5-mysql php5-gd php5-curl php5-common php5-dev php5-xcache-y
Echo "<? Php phpinfo ();?> ">/Usr/share/nginx/www/index. php
# Config nginx
Vim/etc/nginx/sites-available/default
Location ~ \. Php $ {
Fastcgi_split_path_info ^ (. + \. php) (/. +) $;
# NOTE: You shoshould have "cgi. fix_pathinfo = 0;" in php. ini
#
# With php5-cgi alone:
Fastcgi_pass 127.0.0.1: 9000;
# With php5-fpm:
# Fastcgi_pass unix:/var/run/php5-fpm.sock;
Fastcgi_index index. php;
Include fastcgi_params;
}
# Config php-fpm
Vim/etc/php5/fpm/pool. d/www. conf
# Listen =/var/run/php5-fpm.sock
Listen = 127.0.0.1: 9000
# Restart nginx php-fpm
/Etc/init. d/nginx restart
/Etc/init. d/php5-fpm restart
[Email protected]: ~ # Curl-I http: // 192.168.5.44/index. php
HTTP/1.1 200 OK
Server: nginx/1.2.1
Date: Thu, 06 Nov 2014 12:11:44 GMT
Content-Type: text/html
Connection: keep-alive
X-Powered-By: PHP/5.4.34-0 + deb7u1
This article is from the "linux learning history" blog, please be sure to keep this source http://micheng.blog.51cto.com/1463868/1573834
Debian7.7 quickly build lamp and lnmp environments