When setting up a new wordpress site there might be some things that you can forget, so let’s write them down as a problem-solution.

WordPress requests FTP credentials to install any new theme, plugin.

You might have forgotten to set permissions on your site folder, so you need this command:

sudo chown -R www-data:www-data /var/www/wordpress-site

This will set up the ownership properties, recursively, to all folders and files under this path.

Wordpres Permalinks Not Working

In order to make permalinks to work with wordpress and nginx you need to include in your nginx configuration file

location / {
    try_files $uri $uri/ /index.php;
}

Nginx Error – 413 Request Entity Too Large

Nginx default upload file limit size is 1MB, so in order to increase it you need to alter client_max_body_size property.

client_max_body_size 10M; #Increase upload file site limit to 10MB

An example nginx configuration for your site may be the following:

server {
        listen 80;
        server_name yourdomain.com www.yourdomain.com;
        index index.php;
        root /var/www/wordpress-site;

        client_max_body_size 10M; #Increase upload file site limit to 10MB

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/html;
        }

        location / {
                try_files $uri $uri/ /index.php;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_nam$
                include fastcgi_params;
        }
}

Categorized in:

Tagged in:

,