2016-01-25 41 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 
相關問題