apache 部署多 PHP 版本、多项目以及二级域名

本地开发环境已经用 homestead 了,但是还是记录一下,也许有朋友会需要。主要是安装 mod_fcgid 模块 (linux),(windows 版模块下载地址) 以及配置文件的变动。
这里就不记录安装过程了,简单记录一下配置文件,方便日后复制粘贴。windows 和 linux 略有不同,不过 appserv 比较贴近原生,感觉差别不大。
一.httpd.conf

    AddHandler fcgid-script .php
    FcgidInitialEnv PHP_FCGI_MAX_REQUESTS      1000
    FcgidMaxRequestsPerProcess       1000
    FcgidMaxProcesses             15
    FcgidIOTimeout             300
    FcgidIdleTimeout                300
    AddType application/x-httpd-php .php
    #默认虚拟主机,其中FcgidInitialEnv是php.ini的存放目录,Linux下通常不需要
    FcgidInitialEnv PHPRC "D:/AppServ/php5/"
    FcgidWrapper "D:/AppServ/php5/php-cgi.exe" .php

二.httpd-vhosts.conf

<VirtualHost ip:80>
    ServerName www.abc.com
    DocumentRoot "/data/www/www.abc.com"
    <Directory "/data/www/www.abc.com">
        Options -Indexes +FollowSymLinks +ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
    FcgidInitialEnv PHPRC "D:/AppServ/php7"
    FcgidWrapper "D:/AppServ/php7/php-cgi.exe" .php
</VirtualHost>
本作品采用《CC 协议》,转载必须注明作者和本文链接
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。