Archive for November, 2008

Changing file permissions recursively

November 26th, 2008

I often find myself wanting to both change the owner and file permissions of my web served files. When apache creates new files, the owner becomes www-data, and I can’t manipulate those files directly without changing the ownership to me. Also, apache can’t write to files if they aren’t writable by group. Well. The solution is very simple; I should fix my suPHP installtion. It worked some time ago but no longer. Anyway. The following three commands are a lifesaver.

sudo chown xxx:yyy -R .
find -type f -exec chmod 664 \{\} \;
find -type d -exec chmod 775 \{\} \;

The first one change ownership of files to user xxx group yyy recursively. The second one change permissions of all regular files (not directories) to whatever you want to (664 here). The third one change permissions of all directories. I want my directories to be executable, while I usually don’t want my files to be that. Find handles that for me.

Finally found my CMS

November 26th, 2008

I can’t recall how many times I’ve been wanting to change my homepage. I’ve been looking for the “perfect” CMS to host my pages and tried out all kinds of more or less complete applications available. Well, I think I’ll settle with wordpress. It has, with a few plugins the following features that I require.

  • It should have a blog with a basic WYSIWYG editor and possibility to syntax highlight code.
  • Possibility to easily run custom PHP-code.
  • Upload files for use in blog-posts and in a separate download page.
  • Looks good without too much tweaking.
  • Integrate all above features very tightly.

Ok. WordPress is mainly a blog but it has some CMS features, especially with a few extra plugins. It is however great for a single user.

I prefer to use an already existing solution than writing my own. Also, everything needs to work without too much tweaking. I don’t want the application to break if I ever need to upgrade it because of a security hole.