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,如需转载请自行联系原作者








相关文章
|
1天前
|
Linux Docker 容器
Centos安装docker(linux安装docker)——超详细小白可操作手把手教程,包好用!!!
本篇博客重在讲解Centos安装docker,经博主多次在不同服务器上测试,极其的稳定,尤其是阿里的服务器,一路复制命令畅通无阻。
25 4
Centos安装docker(linux安装docker)——超详细小白可操作手把手教程,包好用!!!
|
14天前
|
Unix Linux 开发工具
centos的官网下载和vm16虚拟机安装centos8【保姆级教程图解】
本文详细介绍了如何在官网下载CentOS 8以及在VMware Workstation Pro 16虚拟机上安装CentOS 8的步骤,包括可能出现的问题和解决方案,如vcpu-0错误的处理方法。
centos的官网下载和vm16虚拟机安装centos8【保姆级教程图解】
|
3天前
|
Linux 虚拟化 开发者
一键将CentOs的yum源更换为国内阿里yum源
一键将CentOs的yum源更换为国内阿里yum源
204 2
|
13天前
|
关系型数据库 MySQL Linux
Linux 安装 mysql【使用yum源进行安装】
这篇文章介绍了在Linux系统中使用yum源安装MySQL数据库的步骤,包括配置yum源、安装MySQL服务、启动服务以及修改root用户的默认密码。
Linux 安装 mysql【使用yum源进行安装】
|
14天前
|
Linux 虚拟化 Windows
完美解决:重新安装VMware Tools灰色。以及共享文件夹的创建(centos8)
这篇文章提供了解决VMware Tools无法重新安装(显示为灰色)问题的步骤,并介绍了如何在CentOS 8上创建和配置VMware共享文件夹。
完美解决:重新安装VMware Tools灰色。以及共享文件夹的创建(centos8)
|
10天前
|
缓存 Linux 开发工具
CentOS7 安装KDE报错的解决方法:Loaded plugins:fastestmirror,langpacks There is no installed group.
CentOS7 安装KDE报错的解决方法:Loaded plugins:fastestmirror,langpacks There is no installed group.
33 0
|
10天前
|
安全 测试技术 Linux
CentOS7 安装vulhub漏洞测试环境
CentOS7 安装vulhub漏洞测试环境
22 0
|
13天前
|
Linux
centos 安装etcd|待优化
centos 安装etcd|待优化
|
5月前
|
缓存 关系型数据库 MySQL
百度搜索:蓝易云【CentOS8服务器安装MySQL报错:no match mysql-community-server】
现在,你已经成功安装了MySQL服务器并解决了"no match mysql-community-server"的报错问题。祝你使用愉快!
92 1
|
4月前
|
Linux 数据库管理 Python
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
586 4