Linux Apache 安装(无外网)

  • 下载Apache

http://httpd.apache.org/download.cgi

  • 下载依赖

http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz

http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz

http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip 

  • 安装依赖

tar -xvf apr-1.4.5.tar.gz

cd apr-1.4.5

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

make -j20

make install -j20

cd ..

tar -xvf apr-util-1.3.12.tar.gz

cd apr-util-1.3.12

./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config

make -j20

make install -j20

cd ..

unzip pcre-8.10.zip

cd pcre-8.10

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

make -j20

make install -j20

cd ..

  • 安装Apache

tar -zvxf httpd-2.4.37.tar.gz

cd httpd-2.4.37

./configure --prefix=/usr/local/apache2 --enable-modules=all --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre

make -j20

make install -j20

  • 修改配置(略)

vim /usr/local/apache2/conf/httpd.conf

  • 启动Apache

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

  • 关闭Apache

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

 

 

参考文献:

https://blog.csdn.net/u013218587/article/details/70169883

http://blog.51cto.com/xtony/836508

posted @ 2018-10-25 17:50  jhc888007  阅读(528)  评论(0编辑  收藏  举报