• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Download prompt instead of processing PHP code, after creating an Alias

AdrianC

Basic Pleskian
I tried to install Zabbix statistics on my Plesk (17.8.11), it creates an alias just like phpmyadmin does, but whenever I access the path (/zabbix) it opens a download prompt instead of processing the php code, I am not sure where to edit in order to make it process the php code.

My PHP info page on that server: phpinfo()

This is the file installation created inside /etc/httpd/conf.d/zabbix.conf

Code:
Alias /zabbix /usr/share/zabbix

<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None

    <IfModule mod_authz_core.c>
      # Apache 2.4
      Require all granted
    </IfModule>

    <IfModule !mod_authz_core.c>
      # Apache 2.2
      Order allow,deny
      Allow from all
    </IfModule>

    <IfModule mod_php5.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300

        # Removed in PHP 7
        php_value always_populate_raw_post_data -1

        php_flag session.auto_start off
        php_value mbstring.func_overload 0
        php_value date.timezone UTC
    </IfModule>

</Directory>

<Directory ~ "^/usr/share/zabbix/(conf|app|include|local)/">
    <IfModule mod_authz_core.c>
      # Apache 2.4
      Require all denied
    </IfModule>

    <IfModule !mod_authz_core.c>
      # Apache 2.2
      Order deny,allow
      Deny from all
    </IfModule>

    <files *.php>
      <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all denied
      </IfModule>

      <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
      </IfModule>

    </files>

    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
        SetHandler application/x-httpd-php
    </FilesMatch>


</Directory>
 
To simplify, I created a hello world file in /adr/alias/index.php and set this in a conf.d include file:

Code:
Alias /adr /adr/alias

<Directory "/adr/alias">

        <RequireAny>
        Require all granted
        </RequireAny>

</Directory>

I also tried setting folder and file owner same as my www user, e.g me : psacln
The result is the same, I get a download prompt of the code in plain text, and a "denied" unless I add the Require all granted.
 
Back
Top