lanmp安装(未结束)

 

 

0,关闭规则

iptables -F 清除防火墙规则,临时关闭

setenforce 0 临时关闭selinux

 

 

1,依赖库安装

Yum  -y  install libxml2

yum  -y  install libxml2-devel

Yum  -y  install openssl

yum  -y  install openssl-devel

yum  -y  install curl

yum  -y  install curl-devel

yum  -y  install libjpeg

yum  -y  install libjpeg-devel

yum  -y  install libpng

yum  -y  install libpng-devel

yum  -y  install freetype

yum  -y  install freetype-devel

yum  -y  install pcre

yum  -y  install pcre-devel

yum  -y  install libxslt

yum  -y  install libxslt-devel

yum install -y libmcrypt

yum install -y libmcrypt-devel

yum install -y zlib

yum install -y zlib-devel    /

 

 

 

2.1apache服务器安装时  开启重写模块

./configure --prefix=/usr/local/httpd --enable-rewrite

 

 

 

2.2 nginx服务器依赖库pcre     对应的php要开启php-fpm

 

nginx重写

  location / {

            root   /usr/local/httpd/htdocs/wordpress/; 

            index  index.php index.html index.htm;

if (-f $request_filename/index.html){

 rewrite (.*) $1/index.html break;

 }

if (-f $request_filename/index.php){

 rewrite (.*) $1/index.php;

 }

if (!-f $request_filename){

 rewrite (.*) /index.php;

 }

 

          }

 

 

3,php安装

./configure --prefix=/usr/local/php -with-apxs2=/usr/local/httpd/bin/apxs -with-mysql=/usr/local/mysql --with-gd --with-mcrypt  --with-pdo-mysql --enable-mbstring  --enable-opcache --with-openssl --enable-fpm --with-jpeg-dir  --with-png-dir  --with-freetype-dir  --with-libxml-dir   --with-zlib-dir  --with-curl  

 

make && make install

 

 

 

 

 cp /usr/local/src/php-5.5.38/php.ini-development /usr/local/php/lib/php.ini

 

 

 

3.1与ngin关联

-------------------------------------

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

---------------------------------

/usr/local/php/sbin/php-fpm

----------------------------------------

cp /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf-2016-7-1.back

修改配置

vim /usr/local/nginx/conf/nginx.conf

 

 

 

 

nginx重写

  location / {

            root   /usr/local/httpd/htdocs/wordpress/;   //一定要存在,正确的

            index  index.php index.html index.htm;

if (-f $request_filename/index.html){

 rewrite (.*) $1/index.html break;

 }

if (-f $request_filename/index.php){

 rewrite (.*) $1/index.php;

 }

if (!-f $request_filename){

 rewrite (.*) /index.php;

 }

 

          }

mkdir /scripts

Vim 1.php

重启nginx

/usr/local/nginx/sbin/nginx -s reload

----------------------------------

 

 

4,mysql安装

 

posted @ 2017-09-22 05:36  wujunbin  阅读(92)  评论(0编辑  收藏  举报