PHP
下载安装包
wget https://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz1
然后使用configure工具生成Makefile
./configure --prefix="安装文件路径" --enable-modules=most1
此时,可能会报错:configure:error:APR not found 等。。。
因此我们需要把相关的关联包安装一下,apr、apr-util、pcre等
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip123
解决 apr not found 问题
tar -zxvf apr-1.4.5.tar.gz cd cd apr-1.4.5 ./configure --prefix="apr安装路径" make && make install 1234
解决 apr-util not found问题
tar -zxf apr-util-1.3.12.tar.gz cd apr-util-1.3.12 ./configure --prefix="apr-util安装路径" --with-"apr安装路径"/apr-1-config --enable-utf8 make && make install 1234
解决pcre问题
unzip -o pcre-8.10.zip cd pcre-8.10 ./configure --prefix="pcre安装路径" make && make install 1234
最后安装Apache
./configure --prefix="apache安装路径" --with-apr="apr安装路径" --with-apr-util="apr-util安装路径" --with-pcre="pcre安装路径" --enable-modules=most1
启动
/apache/bin/apachectl start1
结果
lsof -i:80COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEhttpd 20578 root 4u IPv6 234943 0t0 TCP *:http (LISTEN) httpd 20579 daemon 4u IPv6 234943 0t0 TCP *:http (LISTEN) httpd 20580 daemon 4u IPv6 234943 0t0 TCP *:http (LISTEN) httpd 20581 daemon 4u IPv6 234943 0t0 TCP *:http (LISTEN)123456