filmov
tv
Web Server Project -- 02 Setting up MySQL and PHP

Показать описание
Here's how to get your database and interpreter set up for hosting an application on the LAMP/LEMP stack (Linux / Apache/Nginx / MySQL / PHP).
This is the second of three videos about how to set up a webserver (and a WordPress blog or website on Linux). In this video, I'll show you how to install and configure a MySQL Database. I'll also show you how to set up PHP and php-fpm (our PHP interpreter and the fastcgi process manager) so that nginx can ask PHP to render pages with dynamic content for website visitors.
This video is quick-and-dirty -- no optimization, only the most basic security precautions, etc...but it should get you started.
Here's the nginx configuration file content for /etc/nginx/sites-available/{yoursite}:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
server_name server_domain_name_or_IP;
location / {
try_files $uri $uri/ =404;
}
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
This is the second of three videos about how to set up a webserver (and a WordPress blog or website on Linux). In this video, I'll show you how to install and configure a MySQL Database. I'll also show you how to set up PHP and php-fpm (our PHP interpreter and the fastcgi process manager) so that nginx can ask PHP to render pages with dynamic content for website visitors.
This video is quick-and-dirty -- no optimization, only the most basic security precautions, etc...but it should get you started.
Here's the nginx configuration file content for /etc/nginx/sites-available/{yoursite}:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
server_name server_domain_name_or_IP;
location / {
try_files $uri $uri/ =404;
}
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Комментарии