Skip to content

Instantly share code, notes, and snippets.

@zellio
Last active August 29, 2015 14:07

Revisions

  1. Zachary Elliott revised this gist Oct 7, 2014. 3 changed files with 104 additions and 2 deletions.
    70 changes: 70 additions & 0 deletions httpd.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,70 @@

    LoadModule actions_module modules/mod_actions.so
    LoadModule fastcgi_module modules/mod_fastcgi.so
    LoadModule rewrite_module modules/mod_rewrite.so

    FastCgiIpcDir /var/run/php-fpm/ipc

    FastCgiExternalServer /var/run/php-fpm/fcgi -appConnTimeout 3 -user apache \
    -group apache -idle-timeout 10 -pass-header Authorization \
    -socket /var/run/php-fpm/socket

    Alias /php.exec /var/run/php-fpm/fcgi

    AddHandler php-fastcgi-exec .php

    Action php-fastcgi-exec /php.exec

    <Directory "/var/run/php-fpm/">
    Order deny,allow
    Deny from all

    <Files "php.exec">
    Order allow,deny
    Allow from all
    </Files>
    </Directory>

    DocumentRoot /var/www/html

    <Directory "/var/www/html">
    Options Indexes FollowSymLinks +ExecCGI
    AllowOverride AuthConfig FileInfo Options Indexes
    DirectoryIndex index.php

    Order allow,deny
    Allow from all
    </Directory>

    Listen 80
    <VirtualHost _default_:80>
    LogLevel notice
    LogFormat "%v %l %u %t \"%r\" %>s %b" vhost80

    Redirect permanent / https://localhost.localhost

    CustomLog /var/log/httpd/vhost80_access.log vhost80
    ErrorLog /var/log/httpd/vhost80_error.log
    </VirtualHost>

    Listen 443
    <VirtualHost _default_:443>
    LogLevel notice
    LogFormat "%v %l %u %t %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %>s %b" vhost443

    CustomLog /var/log/httpd/vhost443_access.log vhost443
    ErrorLog /var/log/httpd/vhost443_error.log
    TransferLog /var/log/httpd/vhost443_transfer.log

    SSLEngine on

    SSLProtocol all -SSLv2

    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

    SetEnvIf User-Agent ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    </VirtualHost>
    2 changes: 0 additions & 2 deletions mod_fastcgi.conf
    Original file line number Diff line number Diff line change
    @@ -1,2 +0,0 @@
    <Directory>
    </Directory>
    34 changes: 34 additions & 0 deletions php-fpm-pool.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    [php-www]

    listen = /var/run/php-fpm/socket
    listen.owner = apache
    listen.group = apache
    listen.mode = 0640

    user = apache
    group = apache

    pm = dynamic
    pm.max_children = 50
    pm.start_servers = 8
    pm.min_spare_servers = 5
    pm.max_spare_servers = 35
    ;pm.max_requests = 500
    ;pm.status_path = /status

    ;ping.path = /ping
    ;ping.response = pong

    request_terminate_timeout = 30
    request_slowlog_timeout = 15

    slowlog = /var/log/php-fpm/www-slow.log

    security.limit_extensions = .php

    php_admin_value[error_log] = /var/log/php-fpm/www-error.log
    php_admin_flag[log_errors] = on
    ;php_admin_value[memory_limit] = 128M

    php_value[session.save_handler] = files
    php_value[session.save_path] = /var/lib/php/session
  2. zellio created this gist Oct 7, 2014.
    2 changes: 2 additions & 0 deletions mod_fastcgi.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    <Directory>
    </Directory>