Categories
Linux Solutions Ubuntu Web

WordPress: Error Uploading Media Files

I recently got the following error while uploading media to my wordpress site:

Unable to create directory uploads/2016/06. Is its parent directory writable by the server?

Here are the steps to fix the issue:

  • Possible Issue 1: Incorrect Directory pointed to in the settings:
    • Open your WordPress Admin page (this is usually at /wp-admin)
    • Hover over the sidebar menu “Settings” and then click on “Media
    • Check the section “Uploading Files“(If this section is missing then try the next solution)
    • check the value for “Store Uploads in This Folder
    • Most commonly the value should be “wp-content/uploads“, if not is should be pointing to the correct folder on the server. My setup had it pointing to the wrong directory with the wrong permissions.
  • Possible Issue 2: Wrong permissions
    • Login to your server via ssh or ftp
    • Traverse to the installation folder of the WordPress site
    • Check and see if the user:group settings are correct (Usually for UNIX systems its www-data:www-data)
    • If that is fine look at the permissions for the ‘uploads‘ directory and its sub directories
    • running a command ‘ls -l uploads‘, will give you the permissions set
    • The ideal permission is of 755. For this run the command “chmod -r 755 uploads

Hopefully that will solve your problems.

Categories
Linux Open Source Solutions Web

Using Static IP Address On Ubuntu



By default most unix boxes now come with dynamic IP enabled for all its networking needs. This is a very useful configuration but at times it helps to know that a system’s IP will remain the same no matter what changes occur around it. A classic example of this case can be a server.

In any case if you want to change your unix box to use static IP the following simple steps will get your task done:

Categories
Linux Open Source Solutions Web

Fixing WiFi regulatory rule in Unix

Wifi routers usually specify the regulatory rules for all devices connected to their network. In rare cases a router may go rouge and specify the wrong regulatory domain, which might effect the quality of the connection and at times may make the network unreachable even if the network says that its connected.

Below are the debug messages from the command “dmesg” in one such case:

Categories
Linux Solutions

Compressing files in Linux & Unix – Cheat Sheet

Here is a quick cheat-sheet on How To Compress files in Linux & Unix

Zip
zip archive file1 file2 file3
Compresses file1 file2 file3 into an achive with filename archive.zip

zip archive *
Compresses all files in the current directory into an achive with filename archive.zip

zip -r archive dir
Compresses the directory dir(and its subdirectories) into an achive with filename archive.zip

unzip archive.zip
Uncompresses the archive archive.zip to the current directory

unzip archive.zip -d dir
Uncompresses the archive archive.zip to the directory dir

Categories
Solutions

Sorting Text Files

The sort command is an handy tool to sort text files in linux. Its very simple and easy to use.

Lets say we want to sort the following file with the file name sorttest: