I'm setting up a server with Plesk, and we'd like to be able to provide a publicly-accessible copy of phpMyAdmin.
I was able to determine where it could go:
/var/www/vhosts/default/httpsdocs
However, it's serving phpMyAdmin as the actual PHP files, not as executed PHP.
What's the best/correct way to enable PHP execution on that directory?
One way would be to add a directive to control/configure that directory
You don't write, what webserver do you use. I assume it is Apache running on RHEL5
First, you must check, if php module is installed and loaded into apache and properly configured.
You wrote, that apache return files intead of executing them. This is default action for apache if apache doesn't know, what to do with special file type. In default RHEL apache config, php is loaded from file
/etc/httpd/conf.d/php.conf
and file/etc/httpd/conf/httpd.conf
contains lineInclude conf.d/*.conf
, which includes all files fromconf.d
dir. These lines fromphp.conf
should be uncommented:Second, you must check, if SELinux protection doesn't deny any requests. If SELinux deny access to some files from apache, you will se
403 Forbidden
error in your browser. In/var/log/audit/audit.log
you will se someavc: denied
messages. You should readman httpd_selinux
manpage. Files from directory/var/www/vhosts/default/httpsdocs
should be labeled withhttpd_sys_content_t
label (you should executechcon -R -t httpd_sys_content_t
). To make this change premament (to survice filestytem relabel), you should execute alsosemanage fcontext -a -t httpd_sys_content_t /var/www/vhosts/default/httpsdocs(/.*)?