Production Ready WordPress with NGINX, PHP-FPM & SSL

Here is the code snippet used in the video:

sudo echo “deb `lsb_release -cs` nginx” | sudo tee /etc/apt/sources.list.d/nginx.list
sudo curl -fsSL | sudo apt-key add –
apt update
sudo apt install nginx php7.0 php7.0-fpm php7.0-mysql mysql-server
sudo useradd -s /bin/bash -d /home/ -m unixhops


mv /etc/php/7.0/fpm/pool.d/www.conf{,.bak}
vi /etc/php/7.0/fpm/pool.d/

[] user = unixhops
group = unixhops
listen = /run/php/$pool-fpm.sock
listen.owner = nginx = nginx
listen.mode = 0660
chdir = /
; catch_workers_output = yes
; php_value[disable_functions] = “opcache_get_status”
; php_value[display_errors] = on
; php_value[error_reporting] = 22519
; php_value[open_basedir] = “/home/”
; php_value[short_open_tag] = on
; php_admin_value[error_log] = /home/$pool/error.log
; php_admin_flag[log_errors] = on

pm = ondemand
pm.max_children = 5
pm.max_spare_servers = 1
pm.min_spare_servers = 1
pm.process_idle_timeout = 10s
pm.start_servers = 1

vi /etc/nginx/conf.d/

server {
listen 80;

root /home/;

## WordPress Perm links config ##
location / {
try_files $uri $uri/ /index.php?$args;

## Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

## Deal with sitemap wordpress plugin urls ##
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?.xml$ “/index.php?xml_sitemap=params=$2” last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?.xml.gz$ “/index.php?xml_sitemap=params=$2;zip=true” last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?.html$ “/index.php?xml_sitemap=params=$2;html=true” last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?.html.gz$ “/index.php?xml_sitemap=params=$2;html=true;zip=true” last;

# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off; log_not_found off; expires max;

## Okay, Pass all .php files onto a php-fpm/php-fcgi server.
index index.php;

location ~ [^/].php(/|$) {
fastcgi_split_path_info ^(.+?.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
## Setting works on Ubuntu/Debian Linux
### This is a robust solution for path info security issue and works with “cgi.fix_pathinfo = 1” in /etc/php.ini (default)
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/$server_name-fpm.sock;
su – unixhops
tar -xzf latest.tar.gz
ls -l
mv wordpress public_html
CREATE USER ‘wordpress’@’localhost’ IDENTIFIED BY ‘**********’;
GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpress’@’localhost’;

apt-get install software-properties-common
add-apt-repository universe
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install certbot python-certbot-nginx

certbot –nginx

Fuente – Source

Production Ready WordPress with NGINX, PHP-FPM & SSL

Necesitas ayuda con wp? Entonces WPVideo es tu sitio.
Encuentra lo que buscas entre cientos de miles de videos y experiencias personales de otros usuarios. Todos los que empezamos con wp deberíamos tener acceso a esta web, ojalá yo hubiera tenido algo así cuando empecé mi camino como webmaster 🙂
Pero ahora quiero y puedo poner esta web a vuestra disposición.
Disfrutadla 😉

Need help with wp? Then WPVideo is your site.
Find what you are looking for among hundreds of thousands of videos and personal experiences of other users. All of us who started with wp should have access to this website, I wish I had something like that when I started my journey as webmaster 🙂
But now I want and I can put this website at your disposal.
Enjoy it 😉

Publicado en Bases de datos (Databases), Plugins, Wordpress y etiquetado .

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *