安装apache

Posted pigfly

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装apache相关的知识,希望对你有一定的参考价值。

1.安装依赖软件

  • expat
  • pcre
  • apr(Apache portable Run-time libraries,Apache可移植运行库)
  • apr-util
[[email protected] ~]$ yum -y install expat-devel

[[email protected] ~]$ yum -y install pcre-devel

[[email protected] ~]$ cd /user/local/src

[[email protected] src]$ wget http://mirror.bit.edu.cn/apache//apr/apr-1.6.2.tar.gz

[[email protected] src]$ wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.6.0.tar.gz
[[email protected] src]$ tar -zxvf apr-1.6.2.tar.gz
[[email protected] src]# cd apr-1.6.2
[[email protected] apr-1.6.2]# ./configure --prefix=/usr/local/apr
[[email protected] apr-1.6.2]# cd ..

[[email protected] src]#  tar -zxvf apr-util-1.6.0.tar.gz
[[email protected] src]#  cd apr-util-1.6.0
[[email protected] apr-util-1.6.0]# ./configure --prefix=/usr/local/apr-util  --with-apr=/usr/local/apr
[[email protected] apr-util-1.6.0]# make && make install

  

 

2.安装apache httpd server

[[email protected] apr-util-1.6.0]# cd..

[[email protected] src]$ wget http://mirrors.aliyun.com/apache/httpd/httpd-2.4.28.tar.gz

[[email protected] src]#  tar -zxvf httpd-2.4.28.tar.gz
[[email protected] src]#  cd httpd-2.4.28
[[email protected] httpd-2.4.28]# ./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

[[email protected] httpd-2.4.28]# make && make install

[[email protected] httpd-2.4.28]# /usr/local/httpd/bin/apachectl start
[[email protected] httpd-2.4.28]# ps -aux | grep http #查看进程检查apache是否正常启动

root 1215 0.0 0.2 70900 2136 ? Ss 12:06 0:00 /usr/local/httpd/bin/httpd -k start
daemon 1216 0.0 0.4 359864 4252 ? Sl 12:06 0:00 /usr/local/httpd/bin/httpd -k start
daemon 1217 0.0 0.4 359864 4252 ? Sl 12:06 0:00 /usr/local/httpd/bin/httpd -k start
daemon 1218 0.0 0.4 359864 4252 ? Sl 12:06 0:00 /usr/local/httpd/bin/httpd -k start
root 1305 0.0 0.0 112660 968 pts/0 R+ 12:07 0:00 grep --color=auto httpd

  

 

以上是关于安装apache的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf Linux片段

elasticsearch代码片段,及工具类SearchEsUtil.java

apache_conf 针对.htaccess的安全调整片段。

在Tomcat的安装目录下conf目录下的server.xml文件中增加一个xml代码片段,该代码片段中每个属性的含义与用途

PHP代码-psysh调试代码片段工具

apache_conf 强大的.htaccess片段,需要在最顶层使用RewriteEngine On