The first thing one should check is if the file .htaccess exists in the root directory of the site (/var/www/html in my case). The root directory of your site should contain a file index.php, in the same folder there should be the file .htaccess. WordPress uses this file to manipulate how Apache serves files from its root directory, and subdirectories thereof. Most notably, WP modifies this file to be able to handle pretty permalinks.
For a basic WordPress Site .htaccess should look like this
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
If this file is present you should check that the right user owns and has the proper permissions to write the file. See here.
Thank you! Worked like a charm.