linux源码安装apache
安装APR
gzip -d apr-1.5.2.tar.gz
tar -xf apr-1.5.2.tar
ls -l
cd ./apr-1.5.2/
./configure
make
make install
安装APR-Util
gzip -d apr-util-1.5.4.tar.gz
tar -xf apr-util-1.5.4.tar
ls -l
cd ./apr-util-1.5.4/ //指定apr位置
./configure --with-apr=/usr/local/apr
make
make install
安装PCRE
gzip -d pcre-8.36.tar.gz
tar -xf pcre-8.36.tar
ls -l
cd ./pcre-8.36/
./configure //需要安装GCC 和GCC-C++; 命令:yum install -y gcc gcc-c++
make
make install
- 安装apache
gzip -d httpd-2.4.17.tar.gz
tar -xf httpd-2.4.17.tar
ls -l
cd ./httpd-2.4.17/
./configure --enable-mods-shared=all //编译全部模块 --prefix=目录名 可指定安装目录
make
make install
修改httpd.conf文件
ServerName : localhost:80
设置软连接
ln -s /usr/local/apache2/bin/apachectl /mylinks/httpd。
ls -l /mylinks
启动apache
/mylinks/httpd -k start
关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
转载地址:https://jingyan.baidu.com/article/7e4409533d7f0f2fc0e2ef91.html
http://apr.apache.org apr,apr-util下载地址 ↩︎ ↩︎
http://www.pcre.org pcre下载地址 ↩︎