CentOS YUM安装Apache2后怎么安装配置mod_fastcgi
admin
2023-07-05 10:04:43
0次

由于php php-fpm是编译安装的,httpd是yum安装的

安装fastcgi时发现 yum search mod_fastcgi 没有。那么只有编译安装mod_fastcgi了

逐

cd /usr/local/vipcloud/src/
wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz
tar -zxvf mod_fastcgi-current.tar.gz
cd mod_fastcgi-2.4.6
more README

然后发现需要看INSTALL.AP2

继续

more INSTALL.AP2

看到

*NIX
  ====
    $ cd 
    $ cp Makefile.AP2 Makefile
    $ make
    $ make install
    If your Apache2 installation isn't in /usr/local/apache2, then
    set the top_dir variable when running make (or edit the
    Makefile), e.g.
      $ make top_dir=/opt/httpd/2.0.40
    Add an entry to httpd.conf like this:
      LoadModule fastcgi_module modules/mod_fastcgi.so

看第7行,需要指定apache2的安装目录

由于apache是yum安装的 没有特定的安装目录,浪个办?想到反正这里是需要module的目录吧,于是将

cp Makefile.AP2  Makefile
vim Makfiel
把top_dir=替换为
top_dir = /usr/lib64/httpd

然后 make && make install

报错。

看来不能直接这样。

度娘之。

度娘出来的都是编译安装apache的fastcgi安装

google之

http://www.cyberciti.biz/tips/rhel-centos-fedora-apache2-fastcgi-php-configuration.html

yum install libtool httpd-devel apr-devel apr

然后在make make install安装 搞定。

touch /var/www/cgi-bin/php.fcgi
vim /var/www/cgi-bin/php.fcgi
#!/bin/bash
# Shell Script To Run PHP5 using mod_fastcgi under Apache 2.x
# Tested under Red Hat Enterprise Linux / CentOS 5.x
### Set PATH ###
PHP_CGI=/usr/local/vipcloud/php/bin/php-cgi # php 安装的路径
PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000
### no editing below ###
export PHP_FCGI_CHILDREN
export PHP_FCGI_MAX_REQUESTS
exec $PHP_CGI
cd /etc/httpd/conf.d
vim fsatcgi.php.conf
DirectoryIndex index.html index.shtml index.cgi index.php
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /var/www/cgi-bin/php.fcgi
FastCgiExternalServer /var/www/cgi-bin/php.fcgi -idle-timeout 60 -host 127.0.0.1:9000 -pass-header Authorization

touch /var/www/html/test.php

echo "" >test.php

相关内容

热门资讯

空调连续工作多久需要停机休息 空调连续工作的时间取决于多个因素,包括空调的型号、功率、使用环境和维护情况等。一般来说,空调可以连续...
空调哪个符号是除湿的 空调除湿功能通常用一个水滴形状的符号表示。不同品牌和型号的空调遥控器可能会有所差异,但一般来说,除湿...
格力空调多长时间加一次氟利昂 1、一般情况下,空调对氟利昂的使用量是非常小的,所以在空调使用了四年左右的时候再考虑加也没问题。2、...
空调用多长时间需要加氟一次 一般情况下是五年。当出现以下这几种情况时,空调才需要加氟。1、空调的室内机和室外机各有两个接口,当接...
格调生活·C标思享荟:卡萨帝在... 9月12日的郑州龙湖金融岛,夜风轻拂,灯光璀璨。“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑...
品牌价值破千亿、高端份额持续领... 9月12日,“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑州站”在郑州龙湖金融岛举办。2026...
空调主板坏了修800还是换新的 空调主板坏了是修还是换新,需要考虑多个因素,以下是一些建议:1. 维修成本:如果维修费用较低,比如 ...
空调开多久需要休息多长时间 问题:空调开多久需要休息多长时间回答:1、在使用空调的过程中,一般空调开7~8个小时左右需要休息2~...
中央空调多长时间清洗一次 1、一般空调开机前清洗一次即可,空调开机中间时段再清洗一次,空调关机时清洗一次,这样比较合理。2、空...
中央空调氟利昂多久加一次 看空调制热和制冷程度,很多人的观点认为氟利昂必须一年放一次,其实这个观点是错误的,理解上面有点偏差,...