LAMP编译安装(续)
2016-07-26 22:41
183 查看
搭建环境:Centos 6.8,httpd2.4.18,mysql 5.6.23,php 5.6.17
接上篇:/article/11924001.html ,上篇使用httpd和php模块化安装,php编译安装--with-apxs2,此篇文章作为补充,使用fastcgi,php独立运行。
httpd和mysql安装均前面一样。
LAMP yum安装(一般网站访问量不高,YUM安装是最有效的一种方法)
安装Apache及其扩展
本文出自 “Frank” 博客,请务必保留此出处http://zhoufan.blog.51cto.com/4278592/1830439
接上篇:/article/11924001.html ,上篇使用httpd和php模块化安装,php编译安装--with-apxs2,此篇文章作为补充,使用fastcgi,php独立运行。
httpd和mysql安装均前面一样。
tar -xf php-5.6.17.tar.xz cd php-5.6.17如果没有安装MySQL(基本就是分布式安装的模式)
./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts如果已经安装MySQL(基本就是单机模式)
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-openssl --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts其实php编译模块不同点只是把 --with-apxs2=/usr/local/apache/bin/apxs替换为 --enable-fpm而已。
make ZEND_EXTRA_LIBS='-liconv' make install复制PHP配置及设置开机启动(其实LNMP就是使用的php-fpm,此处就做过多描述)
cp php.ini-production /etc/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm chmod +x /etc/rc.d/init.d/php-fpm chkconfig --add php-fpm chkconfig php-fpm on service php-fpm start在http中增加反向代理模块
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so LoadModule proxy_module modules/mod_proxy.so配置虚拟主机支持使用fcgi,在相应的主机中添加类似如下两行。
ProxyRequests Off ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/PATH/TO/DOCUMENT_ROOT/$1定位DirectoryIndex
DirectoryIndex index.php index.html
LAMP yum安装(一般网站访问量不高,YUM安装是最有效的一种方法)
安装Apache及其扩展
yum -y install httpd yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql安装配置MySQL
yum -y install mysql mysql-server mysql-develmysql secure_installation(编译安装可以使用这个,删除测试库,设置密码均更方便)
service mysqld start /usr/bin/mysql_secure_installation安装php及其扩展
yum -y install php php-mysql yum -y install gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap启动httpd服务
service httpd start设置开启启动项
chkconfig httpd on chkconfig mysqld on
本文出自 “Frank” 博客,请务必保留此出处http://zhoufan.blog.51cto.com/4278592/1830439
相关文章推荐
- android异常——异步任务导致的窗口句柄泄漏问题
- 『.NET Core CLI工具文档』(二).NET Core 工具遥测(应用信息收集)
- 网络端口号
- 【科普·给学弟看的算法】基本的搜索算法和基础运用(2):广(宽)度优先搜索算法(BFS)
- HTML 5 <canvas> 标签 用法
- Java Set集合的详解
- Xcode中创建文件夹
- Linux系统man使用帮助与history命令
- MySQL读书笔记-存储引擎
- [OS复习]操作系统综述2
- php 安装composer
- 深入理解Java反射机制
- Linux学习第二天
- javassit框架的使用---动态改变字节码
- python 学习(十) 之字符串 1
- 重启Ubuntu后Hadoop的namenode起不来的解决办法
- js获取style样式的问题
- java学习之路 之 面向对象编程-类的成员之属性、方法及对象的创建和使用
- 【YMGJ】对时间的编辑—--开始时间、结束时间
- 进阶项目3.1-点结构体