网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 服务器与数据库 > 服务器环境搭建
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

服务器环境搭建 Windows,Linux,IIS,Apache等服务器配置、安全维护以及PHP和MYSQL运行环境讨论。

Reply
 
Thread Tools Display Modes
  #1   IP: 153.99.80.237
Old 2016-05-22, 08:53 AM
Kearney Kearney is offline
初级会员
 
Join Date: 2012-07-04
Posts: 1
Kearney 现在声名狼藉
Default CentOS6.4下编译安装Apache2.4+PHP5.6

首先从 http://httpd.apache.org/download.cgi#apache24
下载apache源码包httpd-2.4.4.tar.gz
从 http://apr.apache.org/download.cgi 下载
apr-1.4.6.tar.gz和apr-util-1.5.1.tar.gz
从 http://sourceforge.net/projects/pcre/files/pcre/8.32/ 下载
pcre-8.32.tar.gz

打开终端切到root
su
输入密码

先装gcc和make
yum -y install gcc
yum -y install make
yum -y install gcc-c++ 没有这个gcc-c++一会编译不prce
切到下载好的源码包目录,本人是~/Download


安装apr:
tar -zvxf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure --prefix=/usr/local/apr
make && make install


安装apr-util
tar -zvxf apr-util-1.5.1.tar.gz
cd apr-util-1.5.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install


安装pcre
tar -zvxf pcre-8.32.tar.gz
cd pcre-8.32
./configure
make && make install


安装apache 一定要先装上面那三个不然编译不了
tar -zvxf httpd-2.4.4.tar.gz
cd httpd-2.4.4
./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util
make && make install


启动apache
/usr/local/apache/bin/httpd



安装PHP5.5
yum -y install libxml2-devel 不装这个编译不了PHP5.5

从www.php.net下载PHP5.5
本人下载的是php-5.5.0.tar.gz
切到下载目录
tar -zvxf php-5.5.0.tar.gz
cd php-5.5.0
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --enable-sysvsem --enable-sockets --enable-pcntl --enable-mbstring --enable-mysqlnd --enable-opcache --enable-shmop --enable-zip --enable-ftp --enable-gd-native-ttf --enable-wddx --enable-soap

make && make install
拷贝一份正式的php-fpm.conf

更多选项... ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --enable-sysvsem --enable-sockets --enable-pcntl --enable-mbstring --enable-mysqlnd --enable-opcache --enable-shmop --enable-zip --with-mcrypt=/usr/local/libmcrypt/ --with-zlib=/usr/local/zlib/ --with-curl=/usr/local/curl/ --with-pcre-dir=/usr/local/pcre/ --with-t1lib=/usr/local/tlib/ --with-pdo-mysql=/usr/ --with-fpm-user=www --with-fpm-group=www

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


启动PHP:
/usr/local/php/sbin/php-fpm



编辑apache配置文件:
vim /usr/local/apache/conf/http.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
把这两行前面的#号去掉

在最下面加两行:
ServerName 127.0.0.1
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/$1
保存退出:wq
重启Apache
/usr/local/apache/bin/apachectl restart
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 01:19 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.