运行环境
yum -y install apr apr-devel cyrus-sasl-devel expat-devel libdb-devel openldap-devel apr-util-devel apr-util pcre-devel pcre gcc make zlib-devel
源码包配置
./configure --prefix=/usr/local/httpd --enable-cgi --enable-rewrite --enable-so --enable-deflate --enable-expires
编译安装
make && make install
主配置文件
vi /usr/local/httpd/conf/extra/httpd-default.conf
修改文件中的内容
ServerTokens Prod ##显示最少的信息,默认是Full显示完整信息
ServerSignature Off ##生成页面的页脚
sed "/httpd-default.conf/s/#//" /usr/local/httpd/conf/httpd.conf
/usr/local/httpd/bin/apachectl restart
成功隐藏版本号