linux lnmp安装

yum -y install pcre*     openssl  openssl-devel


useradd -s /sbin/nologin   -M nginx

wget      http://nginx.org/download/nginx-1.9.15.tar.gz


tar xf nginx-1.9.15.tar.gz

cd nginx-1.9.15

./configure   --user=nginx   --group=nginx  --prefix=/application/nginx1.9.15    --with-http_stub_status_module   --with-http_ssl_module

make  &&  make install

 ln -s /application/nginx1.9.15/  /application/nginx

 /application/nginx/sbin/nginx



mysql-5.5.32-linux2.6-x86_64.tar.gz   二进制方式安装



useradd mysql  -s   /sbin/nologin  -M

tar xf mysql-5.5.32-linux2.6-x86_64.tar.gz

mv mysql-5.5.32-linux2.6-x86_64  /application/mysql

cd /application/mysql/

chown -R mysql.mysql /application/mysql/data/

 ./scripts/mysql_install_db --user=mysql   --basedir=/application/mysql/    --datadir=/application/mysql/data/

cp support-files/mysql.server   /etc/init.d/mysqld

vim /etc/init.d/mysqld

basedir=/application/mysql

datadir=/application/mysql/data

cp  support-files/my-small.cnf   /etc/my.cnf

/etc/init.d/mysqld   start

ln -s /application/mysql/bin/mysql  /usr/local/bin/

mysql

 ./mysqladmin   -u root password "123456"

mysql -uroot -p123456

vim /etc/profile

PATH=/application/mysql/bin:$PATH

.  /etc/profile

data]# cat bogon.err         看报错

 show databases;

drop   database test;

mysql> select  user,host   from   mysql.user;

+------+-----------+

| user | host      |

+------+-----------+

| root | 127.0.0.1 |

| root | ::1       |

|      | bogon     |

| root | bogon     |

|      | localhost |

| root | localhost |

+------+-----------+

6 rows in set (0.00 sec)

delete   from   mysql.user  where  user='hequan'   and  host='123456';

drop  user  'root'@'bogon' ;

+------+-----------+

| user | host      |

+------+-----------+

| root | 127.0.0.1 |

| root | localhost |

+------+-----------+

2 rows in set (0.00 sec)

 netstat -lntup | egrep  "nginx|mysql"

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1681/nginx

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      5236/mysqld





 yum -y install zlib  libxml  libjpeg freetype libpng  gd  curl  libiurl  libiconv  zlib-devel  libxml2-devel  libjpeg-devel  freetype-devel  lilbpng-devel   gd-devel   curl-devel    libxslt*    penldap openldap-devel nss_ldap openldap-clients openldap-servers

tar zxf libiconv-1.14.tar.gz

cd libiconv-1.14

./configure --prefix=/usr/local/libiconv

make

make install

cd ../

/sbin/ldconfig

tar  zxf   libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure

make

make install

/sbin/ldconfig

cd libltdl/

./configure   --enable-ltdl-install

make

make install

cd ../../

tar -zxvf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure

make

make install

安装mcrypt

tar -zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

/sbin/ldconfig

./configure    LD_LIBRARY_PATH=/usr/local/lib

make

make install

tar xf php-5.3.27.tar.gz

cd php-5.3.27

./configure \

--prefix=/application/php5.3.27 \

--with-mysql=/application/mysql \

--with-xmlrpc \

--with-openssl \

--with-zlib \

--with-freetype-dir \

--with-gd \

--with-jpeg-dir \

--with-mhash  \

--enable-pcntl  \

--with-png-dir \

--with-iconv=/usr/local/libiconv \

--enable-xml \

--disable-rpath \

--enable-safe-mode \

--enable-bcmath  \

--enable-shmop \

--enable-inline-optimization \

--enable-fpm \

--with-fpm-user=nginx \

--with-fpm-group=nginx \

--enable-short-tags \

--enable-sockets \

--enable-zend-multibyte \

--enable-soap \

--enable-mbstring \

--enable-static \

--enable-gd-native-ttf \

--with-curl \

--with-curlwrappers  \

--with-xsl \

--enable-ftp \

--enable-zip  \

--with-libxml-dir=/usr


Thank you for using PHP.

/hequan/php-5.3.27/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

make: *** [ext/phar/phar.php] 错误 127


ln  -s  /application/mysql/lib/libmysqlclient.so.18     /usr/lib64/

mkdir  ext/phar/phar.phar   -p


make && make install


 ln -s /application/php5.3.27/  /application/php

 cp php.ini-production   /application/php/lib/php.ini



vim  /application/php/etc/php-fpm.conf.default

pid =  /app/logs/php-fpm.pid

error_log = /app/logs/php-fpm.log

log_level = error

rlimit_files = 32768

listen.owner = nginx

listen.group = nginx

pm.max_children = 1024

pm.start_servers = 16

pm.min_spare_servers = 5

pm.max_spare_servers = 20

pm.process_idle_timeout = 15s;

pm.max_requests = 2048

slowlog = /app/logs/$pool.log.slow

request_slowlog_timeout = 10

 vimdiff  php-fpm.conf php-fpm.conf.default

mkdir /app/logs -p 

/application/php/sbin/php-fpm -t

/application/php/sbin/php-fpm

 netstat  -lntup  | grep php-fpm

tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      53284/php-fpm

 ps -ef | grep php-fpm

vim /etc/rc.local

/etc/init.d/mysqld  start

/application/php/sbin/php-fpm

/application/nginx/sbin/nginx

netstat -lntup | egrep  "nginx|php-fpm|mysql"

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1847/nginx         

tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      1829/php-fpm       

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      1797/mysqld

vim  nginx.conf

        index   index.php  index.html index.htm  ;


location ~ .*\.(php|php5)?$ {

    fastcgi_pass   127.0.0.1:9000;

    fastcgi_index  index.php;

    include        fastcgi.conf;


}

/application/nginx/sbin/nginx -s reload

<?php  

        phpinfo();

?>











本文转自 295631788 51CTO博客,原文链接:http://blog.51cto.com/hequan/1768044,如需转载请自行联系原作者
上一篇:河南省推进国家大数据综合试验区建设实施方案和若干意见


下一篇:HDOJ(HDU) 2504 又见GCD(利用最大公约数反推)