Configure um subdomínio (Virtualhost) para o phpMyAdmin

0

Eu tenho um problema com a configuração de um subdomínio (Virtualhost) para o phpMyAdmin.

Meu arquivo .conf atual é assim:

<VirtualHost *:80>
ServerName php.erichermansson.com
ServerAdmin [email protected]

DocumentRoot /usr/share/phpmyadmin
<Directory />
    Options FollowSymLinks
    DirectoryIndex index.php

    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php
        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_admin_flag allow_url_fopen Off
        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/
    </IfModule>
</Directory>

# Authorize for setup
<Directory setup>
    <IfModule mod_authn_file.c>
        AuthType Basic
        AuthName "phpMyAdmin Setup"
        AuthUserFile /etc/phpmyadmin/htpasswd.setup
    </IfModule>

    Require valid-user
</Directory>

# Disallow web access to directories that don't need it
<Directory libraries>
    Order Deny,Allow
    Deny from All
</Directory>

<Directory setup/lib>
    Order Deny,Allow
    Deny from All
</Directory>
</VirtualHost>

Vocês têm a menor idéia do problema? Apenas acessa a página de teste do Apache.

    
por Eric Hermansson 10.11.2015 / 20:18

1 resposta

0

Todos os quatro dos seus < Directory > as sub-rotinas são definidas com caminhos relativos. Caminhos de diretório devem sempre ser caminhos absolutos completos (ou caminhos absolutos com curingas).

Eles são NÃO interpretados como se fossem relativos ao DocumentRoot.

Tente:

<Directory /usr/share/phpmyadmin/>
...
</Directory>

<Directory /usr/share/phpmyadmin/setup>
...
</Directory>

<Directory /usr/share/phpmyadmin/libraries>
...
</Directory>

<Directory /usr/share/phpmyadmin/setup/lib>
...
</Directory>

Na documentação do Apache 2.2: (2.4 é o mesmo)

<Directory> and </Directory> are used to enclose a group of directives that will apply only to the named directory, sub-directories of that directory, and the files within the respective directories. Any directive that is allowed in a directory context may be used.

Directory-path is either the full path to a directory, or a wild-card string using Unix shell-style matching. In a wild-card string, ? matches any single character, and * matches any sequences of characters. You may also use [] character ranges.

None of the wildcards match a '/' character, so <Directory */public_html> will not match /home/user/public_html, but <Directory /home/*/public_html> will match.

    
por 10.11.2015 / 21:44