前言

最近没更新新篇幅了,今天就来点干活,过多的也不说了下面着手干!干!干!

准备环境

centos7.5
apr-1.6.3.tar.gz 
apr-util-1.6.1.tar.gz     
httpd-2.4.34.tar.bz2                
php-7.1.18.tar.bz2
mariadb-10.2.16-linux-x86_64.tar.gz 
wordpress-4.9.4-zh_CN.tar.gz

编译HTTP

1、安装包组以及相关包

yum groupinstall "development tools"
yum install pcre-devel openssl-devel expat-devel

2、创建用户与解压

useradd  -r -s /sbin/nologin apache
tar xf httpd-2.4.34.tar.bz2
tar xf apr-1.6.3.tar.gz
tar xf apr-util-1.6.1.tar.gz

3、移动apr目录

mv apr-1.6.3 httpd-2.4.34/srclib/apr
mv apr-util-1.6.1 httpd-2.4.34/srclib/apr-util

4、源码编译

cd httpd-2.4.34/

./configure --prefix=/app/httpd24 \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre \
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork \
--with-included-apr make && make install

5、设置环境变量

echo 'PATH=/app/httpd24/bin:$PATH' > /etc/profile.d/lamp.sh

6、编辑配置文件

vim /app/httpd24/conf/httpd.conf

user apache
group apache 取消下面注释
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so 在下面行添加index.php
IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule> 添加子配置文件
Include conf/extra/php.conf

7、编辑子配置文件

vim  /app/httpd24/conf/extra/php.conf

添加以下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/app/httpd24/htdocs/$1

8、启动服务

apachectl

二进制安装MYSQL

1、在前几篇里有提到详细的安装过程,这里就直接干活代码

useradd -r -s /sbin/nologin mysql

tar xvf mariadb-10.2.16-linux-x86_64.tar.gz  -C /usr/local/

cd /usr/local/

ln -s mariadb-10.2.16-linux-x86_64/ mysql

chown -R mysql.mysql mysql/

mkdir /app/mysql

chown mysql.mysql /app/mysql

cd /usr/local/mysql/

scripts/mysql_install_db  --datadir=/app/mysql --user=mysql

mkdir /etc/mysql/  

cp support-files/my-huge.cnf  /etc/mysql/my.cnf

vim /etc/mysql/my.cnf

datadir=/app/mysql 

cp support-files/mysql.server  /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig --list

service mysqld start

vim /etc/profile.d/lamp.sh 

PATH=/app/httpd24/bin:/usr/local/mysql/bin:$PATH

mysql -e "create database wpdb;grant all on wpdb.* to wpuser@'localhost' identified by 'centos'"

备注:这里可以跑下mysql安全脚本,做下安全巩固--请看https://www.cnblogs.com/xsuid/p/9368389.html

PHP编译安装

1、安装包与解压

yum install libxml2-devel bzip2-devel libmcrypt-devel

tar xvf php-7.1.18.tar.bz2 

2、源码编译

cd php-7.1.18/
./configure --prefix=/app/php \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-openssl \
--with-pdo-mysql=mysqlnd \
--enable-mbstring \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--enable-sockets \
--enable-fpm \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--enable-maintainer-zts \
--disable-fileinfo make -j 4 && make install

3、环境变量

vim  /etc/profile.d/lamp.sh
PATH=/app/php/bin:/app/httpd24/bin:/usr/local/mysql/bin:$PATH

4、php设置

cp php.ini-production /etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
PHP配置文件 chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
启动程序 cd /app/php/etc
cp php-fpm.conf.default php-fpm.conf
cp php-fpm.d/www.conf.default php-fpm.d/www.conf
php fastcgi配置文件,根据情况来更改

5、启动服务

service php-fpm start

安装wordpress

tar xvf wordpress-4.9.4-zh_CN.tar.gz

cp -a wordpress/* /app/httpd24/htdocs/

cd /app/httpd24/htdocs/

mv wp-config-sample.php wp-config.php 

vim wp-config.php

根据上面mysql创建信息更改

附加虚拟主机的实现

编辑文件
vim /etc/httpd/conf.d/vhosts.conf
DirectoryIndex index.php
<VirtualHost *:80>
ServerName www.pma.com
DocumentRoot /var/www/html/
ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/html/pma/$1
<Directory "/var/www/html">
Require all granted
</Directory>
</VirtualHost> <VirtualHost *:80>
ServerName www.wordpress.com
DocumentRoot /var/www/html/
ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/html/wordpress/$1
<Directory "/var/www/html">
Require all granted
</Directory>
</VirtualHost> <VirtualHost *:80>
ServerName www.forum.com
DocumentRoot /var/www/html/
ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/html/forum/$1
<Directory "/var/www/html">
Require all granted
</Directory>
</VirtualHost>

结语:后续更精彩

编译-LAMP基于fastcgi的更多相关文章

  1. 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构

    目录 实现CentOS 7 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构 准备环境: 准备软件版本: 主机名修改用以区分 数据库服务器 实现数据库二进 ...

  2. CentOS6编译LAMP基于FPM模式的应用wordpress

    CentOS6编译LAMP基于FPM模式的应用wordpress 引言:其实我们可以直接使用yum安装LAMP(Linux+Apache[httpd]+Mysql+PHP),比手动编译安装LAMP要简 ...

  3. 编译安装基于fastcgi模式的多虚拟主机的wordpress和discuz的LAMP架构

    一.环境准备 两台主机: httpd+php(fastcgi模式) mariadb 服务器 软件版本: mariadb-10.2.40-linux-x86_64.tar.gz apr-1.7.0.ta ...

  4. 生产环境LAMP搭建 - 基于 fastcgi

    生产环境LAMP搭建 - 基于 fastcgi 由于在module模式,php只是已http的模块形式存在,无形中加重了http的服务负载,通常在企业架构中,使用fastcgi的模式,将所有的服务都设 ...

  5. Httpd服务进阶知识-基于FASTCGI实现的LAMP架构

    Httpd服务进阶知识-基于FASTCGI实现的LAMP架构 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.httpd+php结合的方式 module: php fastcgi ...

  6. 编译LAMP部署动态网站环境

    LAMP动态网站部署架构是由一套 Linux+Apache+MySQL+PHP 组成的动态网站系统解决方案. 以下配置环境为:Linux=RHEL7 --> Apache=2.4.33 --&g ...

  7. 源代码编译lamp环境

    没有办法用 rpm查询一个源代码包是否安装 因为 并不是用rpm安装的 可以先吧 selinux 给禁用掉  iptables -F 把防火墙规则全部删除 首先确保 gcc  gcc-c++   ma ...

  8. 编译安装基于nginx与lua的高性能web平台-openresty

    1.首先编译安装nginx(不多说) 2.开始安装openresty cd /usr/local/src wget https://openresty.org/download/openresty-1 ...

  9. qemu模拟器下编译运行基于riscv指令集的Linux操作系统

      基本原理: 在物理服务器Ubuntu14.04上安装qemu模拟器,模拟器中运行基于riscv指令集编译的linux镜像文件. 用到的工具包括: riscv-qemu(模拟器,可以模拟运行risc ...

随机推荐

  1. fatal pylint error : ......can't find '__main__'module in

    fatal pylint error : ......can't find '__main__'module in原因是没有安装pylint,所以提示没有找到__main__模块 解决方案:1.到官网 ...

  2. PostgreSQL - raise函数打印字符串

    raise函数 在PostgreSQL中,该函数用于打印字符串,类似于Java中的System.out.println(),Oracle中的dbms_output.put_line(). 用法如下: ...

  3. Linux基本系统优化

    Linux基本系统优化  Linux Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令, 在配置服务器基础环境时,先了解下网络参数设定命令. ifconfig 查询.设置网卡和ip等参 ...

  4. 2017swpu-ctf总结

    2017swpu-ctf总结 今年是我第一次出题感受很多,就分析几道我印象最深刻的题吧 你能进入后台吗? 这道题主要是考察php_screw还有md5加密开启true过后的注入 phpscrew加密在 ...

  5. Hive进阶_内置函数

    Hive数学函数 round : 四舍五入 ceil : 向下取整 floor : 向上取整 ),),),),); Hive字符函数 select lower('Hello World'), uppe ...

  6. C. Epidemic in Monstropolis

    http://codeforces.com/contest/733/problem/C 一道很恶心的模拟题. 注意到如果能凑成b[1],那么a的前缀和一定是有一个满足是b[1]的,因为,如果跳过了一些 ...

  7. 洛谷P1781 宇宙总统

    https://www.luogu.org/problem/show?pid=1781 高精比较大小: #include<iostream> #include<cstdio> ...

  8. 数据库(数据库、表及表数据、SQL语句)

    数据库MYSQL 今日内容介绍 u MySQL数据库 u SQL语句 第1章 数据库 1.1 数据库概述 l 什么是数据库 数据库就是存储数据的仓库,其本质是一个文件系统,数据按照特定的格式将数据存储 ...

  9. 3285 转圈游戏 2013年NOIP全国联赛提高组

    3285 转圈游戏 2013年NOIP全国联赛提高组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond       题目描述 Description n 个小伙伴 ...

  10. tomcat服务器,从前端到后台到跳转

    前端页面: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <tit ...