Instalei o Apache2.4 + Php5.6 + mod_proxy_fcgi + php-fpm e outras coisas como o Mysql 5.5, Phpmyadmin e munin, sem problemas. Nota: eu também ativei userdir e reescreva.
Agora quero ter mais segurança, mas o SuExec não funciona e não foram encontrados erros. Se eu inserir /home/sitetest/public_html/test.php com:
<?php
echo exec('whoami');
?>
Diz:
www-data
O que posso fazer? Pesquisa no google não me ajuda.
/var/log/apache2/error.log
[Fri Dec 11 21:32:21.918933 2015] [mpm_prefork:notice] [pid 771] AH00169: caught SIGTERM, shutting down
[Fri Dec 11 21:32:28.064683 2015] [suexec:notice] [pid 12374] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Fri Dec 11 21:32:28.126362 2015] [mpm_prefork:notice] [pid 12375] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
[Fri Dec 11 21:32:28.128026 2015] [core:notice] [pid 12375] AH00094: Command line: '/usr/sbin/apache2'
/etc/apache2/apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /home>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/cache/munin/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
/etc/apache2/sites-enabled/sitetest.net.conf
<VirtualHost *:80>
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost/"
</FilesMatch>
ServerName www.sitetest.net
ServerAlias sitetest.net
ServerAdmin [email protected]
DocumentRoot /home/sitetest/public_html
ErrorLog /home/sitetest/logs/error.log
CustomLog /home/sitetest/logs/access.log combined
SuexecUserGroup sitetest sitetest
</VirtualHost>
/ etc / apache2 / suexec / www-data
/home
public_html
/etc/apache2/mods-enabled/userdir.conf
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options ExecCGI SymLinksIfOwnerMatch
<Limit GET POST OPTIONS>
Require all granted
</Limit>
<LimitExcept GET POST OPTIONS>
Require all denied
</LimitExcept>
</Directory>
</IfModule>
Tags apache-2.4 suexec php56