apache安装

linux 环境下apache服务器的安装

1 版本

2.4.18

2 安装包准备

otauser@OTA:~/apr-util-1.5.4$ ./configure –prefix=/app/apr-util-1.5.4 -with-apr=/app/apr-1.5.2/bin/apr-1-config
otauser@OTA:~/apr-util-1.5.4$ make
otauser@OTA:~/apr-util-1.5.4$ make install

3.5 引入依赖包 apr-util-1.5.4

otauser@OTA:~/httpd-2.4.18$ ./configure –prefix=/app/apache-2.4.18 –with-apr=/app/apr-1.5.2/ –with-apr-util=/app/apr-util-1.5.4/
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

3.6 如果出现以下error,执行步骤3.7,否则执行步骤3.8

otauser@OTA:~/pcre-8.37$ ./configure –prefix=/app/pcre-8.37
configure: error: You need a C++ compiler for C++ support.

3.7 切换到root 用户执行以下命令

sudo su
root@OTA:/home/otauser# apt-get install build-essential

3.8. 配置依赖包 pcre-8.37

otauser@OTA:~/pcre-8.37$ ./configure –prefix=/app/pcre-8.37

otauser@OTA:~/pcre-8.37$ make

otauser@OTA:~/pcre-8.37$ make install

3.9安装成功

otauser@OTA:~/httpd-2.4.18$ ./configure –prefix=/app/apache-2.4.18 –with-apr=/app/apr-1.5.2/ –with-apr-util=/app/apr-util-1.5.4/ –with-pcre=/app/pcre-8.37
otauser@OTA:~/httpd-2.4.18$ make
otauser@OTA:~/httpd-2.4.18$ make install

3.10启动、关闭apache 的命令

/app/apache-2.4.18/bin/apachectl start
/app/apache-2.4.18/bin/apachectl stop

转载请注明出处 http://www.justli.xyz/2017/03/15/apache安装/