2014-10-27 57 views
0

我总是使用默认的mpm-prefork和PHP作为DSO(mod_php)运行Apache。 我要为我和几个朋友制作新的LAMP服务器,我想使用最有效的安全方法。哪一种安全技术用于Apache和PHP?

我决定使用Apache2(尽管我知道nginx应该是securit的不错选择)并且使用mpm-itk而不是传统的prefork。我的愿景是每个网站都会在特定的用户下运行。到现在为止还挺好。对于PHP我不想使用DSO,我想设置FastCGI(PHP-FPM)。

但我真的不知道它是否会互相兼容。 例如用户丹尼尔(/家/丹尼尔/ WWW/...)将Web表示将会根据他跑和PHP scrips也将在他跑:

<VirtualHost *:80> 
    SuexecUserGroup daniel daniel 

    ServerName example.com 
    DocumentRoot /home/daniel/www 

    PHP_Fix_Pathinfo_Enable 1 
    <Directory /home/daniel/www> 
     Options +Indexes +ExecCGI 
     AllowOverride All 
     AddHandler fcgid-script .php 
     FCGIWrapper /var/www/daniel/php5-wrap .php 
     Order deny,allow 
     Allow from all 
    </Directory> 
</VirtualHost> 

<IfModule mpm_itk_module> 
AssignUserId daniel daniel 
</IfModule> 

我有点绝望了,如果它是好的解决方案,如果它会一起工作。 我将非常乐意为您提供任何意见和建议。

在此先感谢。

Daniel

回答