Since I use an Amazon EC2 Microinstance to host this blog and I noticed I had no favicon appearing (which is a bad thing) I thought I might as well make one and pop it up.
I took my usual avatar (Jiraya, the “Pervy Sage” from Naruto) and just let someone else do the hard work for me, uploading it to FavICO.com instead of even bothering to download an app to do it.
Then I opened up WinSCP and used my EC2 ppk to authenticate with my EC2 instance, took that favicon.ico file and tried to upload it to /var/www/html (the default website root if you install wordpress) only to receive the error:
Hmmm.
If you check the permissions on that folder (“stat /var/www” via SSH) you’ll see that it’s owned by the “root” group; since you’re logging on as ec2-user you’re not a member of that group.
Your options, according to the internet, appear to be;
- Add root as a password-less logon (ugh!)
- Set and reset the permissions on the /var/www folder (what?!)
- Or something equally tricksy/mental, like add ec2-user to the root group
The solution I found was much easier.
- Upload the favicon to the ec2-user home directory via WinSCP
- Move (mv) the favicon from the ec2-user directory to /var/www via SSH using “sudo” to get the necessary permissions
Easy.