本文共 2491 字,大约阅读时间需要 8 分钟。
- Development tools - Server Platform tools - apr-1.5+ - apr-util-1.5+ - httpd-2.4 - expat-devel - openssl-devel - prec-devel - httpd2.2(需要其httpd2.2的服务配置, 提供httpd2.4服务配置模板)
1. 解压apr之后, .configure --prefix=/usr/local/apr; make && make install 2. 解压apr-util之后, .configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr; make && make install 3. 解压httpd2.4, ./configure --prefix=/usr/local/httpd24 --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre=/usr/local/pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mpms-shared=all --with-mpm=event 4. 复制脚本, cp /etc/rc.d/init.d/httpd /etc/rc.d/init.d/httpd24 **注意**:单纯的复制服务脚本是不行的, 我们还要根据具体的情况进行修改 5. 添加服务脚本, chkconfig --add httpd24 6. 启动httpd, service httpd start 7. 导出man, 库文件(.so), 头文件, 系统的环境变量 8. 查看/var/run/httpd/httpd.pid的内容, 启动httpd服务会以该文件中定义的pid进行运行 9. 加载相应的模块 proxy_module和fcgi有关的 10. 关闭正向代理
1. 解压php包2. 命令参数
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/usr/local/httpd24/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts
3. make && make install 4. 此时会在/etc/httpd24/httpd.conf中多出LoadModule php的信息 5. 为了能让httpd解析php文件, 在配置文件中添加AddType application/x-httpd-php .phpAddType application/x-httpd-ph-source .phpsDirectory Index index.php index.html 6. 我们编译安装的httpd的docroot是在/usr/localhttpd24/htdoc中, 在这里index.php进行测试即可 7. 为了加开运行, 编译安装xcache 解压 进入到解压目录 /usr/local/php/bin/phpize: 用于生成configure文件 ./configure --enable-xcache --enable-xcache-coverager --enable-xcache-optimizer --with-php-config=/usr/local/php/bin/php-config make && make install 创建/etc/php.d文件夹,将xcache.ini配置文件复制到此文件,以便php读取加载。 8. 这里使用的php安装时编译在httpd中(成为httpd的一个模块的, 所以配置时 需要指明httpd的相关位置), 而安装采用fpm则不需要, 但是因为php与mysql有关, 所以还是需要mysql的位置的配置信息转载地址:http://rhmjl.baihongyu.com/