2016-01-25 39 views
0

我已经设置了一个流浪虚拟机,使用ubuntu,php,nginx和mysql来运行wordpress网站。在流浪虚拟机上运行非常慢的Wordpress

该问题是运行非常槽,我通常得到502坏网关错误。我还使用mamp在我的mac中配置了该站点,并且它的速度提高了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配置:

回答

3

尝试增加了虚拟机都可以访问的内存和CPU量:

config.vm.provider "virtualbox" do |v| 
    # Customize the amount of memory on the VM: 
    v.memory = 2048 
    v.cpus = 2 
end 
相关问题