Apache+PHP源码编译

2024-01-31 15:11:21 浏览数 (1)

安装apr

  • 上传apr的软件包到/home目录下,解压文件

安装依赖

cd /home

tar -zxvf apr-1.7.4.tar.gz

  • 替换config.sub和congfig.guess

cd apr-1.7.4

cp /usr/lib/rpm/openEuler/config.sub build

cp /usr/lib/rpm/openEuler/config.guess build

  • 执行

./configure --prefix=/usr/local/apr

make && make install

安装apr-util

  • 上传apr-util的软件包到/home目录下,解压文件

安装依赖

cd /home

tar -zxvf apr-util-1.6.3.tar.gz

  • 替换config.sub和congfig.guess

cd apr-util-1.6.3/

cp /usr/lib/rpm/openEuler/config.sub build

cp /usr/lib/rpm/openEuler/config.guess build

  • 执行

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

make && make install

安装httpd

  • 上传httpd的软件包到/home目录下,解压文件

安装依赖

cd /home

tar -zxvf httpd-2.2.29.tar.gz

  • 执行

cd httpd-2.2.29/

执行configure:

cp /usr/lib/rpm/openEuler/config.sub build

cp /usr/lib/rpm/openEuler/config.guess build

./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

make -j8

make install

安装PHP

  • 上传该文件到/home目录下

解压该文件:tar -xvf php-5.6.6.tar.bz2

  • 编译

cd php-5.6.6/

cp /usr/lib/rpm/openEuler/config.sub ./

cp /usr/lib/rpm/openEuler/config.guess ./

./configure --with-apxs2=/usr/local/apache2/bin/apxs --prefix=/usr/local/php --with-config-file-path=/etc --enable-inline-optimization

  • 编译:

make -j8

  • 安装:

make install

  • 启动apache:

启动:

/usr/local/apache2/bin/apachectl -k start

netstat -nlp

关闭防火墙

systemctl stop firewalld

systemctl disable firewalld

查看apache是否启动

0 人点赞