Skip to content

Instantly share code, notes, and snippets.

@wizonesolutions
Created April 27, 2015 09:29
Show Gist options
  • Save wizonesolutions/a7a9e8c9dac349fbe9b7 to your computer and use it in GitHub Desktop.
Save wizonesolutions/a7a9e8c9dac349fbe9b7 to your computer and use it in GitHub Desktop.
Apache PHP config
<Directory /home/example/public_html>
# Set PHP-FPM directory options
Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All
</Directory>
RewriteEngine on
# Configure PHP-FPM to handle PHP
RemoveHandler .php
RemoveHandler .php5
AddHandler php5-fcgi .php .php5
Action php5-fcgi /fcgi-bin/php5-example.external virtual
Action application/x-httpd-php /fcgi-bin/php5-example.external
Alias /fcgi-bin/php5-example.external /php5-example.external
# Prevent requests for the PHP-FPM server
<Location /fcgi-bin/php5.external>
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</Location>
@wizonesolutions
Copy link
Author

^
For the record, not getting any SELinux failures in /var/log/audit. And this same approach (minus the virtual after the php5-fcgi Action works elsewhere w/o issue. I'm porting my Apache config from a Lucid box to a CentOS 6 box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment