User Tools

Site Tools


servers:nginx:php_info

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
servers:nginx:php_info [2016/06/13 22:03]
Sean Rhone [Cleanup]
servers:nginx:php_info [2016/06/18 10:46] (current)
Sean Rhone [Server Block]
Line 1: Line 1:
 +====== Information ======
  
 +  * PHP Info
 +  * [[Information:Realm of Espionage]]
 +  * https://test.realmofespionage.xyz
 +
 +===== Prerequisites =====
 +
 +  * [[Distros:Ubuntu (Server)]]
 +  * [[Servers:nginx+PHP+PHP-FPM|nginx + PHP + PHP-FPM]]
 +  * [[Servers:nginx:Lets Encrypt]]
 +
 +====== PHP File ======
 +
 +  sudo mkdir -p '/var/www/php-info' && sudo -e '/var/www/php-info/index.php'
 +
 +  <?php
 +  phpinfo();
 +  ?>
 +
 +====== nginx + PHP-FPM Configuration ======
 +
 +===== PHP-FPM Socket =====
 +
 +  sudo -e '/etc/php/7.0/fpm/pool.d/php-info.conf' && sudo systemctl restart 'php7.0-fpm'
 +
 +  [php-info]
 +  user = www-data
 +  group = www-data
 +  listen = /run/php/php-info.sock
 +  listen.owner = www-data
 +  listen.group = www-data
 +  listen.allowed_clients = 127.0.0.1
 +  pm = ondemand
 +  pm.max_children = 8
 +  pm.process_idle_timeout = 10s
 +
 +===== FastCGI =====
 +
 +  sudo -e '/etc/nginx/snippets/php-info.conf'
 +
 +  location ~ \.php$ {
 +      try_files $uri =404;
 +      include fastcgi.conf;
 +      fastcgi_intercept_errors on;
 +      fastcgi_index index.php;
 +      fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 +      fastcgi_param HTTPS on;
 +      fastcgi_pass unix:/run/php/php-info.sock;
 +  }
 +
 +===== Server Block ======
 +
 +  sudo -e '/etc/nginx/sites-available/php-info.conf'
 +
 +  server {
 +      listen '443' 'ssl' 'http2';
 +      server_name 'test.realmofespionage.xyz';
 +      root '/var/www/php-info';
 +      index 'index.php';
 +  
 +      include '/etc/nginx/snippets/php-info.conf';
 +  
 +      #access_log /var/log/nginx/php-info-access.log;
 +      #error_log /var/log/nginx/php-info-error.log info;
 +  }
 +
 +==== Enable ====
 +
 +****
 +
 +  sudo ln -s '/etc/nginx/sites-available/php-info.conf' '/etc/nginx/sites-enabled/php-info.conf' && sudo systemctl reload 'nginx'
 +
 +====== Verify ======
 +
 +  * http://test.realmofespionage.xyz
 +
 +====== Cleanup ======
 +
 +****
 +
 +  sudo unlink '/etc/nginx/sites-enabled/php-info.conf' && sudo rm -R '/etc/nginx/sites-available/php-info.conf' '/etc/nginx/snippets/php-info.conf' '/etc/php/7.0/fpm/pool.d/php-info.conf' '/var/www/php-info' && sudo systemctl restart 'nginx' 'php7.0-fpm'
servers/nginx/php_info.txt ยท Last modified: 2016/06/18 10:46 by Sean Rhone