LNMP架构介绍、MySQL安装、PHP安装、Nginx介绍
2018-06-07 22:49
836 查看
12.1 LNMP架构介绍
和LAMP不同的是,提供web服务的是Nginx并且php是作为一个独立服务存在的,这个服务叫做php-fpm
Nginx直接处理静态请求,动态请求会转发给php-fpm
12.2 MySQL安装
rm -f /usr/local/mysql 删除这个目录rm -rf /etc/init.d/mysqld 删除启动脚本
其他同LNMP
12.3/12.4 PHP安装
和LAMP安装PHP方法有差别,需要开启php-fpm服务make clean 将之前编译过的文件删除
cd /usr/local/src/
wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
tar zxf php-5.6.30.tar.gz
useradd -s /sbin/nologin php-fpm
cd php-5.6.30
./configure区别--enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock
./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
make && make install
. 安装目录多了sbin和var两个目录
sbin 下有php-fpm 启动php服务的
var下有log和run log存放日志,run存放pid
/usr/local/php-fpm/sbi/php-fpm -t 用来测试配置文件语法的
cp php.ini-production /usr/local/php-fpm/etc/php.ini
vi /usr/local/php/etc/php-fpm.conf //写入如下内容(参考https://coding.net/u/aminglinux/p/aminglinux-book/git/blob/master/D15Z/php-fpm.conf)book.aminglinux.com
. cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 启动脚本
chmod 755 /etc/init.d/php-fpm 修改权限
chkconfig --add php-fpm
chkconfig php-fpm on
service php-fpm start
ps aux |grep php-fpm
12.5 Nginx介绍
Nginx官网 nginx.org,最新版1.13,最新稳定版1.12Nginx应用场景:web服务、反向代理、负载均衡
Nginx著名分支,淘宝基于Nginx开发的Tengine,使用上和Nginx一致,服务名,配置文件名都一样,和Nginx的最大区别在于Tenging增加了一些定制化模块,在安全限速方面表现突出,另外它支持对js,css合并
Nginx核心+lua相关的组件和模块组成了一个支持lua的高性能web容器openresty,参考http://jinnianshilongnian.iteye.com/blog/2280928
重点处理静态文件
可以扩展第三方模块功能
反向代理:代理一台叫反向代理,代理两台叫负载均衡
扩展
Nginx为什么比Apache Httpd高效:原理篇 http://www.toxingwang.com/linux-unix/linux-basic/1712.htmlapache和nginx工作原理比较 http://www.server110.com/nginx/201402/6543.html
mod_php 和 mod_fastcgi以及php-fpm的比较 http://dwz.cn/1lwMSd
概念了解:CGI,FastCGI,PHP-CGI与PHP-FPM http://www.nowamagic.net/librarys/veda/detail/1319/
相关文章推荐
- LNMP架构(架构介绍,mysql安装,php安装,nginx介绍)
- LNMP架构介绍,MySQL、PHP安装,Nginx介绍
- 12.1 LNMP架构介绍 12.2 MySQL安装 12.3/12.4 PHP安装 12.5 Nginx介绍
- LNMP架构介绍、MySQL安装、PHP安装、Nginx介绍
- LNMP架构介绍、MySQL安装、PHP安装、Nginx介绍
- LNMP架构介绍、mysql安装、PHP安装、nginx介绍
- LNMP架构 (1) 之 架构介绍、MySQL安装、PHP安装、Nginx介绍
- 12.1 LNMP架构介绍 12.2 MySQL安装 12.3/12.4 PHP安装 12.5 Nginx介绍
- LNMP架构介绍、MySQL安装、PHP安装与Nginx介绍
- LNMP架构介绍,MySQL安装,PHP安装,Nginx介绍
- 12.1-12.5 LNMP架构介绍 , MySQL安装 , PHP安装, Nginx介绍
- LNMP架构介绍,MySQL安装,PHP安装,Nginx介绍
- LNMP架构介绍、MySQL安装、PHP安装 、Nginx源码安装
- LNMP架构介绍、Mysql安装、php安装、Nginx介绍
- 12.1 LNMP架构介绍;12.2 MySQL安装;12.3 PHP安装(上);12.4 PHP安装(下);12.5 Nginx介绍
- LNMP架构的搭建(linux+nginx+mysql+php源码安装 )+Discuz论坛的搭建
- 12.1LNMP架构介绍12.2 MySQL安装12.3/12.4 PHP安装12.5 Nginx介绍
- LNMP(nginx+mysql+php)环境/架构 一键安装脚本
- LNMP一键安装Linux系统下Nginx+MySQL+PHP这种网站服务器架构
- linux的LNMP架构介绍、MySQL安装、PHP安装