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

相关内容

热门资讯

我国科学家为细胞信号“导航”开... 新华社济南5月31日电(记者张力元)人体细胞犹如一座精密的通信城市,每天都有大量“指令”穿梭传递,调...
极端大风突袭哈尔滨!过山车停摆... 极目新闻记者 詹钘5月31日,受强对流天气影响,哈尔滨国际会展中心体育场相关设施受到损坏,原计划当晚...
三原电缆取得电缆接头连接用防护... 国家知识产权局信息显示,上海三原电缆附件有限公司取得一项名为“一种电缆接头连接用防护结构”的专利,授...
原创 识... 还是那句话,机圈苦大屏久已…… 虽然大屏有大屏的美,但是小屏也有小屏的俏。在大屏旗舰占据主流的手机市...
玄戒技术取得分频电路专利,实现... 国家知识产权局信息显示,北京玄戒技术有限公司取得一项名为“分频电路、分频器、射频芯片和电子设备”的专...
为什么今年香会基调明显变了 5月29日—31日在新加坡举行的第23届香格里拉对话会(简称“香会”),见证着元首引领下大国关系继续...
成本几毛钱、假驱蚊液香精兑水,... 入夏升温,蚊虫进入活跃期,驱蚊防护成为民生刚需,《财经调查》持续接到消费者投诉,他们买到的多款网红驱...
越来越多80后90后,正在丧失... 六一儿童节到来之际,朋友圈里开始出现一种熟悉的热闹。有人晒出零食礼包,有人半开玩笑地向伴侣讨礼物,还...
洋保电子取得用于低温环境的电气... 国家知识产权局信息显示,洋保电子(太仓)有限公司取得一项名为“一种用于低温环境的电气柜”的专利,授权...
中日韩飞手争霸宁波!2026无... 潮新闻客户端 记者 陈冲 通讯员 朱凝 5月31日,2026小遛·无人机竞速世界杯(中国·宁波鄞州站...