使用mod_proxy改进LAMP 安全

http://tech.ddvip.com   2007年03月04日    社区交流

使用mod_proxy改进LAMP 安全。

  元素Apache 版本原因facade 服务器
Apache 2,运行 worker 或 event MPM
Apache 2 对 mod_proxy 模块做了重要的改进。worker 和 event MPM 是线程化的,有助于减少 facade 服务器的内存开销。
后端服务器
Apache 1.3,或运行 prefork MPM 的 Apache 2
Apache 管理员必须意识到 PHP 模块不应该运行在线程化环境中。这两个解决方案为 PHP 模块提供了基于进程的环境。

  后端 Apache 实例的配置

  清单 2 和 清单 3 中的代码片段说明了与标准 Apache 配置的基本差异。应该根据需要将它们添加到适当的配置中,比如这里忽略的 PHP 功能配置。

  清单 2. 在线创业企业的 Apache 配置

# Stuff every Apache configuration needs
ServerType standalone
LockFile /var/lock/apache/accept.startup.lock
PidFile /var/run/apache.startup.pid
ServerName necessaryevil.startup.tld
DocumentRoot "/home/startup/web"
# Essential modules
LoadModule access_module /usr/lib/apache/1.3/mod_access.so
# Which user to run this Apache configuration as
User startup
Group startup
# This must be off else the host isn't passed correctly
UseCanonicalName Off
# The IP/port combination to listen on
Listen 127.0.0.2:10000
# Using name-based virtual hosting allows you to host multiple sites per IP/port combo
NameVirtualHost 127.0.0.2:10000
<VirtualHost 127.0.0.2:10000>
    ServerName www.startup.tld
    # You can add aliases so long as the facade server is aware of them!
    ServerAlias startup.tld
    DocumentRoot "/home/startup/web/www.startup.tld"
    <Directory /home/startup/web/www.startup.tld/>
      Options Indexes FollowSymLinks MultiViews ExecCGI Includes
      AllowOverride All
      Order allow,deny
      Allow from all
    </Directory>
</VirtualHost>

来源:IBM DW中国    作者:Nick Maynard    责编:豆豆技术应用

正在加载评论...