CentOS7编译安装httpd-2.4.41 php7.3

CentOS7编译安装httpd-2.4.41 php7.3

安装参考环境:

  CentOS Linux release 7.5.1804 (Core)

一、安装依赖包

httpd安装的依赖包
# yum -y install pcre-devel
# yum -y install openssl-devel
# yum -y groupinstall "Development Tools"  

arp-util安装的依赖包
# yum install expat-devel     

二、编译安装apr-1.7.0

# wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.g
# tar xf apr-1.7.0.tar.gz
# cd apr-1.7.0
# ./configure -prefix=/usr/local/apr
# make && make install

三、编译安装apr-util-1.6.1

# wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
# tar xf apr-util-1.6.1.tar.gz
# cd apr-util-1.6.1
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
# make && make install

四、编译安装httpd-2.4.41

# wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.41.tar.gz
# tar xf httpd-2.4.41.tar.gz
# cd httpd-2.4.41
# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modeles=most --enable-mpms-shared=all --with-mpm=event
# make && make install

五、添加httpd服务开启启动

1、用chkconfig 方式管理

ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
vi /etc/rc.d/init.d/httpd

#在#/bin/sh 下加上两行
# chkconfig: 2345 95 10
# description: Activates/Deactivates Apache Web Server

#注册服务
chkconfig --add httpd

#开机自启动
systemctl enable httpd | chkconfig httpd on

#管理
service httpd stop|start|restart

六、启动httpd

# /usr/local/apache/bin/httpd

七、创建apache用户组

useradd -U apache

八、修改httpd.conf 配置文件

ps -aux | grep apache //源码编译apache,运行用户为deamon
#修改配置文件改变apache运行身份
[[email protected] conf]# vim httpd.conf
User apache
Group apache

# #添加php支持
[[email protected] conf]# vim httpd.conf
<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
    ##添加解析php类别文件
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
</IfModule>

九、安装PHP所需依赖软件。

yum -y install libxml2-devel openssl curl-devel libjpeg-devel libpng libpng-devel freetype-devel libmcrypt-devel libzip libzip-devel

十、编译和安装。需要注意一下,Apache怎么和PHP互动?

./configure --prefix=/usr/local/php7.3 --with-config-file-path=/usr/local/php7.3/etc --enable-fpm --enable-sysvsem --enable-sockets --enable-pcntl --enable-mbstring --enable-mysqlnd --enable-opcache --enable-shmop --enable-ftp --enable-wddx --enable-soap --with-apxs2=/usr/local/apache/bin/apxs

修改配置文件

cp php.ini-production /usr/local/php7.3/etc/php.ini

ls /usr/local/php7.3/etc/

vi /usr/local/php7.3/etc/php.ini

#禁用函数
disable_functions=

原文地址:https://www.cnblogs.com/h-gallop/p/11646085.html

时间: 2024-10-13 07:03:21

CentOS7编译安装httpd-2.4.41 php7.3的相关文章

Centos7编译安装nginx1.15+MariaDB10.3+php-7.2

环境准备: yum源:wget -c http://mirrors.163.com/.help/CentOS7-Base-163.repo -O /etc/yum.repo.d/CentOS7-Base-163.repo 下载软件包: wget -c https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.3.9/source/mariadb-10.3.9.tar.gz wget -c http://nginx.org/download/

centos7编译安装的php7怎么卸载 解决cenos 编译安装软件后怎么卸载问题

之前有个疑问  编译安装的软件 不是yum 安装 怎么卸载 遇到个问题, centos7编译安装的php7怎么卸载 解决: 关于卸载如果没有配置--prefix选项,源码包也没有提供make uninstall,则可以通过以下方式可以完整卸载: 一个临时目录重新安装一遍,如: ./configure --prefix=/tmp/to_remove && make install1然后遍历/tmp/to_remove的文件,删除对应安装位置的文件即可(因为/tmp/to_remove里的目录

CentOS 6.5下编译安装httpd+mysql+php+phpMyAdmin

CentOS 6.5下编译安装httpd+mysql+php+phpMyAdmin+cacti+nagios 一.安装环境 Linux系统:CentOS 6.5 Apache版本:http-2.4.12 MySQL版本:MySQL 5.6.24 PHP版本:PHP-5.6.8 基本的安装顺序为:先安装httpd,然后安装mysql,最后安装PHP. 软件包: [[email protected] httpdbao]# ll total 334908 -rwxrw-rw-. 1 root root

编译安装httpd 2.4 ---格式待整理

httpd 2.4 版本需要依赖于apr 1.4版本httpd 依赖于 apr,apr-util    其安装又先后顺序之分:        1.apr        2.apr-util        3.httpd [[email protected] httpd]# rpm -q httpdhttpd-2.2.15-39.el6.centos.x86_64[[email protected] httpd]# service httpd stopStopping httpd:        

linux命令:编译安装httpd、mysql、php等LAMP环境

Httpd 2.4新特性: 1.MPM可于运行时装载: --enable-mpms-shared=all --with-mpm=event  编译安装是指定MPM运行模块为event 2.Event MPM 支持event新的多路处理模块 3.异步读写 4.在每模块及每目录上指定日志级别 5.每请求配置: <If>,<ElseIf>,<Else>; 6.增强的表达式分析器: 7.毫秒级的Keepalive Timeout; 8.基于域名的虚拟主机不再需要NameVirt

apache编译安装 httpd 2.2 httpd 2.4

#apache编译安装#httpd 2.2 , httpd 2.4 #!/bin/sh #apache编译安装 #httpd 2.2 , httpd 2.4 #centos #rpm -e httpd* Ve=2.2 [ $1 = 2.4 ] && Ve=2.4 || Ve=2.2 #设置安装版本2.2或2.4 #目录 Ddir=/it/tools #定义下载目录 Sdir=/www/server #定义安装目录 Adir=$Sdir/apache$Ve [ ! -d $Ddir ] &a

centos7编译安装lamp实现wordpress

准备安装包,并解压 mariadb-10.3.13.tar.gz  ,php-7.3.2.tar.bz2  ,httpd-2.4.38.tar.bz2  php-7.3.2 ,  phpMyAdmin-4.8.5-all-languages.tar.gz ,  wordpress-5.0.3-zh_CN.tar.gz   apr-1.6.5.tar.bz2   apr-util-1.6.1.tar.bz2 安装前准备 yum安装编译四个包所必须的工具 "development tools&quo

编译安装httpd 2.4

编译安装LAMP之:编译安装httpd 2.4 环境介绍: 系统环境:CentOS6.5 所需软件包:apr-1.5.2.tar.gz.apr-util-1.5.2.tar.gz.httpd-2.4.6.tar.gz 注意:httpd2.4需要依赖apr和arp-util 1.4以上版本 CentOS编译安装Apache准备:确保开发包组已安装(Development tools.Server Platform Development) yum groupinstall "Development

编译安装httpd

CentOS 6默认提供的是httpd 2.2,现尝试在CentOS 6上编译安装httpd 2.4 1.编译安装apr和apr-util httpd程序依赖于apr和apr-util.apr(Apache portable Run-time libraries,Apache可移植运行库)旨在为上层的httpd应用程序提供一个可以跨越多种操作系统平台使用的底层支持接口库,给httpd程序提供了一个虚拟机环境,由此实现了httpd的跨平台性 httpd 2.4依赖apr 1.4以上的版本,因此若a