环境:Redhat6.6
版本:
#[root@youtube01 tmp]# ll-rw-r--r-- 1 root root 1020833 10月 31 02:13 apr-1.5.1.tar.gz-rw-r--r-- 1 root root ?829779 10月 31 02:13 apr-util-1.5.1.tar.gz-rw-r--r-- 1 root root 8460433 10月 31 02:13 httpd-2.4.25.tar.gz-rw-r--r-- 1 root root 1790055 10月 31 02:13 pcre-8.32.tar.gz2、安装依赖包
#[root@youtube01 tmp]# yum -y install gcc gcc-c++ openssl openssl-devel[root@youtube01 tmp]# mkdir /app/apache[root@youtube01 tmp]# tar zxf apr-1.5.1.tar.gz [root@youtube01 tmp]# cd apr-1.5.1[root@youtube01 apr-1.5.1]# ./configure --prefix=/app/apache/apr[root@youtube01 apr-1.5.1]# make && make install[root@youtube01 tmp]# tar zxf pcre-8.32.tar.gz [root@youtube01 tmp]# cd pcre-8.32[root@youtube01 pcre-8.32]# ./configure --prefix=/app/apache/pcre[root@youtube01 pcre-8.32]# make && make install[root@youtube01 tmp]# tar zxf apr-util-1.5.1.tar.gz [root@youtube01 tmp]# cd apr-util-1.5.1[root@youtube01 apr-util-1.5.1]# ./configure --prefix=/app/apache/apr-util --with-apr=/app/apache/apr[root@youtube01 apr-util-1.5.1]# make && make install3、安装apache
#[root@youtube01 tmp]# tar zxf httpd-2.4.25.tar.gz [root@youtube01 tmp]# cd httpd-2.4.25[root@youtube01 httpd-2.4.25]# ./configure --prefix=/app/apache --enable-so --enable-mods-shared=most --with-mpm=worker --enable-proxy --enable-rewrite --enable-ssl --with-pcre=/app/apache/pcre --with-apr=/app/apache/apr --with-apr-util=/app/apache/apr-util[root@youtube01 httpd-2.4.25]# make && make install4、日志设置
将apache的日志按天轮询
[root@youtube01 ~]# vim /app/apache/conf/httpd.conf#ErrorLog "logs/error_log"ErrorLog "|/app/apache/bin/rotatelogs -l /app/apache/logs/error_%Y%m%d.log 86400" ???增加#CustomLog "logs/access_log" common ??注释掉CustomLog "|/app/apache/bin/rotatelogs -l /app/apache/logs/access_%Y%m%d.log 86400" combined 增加5、关闭TRACE
TRACE和TRACK是用来调试web服务器连接的HTTP方式。支持该方式的服务器存在跨站脚本漏洞,通常在描述各种浏览器缺陷的时候,把"Cross-Site-Tracing"简称为XST。***者可以利用此漏洞欺骗合法用户并得到他们的私人信息。
[root@youtube01 ~]# vim /app/apache/conf/httpd.conf...TraceEnable off ???###文档末尾添加6、启动apache
##[root@youtube01 ~]# /app/apache/bin/apachectl start[root@youtube01 ~]# ps aux|grep httpdroot ?????42786 ?0.0 ?0.1 ?75844 ?2840 ? ???????Ss ??02:58 ??0:00 /app/apache/bin/httpd -k startdaemon ???42789 ?0.0 ?0.2 420104 ?4600 ? ???????Sl ??02:58 ??0:00 /app/apache/bin/httpd -k startdaemon ???42790 ?0.0 ?0.2 485640 ?4608 ? ???????Sl ??02:58 ??0:00 /app/apache/bin/httpd -k startdaemon ???42791 ?0.3 ?0.2 420104 ?4604 ? ???????Sl ??02:58 ??0:00 /app/apache/bin/httpd -k startroot ?????42878 ?0.0 ?0.0 103256 ??848 pts/1 ???S+ ??02:58 ??0:00 grep http编译安装apache
原文地址:http://blog.51cto.com/12244079/2311485