跳转到内容

ZczBlog

  • 首页
  • 前端
    • HTML
    • CSS
    • JavaScript
    • jQuery
  • Linux系统
    • Linux
    • Ubuntu/debian
  • 数据库
    • MySQL
    • NoSQL
  • PHP
  • 其他

Debian编译安装Apache

  • 发表于: 2023年8月7日 2024年5月7日
  • 分类: Apache, Linux系统, Ubuntu/debian, 中间件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
apt install sudo ssh vim mc ncdu tree git curl nmap net-tools zip gcc automake autoconf libtool make rpm wget ntpdate psmisc telnet build-essential zlib1g-dev libpcre3-dev libssl-dev libexpat1-dev g++
 
wget http://archive.apache.org/dist/apr/apr-1.7.4.tar.gz
tar -zxf apr-1.7.4.tar.gz
cd apr-1.7.4
./configure --prefix=/usr/local/lib/apr
make
make install
 
wget http://archive.apache.org/dist/apr/apr-util-1.6.3.tar.gz
tar -zxf apr-util-1.6.3.tar.gz
cd apr-util-1.6.3
./configure --prefix=/usr/local/lib/apr-util -with-apr=/usr/local/lib/apr/bin/apr-1-config
make
make install
 
wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
tar -zxf pcre-8.45.tar.gz
cd pcre-8.45
./configure --prefix=/usr/local/lib/pcre
make
make install
 
wget https://downloads.apache.org/httpd/httpd-2.4.57.tar.gz
tar -zxvf httpd-2.4.57.tar.gz
cd httpd-2.4.57
cd srclib/
cp -r ../../apr-1.7.4/ apr/
cp -r ../../apr-util-1.6.3/ apr-util/
./configure --prefix=/usr/local/lib/apache2 --with-apr=/usr/local/lib/apr --with-apr-util=/usr/local/lib/apr-util --enable-dav --enable-proxy --enable-maintainer-mode --enable-rewrite --enable-access_compat --enable-alias --enable-auth_basic --enable-auth_digest --enable-authn_core --enable-authn_file --enable-authz_core --enable-authz_host --enable-authz_user --enable-autoindex --enable-dav_fs --enable-deflate --enable-dir --enable-env --enable-filter --enable-headers --enable-mime --enable-negotiation --enable-reqtimeout --enable-setenvif --enable-status --enable-ssl=shared --enable-expires=shared --enable-static-support --with-included-apr --with-mpm=prefork --enable-cache --enable-file-cache
make
make install
 
#安装完成之后查看libphp*.so 的位置 然后复制到/usr/local/lib/apache2/modules
find / -name "libphp*"
cp /usr/lib/apache2/modules/libphp7.1.so modules/libphp7.so
 
#修改Apache的配置文件
#关闭Apache的服务
systemctl disable apache2
#将安装的Apache设置开机启动, 在/etc/rc.local 文件中添加一行, 一定要给rc.local文件可执行权限, 否则文件不生效
/usr/local/lib/apache2/bin/apachectl start
 
 

 

文章导航

前一页 上一篇: Linux查看CPU的核数
后一页 下一篇: Debian禁用和启用服务,disable、enable、mask

张 存志

159RSS订阅

© 2025  ZczBlog.                        豫ICP备18029062号