我已经设置了一个带有ubuntu,php,nginx和mysql的流浪虚拟机来运行一个wordpress网站。
问题是运行非常插槽,我通常会遇到502错误的网关错误。我还在mac中使用mamp配置了网站,速度提高了4倍。
有关如何提高虚拟机性能的任何想法?
这是我的nginx配置文件:
server {
listen 80;
server_name {{www_domain}};
root {{www_document_root}};
index index.php;
access_log /var/log/nginx/{{phpmyadmin_domain}}.access.log;
error_log /var/log/nginx/{{phpmyadmin_domain}}.error.log error;
# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
access_log off;
expires max;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_buffer_size 64k;
fastcgi_buffers 16 64k;
}}
这是VagrantFile配置:
答案 0 :(得分:3)
尝试增加VM可以访问的内存和CPU数量:
config.vm.provider "virtualbox" do |v|
# Customize the amount of memory on the VM:
v.memory = 2048
v.cpus = 2
end