PhpMyAdmin和Suhosin为Suhosin设置了选项。

时间:2011-08-12 18:18:14

标签: apache phpmyadmin vhosts

我在同一台服务器上遇到Suhosin和PhpMyAdmin的问题。阅读文档时:phpmyadmin.net表示我应该覆盖phpmyadmin的设置 例如“suhosin.request.max_vars”。我会把它放在哪里?

在我的apapche2 / conf.d / phpmyadmin.conf

# Note: Please refer to /etc/apache2/sites-available/default-ssl for SSL/TLS setting.
#Alias /phpmyadmin "/usr/share/apache2/phpmyadmin/"
#Alias /mysql "/usr/share/apache2/phpmyadmin/"
<Directory "/usr/share/apache2/phpmyadmin/">
    Options -Indexes
</Directory>

默认-SSL

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/site/public
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/ssl_access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

    # Removed SSL config 

Alias /phpmyadmin /usr/share/apache2/phpmyadmin/
</VirtualHost>
</IfModule>

2 个答案:

答案 0 :(得分:3)

想出来,这可能对其他人有所帮助:

<Directory "/usr/share/apache2/phpmyadmin/">
Options -Indexes

<IfModule mod_php5.c>
    php_value suhosin.request.max_vars 2048
    php_value suhosin.request.max_value_length 1000000
    php_value suhosin.request.max_array_index_length 256
    php_value suhosin.request.max_totalname_length 8192
    php_value suhosin.post.max_vars 2048
    php_value suhosin.post.max_array_index_length 256
    php_value suhosin.post.max_totalname_length 8192
    php_value suhosin.post.max_value_length 1000000
    php_flag suhosin.sql.bailout_on_error Off
    php_value suhosin.log.file 0
    php_value suhosin.log.phpscript 0
    php_flag suhosin.log.phpscript.is_safe Off
    php_value suhosin.log.sapi 0
    php_value suhosin.log.script 0
    php_flag suhosin.log.use-x-forwarded-for Off
    </IfModule>
</Directory>

答案 1 :(得分:2)

这些实际上属于/etc/php5/conf.d/suhosin.ini

并且可以限于以下陈述(因为其他陈述是默认的)

suhosin.request.max_vars=2048
suhosin.post.max_vars=2048
suhosin.request.max_array_index_length=256
suhosin.post.max_array_index_length=256
suhosin.request.max_totalname_length=8192
suhosin.post.max_totalname_length=8192