How to Install nginx and PHP on CentOS7

Install nginx and PHP on CentOS7 These are some notes from installing nginx on CentOS7 Install some prerequisites sudo yum -y groupinstall "Development tools" sudo yum -y install mlocate sudo yum -y install iptables-services sudo yum -y install php-mysql php-dom sudo yum -y install wget sudo service php-fpm restart Install GeoIP cd /tmp wget » read more

Testing SSL Chaining Issues

Recently I needed to debug an issue by testing SSL chaining issues My old standby tools (curl and openssl were not reporting any errors) The exception PKIX path validation failed: Path does not chain with any of the trust anchors Cause The cert from the keystore does not match the cert from... » read more

nginx code igniter remove index.php prefix

Objective Remove the index.php prefix from your nginx code igniter instance. Assumptions In your main nginx conf file you define how php is called (unix socket or ip:port) You will replace with whatever your domain name is The proper logging path will be defined per your system as opposed to the location i have... » read more

nginx redirect single url

Objective Using nginx redirect single url Example ORIGINAL URL: REDIRECT TO: nginx basic php location block example location / { try_files $uri $uri/ @mylocation; } location @mylocation { rewrite ^/foo(.*)$ /bar/ redirect; rewrite ^.*$ /index.php last; } nginx wordpress example location / { try_files $uri $uri/ @wordpress; } location @wordpress { rewrite ^/foo(.*)$... » read more

nginx logrotate script

nginx logrotate script Create a new file at /etc/logrotate.d/nginx with contents: /var/log/nginx/*.log { daily missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate [ ! -f /var/run/ ] || kill -USR1 `cat /var/run/` endscript } Run Logrotate # /etc/cron.daily/logrotate

nginx ssl pfx

This article will explain what to do with nginx ssl pfx. First get the pfx file to your server. In this example we will be using a directory called “ssl” off of the nginx root (where nginx.conf is located). From within the ssl folder, export the certificate: openssl pkcs12 -in -nokeys -out Export... » read more

Install PHP APC with Nginx on Centos 6.2

Install PHP APC with Nginx on Centos 6.2 Install latest apc: # pecl install apc-3.1.10 Move your old apc.ini to a safe location: # mv /etc/php.d/apc.ini /etc/php.d/apc.ini.old Create a new /etc/php.d/apc.ini (content below): ; Enable apc extension module extension = ; Options for the APC module version >= 3.1.3 ; See ; This... » read more

nginx secure /user drupal

If you are not serving drupal out of a subdirectory use this config example: location / { # This is cool because no php is touched for static content try_files $uri @rewrite; } location @rewrite { Some modules enforce no slash (/) at the end of the URL Else this rewrite block wouldn't be needed... » read more

nginx php centos6 howto

Remove previous php installation # yum remove php-cli php-common Add the EPEL and REMI repos: wget wget sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm Install nginx prerequisites # yum install perl pcre-devel gperftools-devel geoip geoip-devel Download nginx # wget "" Nginx configuration & installation: # ./configure --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/ --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp... » read more