Tuesday, December 16, 2008

The Final Guide to Wordpress on your Ubuntu LAMP Server

I've gone over all the setup and nit-picky details of setting up my own web server. However, the one thing I could never get quite right was my Wordpress install.  If you peruse the Wordpress (and Ubuntu) user forums, you will see countless examples of people trying to get their permissions set right for one reason or another.  Wordpress recommends, rather irresponsibly, CHMODing everying 777.  To compliment that, you should really find a theme with a large header saying "HACK ME."  The problems range from being unable to upload pictures to having serious trouble with plugins, some of which won't work at all without (again) CHMODing several parts of your Wordpress Install to 777.

I've lived for several months with my blog like this...balancing usability with security, and totally unable to use the "Upgrade Automatically" feature in the plugins page.  If you've setup your own Wordpress Server and worked with plugins much, you know how the process typically goes.  You Upload your plugin to the plugins folder.  Then via terminal, chown -R your new folder to www-data, perhaps chmod 777, depending on the plugin, and then go into your Wordpress Admin page and activate.  Time for an update?  Same process.  Such a pain, with nary a solution in sight... at least that I could find on the forums.

The problem lies with this:  your files are uploaded (via ftp, or whatever) under your Ubuntu user name.  Apache owns web processes under the user name and group www-data.  So when Wordpress tries to work on a folder owned by your username, it gets denied, because it is trying to work with it as www-data.  To fix this, I attempted to add my username to the www-data group, but that was unsuccessful.  And then I discovered the envvars file under /etc/apache2.  In this beautiful file, is the designated Apache username, www-data.  It looks something like this:
envvars - default environment variables for apache2ctl

# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/apache2.pid

Just change the information to match your user name and group for Ubuntu, restart Apache, et voila!  Permissions and Ownership issues are resolved.  Now Apache is working with files under the same ownership and permissions set they were uploaded with.

One important caveat here:  I'm unsure about the security issues with this.  I'm going on the assumption that it is significantly more secure than CHMODing everything 777, and it certainly makes your Ubuntu/Wordpress Web Server much easier to use for upgrade purposes.  Plugins install and upgrade with no hassle now!

Hope this helps all of you with these issues.

Friday, December 12, 2008

Site is Back Up

My server had some plug-in issues...and then some connectivity issues.  But all seems to be well now.  Thanks for your patience.

Wednesday, December 10, 2008

Regrets

It's that time of year again.  The time of year when we all gather together, to eat good food, spend time with family, and think about all the things we regret about our lives.  What?  That's not Christmasy?  Well screw you, this is my blog.

I always chuckle to myself (not the amused chuckle, the "This person is stupider than me chuckle, and although I'm angry, I can revel in my intellectual superiority" chuckle - my wife says I'm arrogant) whenever I see some schmuck on MySpace send around some ridiculous questionnaire bulletin (these are why I use Facebook now) and among the hodge-podge of brain-hemhorraging questions is this one: "What do you regret most?"  To which some little twit is always apt to respond: "I DON'T REGRET ANYTHING I'VE EVER DONE!"  You little sociopathic punk . . . of course you do.  You've just mistaken the deep hatred you feel for yourself as apathy for what others think.  Or perhaps you live in a drunken stupor and believe all the things you've done in life "Totally ROCKED!!! YEAEAAAEAAAHHH!"

There are tons of things I regret.  I regret getting into debt just about as soon as I graduated High School.  I regret going to Bible College and then transferring to a regular one after dropping out complete for a year, and incurring even more debt that way.  I regret that I didn't go to one of the several schools offering me a full-paid scholarship, and majoring in something I would've actually enjoyed doing.  I regret that I didn't switch my major to Pre-Med, and become a Doctor.  I regret not making more friends in school.  I regret making fun of fat people in the mall, even though they couldn't hear me.  I regret quitting a good job for one that only looked better, and ending up poor, and taking my family with me.  I regret not taking all those major decisions before God in prayer, to know His will about things, so that I wouldn't end up regretting them later.

People who purport to have no regrets often use the excuse that even the bad things they've done have made them into the person they are today.  Seriously?  The person you are today is that great?  Sure, some good has come out of many of those things.  And learning from those bad decisions, and their repurcussions, has made me into the person I am today, which is not all that bad.  I've learned to take my decisions to God, and seek His will.  I've learned that debt is really bad.  I've made some good friends in places I wouldn't have been, had I chosen some other path.  But none of that lessens the fact that I truly do regret those things.

I suppose it's human nature to look at your circumstances and consider where you could be today, had you done things differently.  Combine this with the desire to be better, have a better job, make more money . . . all that, and it makes sense to feel that way.  The difficulty is in seeing success, and failure, how God sees them in me, and not how I see it myself.  I've never been too concerned with how the world / people view me.  However, there are things in my life that I consider to be success and failure, and mostly my regrets center around missed opportunities to have an easier, more comfortable life now, and a more enjoyable job.  But the things I enjoy most:  my wife, and children, are always there.  And I have the feeling that even my own conceptions of success are so far from God's, that it's scary.  Especially since I think I'm probably far away from anything resembling "success" in God's book.

Friday, December 5, 2008

Holidays = Awkward Family Time

I'm going to avoid the trite little jokes about how you're forced to spend time with and act interested in people you see once a year.  I'm also going to avoid going on a tirade about the mind-numbing number of churches with some quip about "Thanks-Living" on their oft-abused signs (You already pervert the Gospel, much you also massacre the English Language?). I'm going to bore you with tales about my sun-shiney happy times in Louisiana with estranged family, and force you to like it.  . . because that's what Thanksgiving is all about.

For some reason or another, that I'm sure sounded perfectly reasonable at the time, my mother raised me to resent my father's side of the family.  You would expect this behavior from divorced parents, but mine are happily (now anyway) married.  I'm sure there were some conversations taken out of context, mild offense, blended with the typical awkwardness of "involved" parents and newly-weds learning to flesh out their new relationships.  But for whatever reason, not only was I not allowed to participate in this side of family, I was encouraged to resent the 2 times per year I went to their house.  Opposed to my maternal family, my father's family is one with some attachment to its history and culture.  My Grandfather moved to America during WWII from Germany, and still speaks with a very noticeable accent.  My father himself has been to Germany several times.  But along with this situation, I was also banned from discovering or learning anything to do with Germany.  Other than Hitler . . . because, you know... he's German.

I'm not turning this into a pity-post, just giving the background.  Of course, at some point in my adult-hood, I realized that they probably weren't so bad, and were certainly not the evil cloned spawn of Hitler himself, and made very real and reasonable attempts at building some form of relationship with them.  I made sure to visit if I was in town, staying even after the awkwardness became tangible in the room.  I barely know them, even today, so conversation was . . . fitful, at best.

However at Thanksgiving this year, with, I believe, all of the family in the house for the first time since I was a child, I realized how truly deprived I was.  I have several cousins, some of whom I can't name.  But what struck me was how incredibly similar to them all I was.  My mother's side of the family is filled with typical southerners (no offence . . . not that any of them read this... because only 1 family member knows how to use the internet over there).  I love them all, but am obviously the black sheep.  At Thanksgiving I'm typically the only male to not show up wearing camouflage, straight from a morning hunt.  They've long-since given up trying to convince me to freeze my buttocks off on a deer-stand with them, and now don't bother much with asking about what I've been up to, since they won't really understand anyway.  My lovely and dear Grandmother makes an effort though . . . and that's all anyone can ask.  I have no real friends there, and nothing in common with any of them.

But at my father's family's house (is there a more convenient way to phrase that in type?), I glanced around when I got there (I was told the wrong time to arrive, thanks Opa) and saw nearly every person there surfing the net on a laptop!  People were emailing pictures back and forth to each other.  After catching up a bit, one cousin asked me, "Oh, do you have a facebook account?" and it dawned on me:  these are my people!  Geeks, every last one of them.  Geeks, and strangers.

It's been literally years since I'd seen some of these people, although I once saw a cousin at a shopping mall and didn't recognize her until after I left, I think she still thinks I'm rude.  I've been left wondering if there really is a way to make up for lost time?  I mean, my cousins all seem relatively close, and all enjoy relationships with my grandparents that I am envious of.  But with all those times lost, memories, childhood experiences, the natural bond you form with a grandparent as you grow, can I ever have a similar familiarity with them?  Only a couple of them talked to me there at all.  And who can blame them, I'm not sure I'd act much differently, especially if I believed the only reason was there was out of obligation, and was sure to leave immediately.

So...all of that added together with my arriving late and missing dinner (not my fault), and my subsequently hungry children, made us have to leave sooner than I would've liked.  My daughter loves to play with her cousins at my other grandparents' house, so we spent all day there on Friday, and didn't get to go back.  I'm doubtful that I'll ever truly know any of them.  And that's a shame.  I think we would've been good friends, and had great relationships.