Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> 學習 Linux

CentOS 6 安裝 Apache 2.4.10 與安全設定

本文示範 CentOS 6.5 安裝 Apache 2.4.10,並以 www 使用者啟動,監聽 8888,啟用 DAV 與 rewrite。

前置套件

先安裝 sqlite、apr、apr-util,再編譯 Apache:

./configure --prefix=/usr/local/apache-2.4.10 --with-apr=/usr/local/apr-1.4.5 --with-apr-util=/usr/local/apr-util-1.3.12 --enable-dav --enable-so --enable-maintainer-mod --enable-rewrite --with-sqlite=/usr/local/sqlite-3.8.7.4
make
make install

啟動

/usr/local/apache/bin/apachectl start
CentOS 6 安裝 Apache 2.4.10 與安全設定

安全設定

關閉 Indexes、隱藏 ServerSignature 與 ServerTokens、設定日誌、限制目錄權限與管理目錄 IP。

ServerSignature Off
ServerTokens Prod
Options -Indexes

上傳目錄若需 777,應禁止執行腳本,降低被植入木馬的風險。

Copyright © Linux教程網 All Rights Reserved