Changed IP from 192.168.50.100 to 192.168.56.100
parent
460db614f8
commit
b18c4d2855
|
@ -8,7 +8,7 @@ Vagrant.configure("2") do |config|
|
||||||
config.vm.hostname = "phpservermon-dev"
|
config.vm.hostname = "phpservermon-dev"
|
||||||
config.vm.box = "bento/ubuntu-20.04"
|
config.vm.box = "bento/ubuntu-20.04"
|
||||||
config.vm.box_check_update = false
|
config.vm.box_check_update = false
|
||||||
config.vm.network "private_network", ip: "192.168.50.100"
|
config.vm.network "private_network", ip: "192.168.56.100"
|
||||||
config.vm.provision :ansible do |ansible|
|
config.vm.provision :ansible do |ansible|
|
||||||
ansible.limit = "all"
|
ansible.limit = "all"
|
||||||
ansible.playbook = "provision.yaml"
|
ansible.playbook = "provision.yaml"
|
||||||
|
|
|
@ -1,84 +1,84 @@
|
||||||
upstream php-fpm {
|
upstream php-fpm {
|
||||||
server unix:/var/run/php/php7.4-fpm.sock;
|
server unix:/var/run/php/php7.4-fpm.sock;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name 192.168.50.100;
|
server_name 192.168.56.100;
|
||||||
|
|
||||||
root /vagrant;
|
root /vagrant;
|
||||||
index index.php;
|
index index.php;
|
||||||
charset UTF-8;
|
charset UTF-8;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_http_version 1.1;
|
gzip_http_version 1.1;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
gzip_comp_level 6;
|
gzip_comp_level 6;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_types text/plain text/xml text/css application/x-javascript;
|
gzip_types text/plain text/xml text/css application/x-javascript;
|
||||||
|
|
||||||
access_log /var/log/nginx/psm.access.log;
|
access_log /var/log/nginx/psm.access.log;
|
||||||
error_log /var/log/nginx/psm.com.error.log;
|
error_log /var/log/nginx/psm.com.error.log;
|
||||||
|
|
||||||
location = /favicon.ico {
|
location = /favicon.ico {
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
deny all;
|
deny all;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ /\.svn/* {
|
location ~ /\.svn/* {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ /\.git/* {
|
location ~ /\.git/* {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /nginx_status {
|
location /nginx_status {
|
||||||
stub_status on;
|
stub_status on;
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php?q=$uri&$args;
|
try_files $uri $uri/ /index.php?q=$uri&$args;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
|
|
||||||
set $nocache "";
|
set $nocache "";
|
||||||
if ($http_cookie ~ (comment_author_.*|wordpress_logged_in.*|wp-postpass_.*)) {
|
if ($http_cookie ~ (comment_author_.*|wordpress_logged_in.*|wp-postpass_.*)) {
|
||||||
set $nocache "Y";
|
set $nocache "Y";
|
||||||
}
|
}
|
||||||
|
|
||||||
fastcgi_pass php-fpm;
|
fastcgi_pass php-fpm;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_param SCRIPT_FILENAME /vagrant$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME /vagrant$fastcgi_script_name;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
|
|
||||||
fastcgi_cache_use_stale error timeout invalid_header http_500;
|
fastcgi_cache_use_stale error timeout invalid_header http_500;
|
||||||
fastcgi_cache_key $host$request_uri;
|
fastcgi_cache_key $host$request_uri;
|
||||||
fastcgi_cache off;
|
fastcgi_cache off;
|
||||||
fastcgi_cache_valid 200 1m;
|
fastcgi_cache_valid 200 1m;
|
||||||
fastcgi_cache_bypass $nocache;
|
fastcgi_cache_bypass $nocache;
|
||||||
fastcgi_no_cache $nocache;
|
fastcgi_no_cache $nocache;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
|
||||||
expires max;
|
expires max;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(status|ping)$ {
|
location ~ ^/(status|ping)$ {
|
||||||
include /etc/nginx/fastcgi_params;
|
include /etc/nginx/fastcgi_params;
|
||||||
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
|
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
||||||
allow 127.0.0.1;
|
allow 127.0.0.1;
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -51,13 +51,13 @@ If you are not familiar with Vagrant, have a look at https://www.vagrantup.com/
|
||||||
|
|
||||||
|
|
||||||
To ease development, a Vagrantfile has been included along with a full provisioning profile generated using ansible.
|
To ease development, a Vagrantfile has been included along with a full provisioning profile generated using ansible.
|
||||||
The Vagrantfile is configured to set up a Ubuntu 20.04 box with PHP 7.4 (FPM) and MySQL installed, with a dedicated private IP for accessing the dev environment(http://192.168.50.100).
|
The Vagrantfile is configured to set up a Ubuntu 20.04 box with PHP 7.4 (FPM) and MySQL installed, with a dedicated private IP for accessing the dev environment(http://192.168.56.100).
|
||||||
To set up the development environment, make sure you have Vagrant, Ansible and VirtualBox (https://www.virtualbox.org/) installed, then run::
|
To set up the development environment, make sure you have Vagrant, Ansible and VirtualBox (https://www.virtualbox.org/) installed, then run::
|
||||||
|
|
||||||
vagrant up
|
vagrant up
|
||||||
|
|
||||||
The initial setup may take some time as the virtual machine needs to be provisioned.
|
The initial setup may take some time as the virtual machine needs to be provisioned.
|
||||||
After that, you can access your development environment by navigating to http://192.168.50.100/.
|
After that, you can access your development environment by navigating to http://192.168.56.100/.
|
||||||
The config.php file has been created automatically, but the first time you do need to run through the install wizard.
|
The config.php file has been created automatically, but the first time you do need to run through the install wizard.
|
||||||
|
|
||||||
Code
|
Code
|
||||||
|
|
Loading…
Reference in New Issue