CentOS YUM安装Apache2后如何安装配置mod_fastcgi

简介:

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

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

1
2
3
4
5
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

继续


1
more  INSTALL.AP2

看到

1
2
3
4
5
6
7
8
9
10
11
12
*NIX
   ====
     cd  <mod_fastcgi_dir>
     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的目录吧,于是将

1
2
3
4
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


1
yum  install  libtool httpd-devel apr-devel apr

然后在make make install安装 搞定。

 

1
touch / var /www/cgi-bin/php.fcgi


1
vim / var /www/cgi-bin/php.fcgi


1
2
3
4
5
6
7
8
9
10
11
#!/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
1
2
3
4
5
6
7
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 "<?phpinfo()?>" >test.php


      本文转自天山三害 51CTO博客,原文链接:http://blog.51cto.com/skybug/1340696,如需转载请自行联系原作者








相关文章
|
21天前
|
Linux 网络安全 开发工具
Centos6.5安装并配置Telnet服务
该内容是一个关于如何安装配置Telnet服务的教程。首先,通过yum安装vim、xinetd、telnet和telnet-server。接着,修改/etc/xinetd.d/telnet配置文件,将disable改为no,并设置访问限制(如限定特定网段和时间)。关闭防火墙,重启服务。创建测试用户后,分别使用CentOS和Windows的Telnet客户端进行连接测试,显示成功,实验完成。
26 1
|
4天前
|
Linux Apache
Centos7 安装Apache
安装Apache的步骤
24 6
|
8天前
|
Linux
CentOS 7 配置yum阿里源 (三步即可)
CentOS 7 配置yum阿里源 (三步即可)
114 1
|
14天前
|
弹性计算 Shell Apache
一键安装apache脚本
【4月更文挑战第30天】
18 1
|
19天前
|
网络协议 Java 应用服务中间件
记录_centos7离线环境和虚拟机共享文件安装jdk和tomcat(配置环境变量)
记录_centos7离线环境和虚拟机共享文件安装jdk和tomcat(配置环境变量)
11 0
|
21天前
|
Linux
centos 6.5安装yum
centos 6.5安装yum
52 0
|
21天前
|
运维 Apache 数据安全/隐私保护
CentOS6.5搭建SVN服务器(Apache+SVN)
CentOS6.5搭建SVN服务器(Apache+SVN)
|
21天前
|
Linux 网络安全 开发工具
Centos7 sendmail服务安装与配置
该文本描述了在Linux系统中设置邮件服务的步骤。首先,启用httpd的邮件发送功能,然后安装sendmail、sendmail-cf和dovecot。接着配置/sendmail.mc,设定IP和邮件域名。在dovecot配置文件中启用imap、pop3和lmtp协议,取消明文认证限制,设定mail_location,并开启SSL。创建用户mail3和mail4,给予相应权限。停止postfix服务,编辑访问控制、提交配置、本地主机名等文件。最后,重置sendmail、dovecot和saslauthd服务。
47 0
|
21天前
|
运维 网络协议 Linux
【运维系列】Centos7安装并配置PXE服务
PXE是Intel开发的预启动执行环境,允许工作站通过网络从远程服务器启动操作系统。它依赖DHCP分配IP,DNS服务分配主机名,TFTP提供引导程序,HTTP/FTP/NFS提供安装源。要部署PXE服务器,需关闭selinux和防火墙,安装dhcpd、httpd、tftp、xinetd及相关服务,配置引导文件和Centos7安装源。最后,通过syslinux安装引导文件,并创建pxelinux.cfg/default配置文件来定义启动参数。
57 0
|
21天前
|
运维 网络协议 Linux
【运维系列】Centos7安装并配置postfix服务
安装CentOS7的Postfix和Dovecot,配置Postfix的`main.cf`文件,包括修改完全域名、允许所有IP、启用邮箱等。然后,配置Dovecot的多个配置文件以启用auth服务和调整相关设置。重启Postfix和Dovecot,设置开机自启,并关闭防火墙进行测试。最后,创建邮箱账户并在Windows邮箱客户端中添加账户设置。
19 0

热门文章

最新文章