I’ve had problems with permalinks in the past on Ubuntu and always forget one thing or other so here is a set of instructions on setting up those pesky permalinks. This is what I have done in past but if you can think of anything else, please let me know.
1. Create a new “.htaccess” file in your root WordPress directory.
2. Enabling mod_write in the Apache2 server. Type:
sudo a2enmod rewrite
3. Open a terminal and type:
sudo chown -v :www-data “/
4. Also give write access to the file:
sudo chmod -v 664 “/
5. Restart the Apache:
sudo /etc/init.d/apache2 restart
We are all done with the command line prompt; you can close the command line window now.
5. Go into your WordPress admin screen. Click on settings, then on permalinks and select whichever permalink layout you wish. Hit Save button.