WordPress vs. DSO & APC

I’ve put off writing this post for a while now, partially because I’m still not sure that I understand it and partially to make sure that my “fixes” that I’ve put into place actually work! 🙄

So about a year ago I started having issues with the server that runs all of my websites running over-utilized. It was a big, nasty affair that we had a hard time tracking down, on top of being a nightmare because we were supposed to be celebrating my birthday over at Disney after having just started our second round of IVF with the embryo which would eventually become Christopher … needless to say, it was VERY stressful!

After we got things back up and running again, I spent about a week researching how to make sure that it never happened again and one thing that I dove heavy into was caching. There are some plugins that are decent, but you can also do caching at the server level on top of all that and this is where I met my new friend, APC

Now, the good thing about my friend APC is that it’s extremely efficient at what it does – like, it’s one of the best PHP accelerators you can run. Facebook uses it, which sometimes you wouldn’t know, but still, even I can’t deny that they’ve got a fuckton more users than I’ll ever have, so I’ll take their word for it! 8)

Of course, the bad thing about APC is that you have to change the way that PHP runs on your server to enable it … or at least I did. And that’s where the problems began…

Normally most shared environments will run under the SuPHP handler because it’s secure in the way it runs scripts under the users that actually own them. For WordPress, this makes permissions simple because everything just works right out of the box as it always has for me for the past blorgteen years.

Now to run APC, however, I needed to switch over to DSO, which from a security standpoint didn’t seem like a big deal because I run on a VPS, not a shared server now, so there’s not really any risk of “other users” running anything on my machine because there simply aren’t any.

That said, what DSO does do is royally hose up permissions in WordPress because the settings that it needs to upload images, edit themes, update plugins, etc… don’t work because now the web server runs as a separate user (“nobody”) instead of whatever user happens to own the files that it’s trying to execute.

…SOOOOOO…

I finally decided to spend some time digging in to fix this. For a few months, I actually did this very much the wrong way by chmodding the uploads folders of the main sites I was using at the time to 777 … which is bad, so don’t do that!!!

Instead, it seems that the solution wasn’t too crazy after all – to fix the file uploads, I just did a chown -R nobody:nobody uploads and that cascaded the new ownership recursively through all of the subfolders … no need to change any actual permissions, except to change them back from 777, anyways!

I was also able to do this for my Disney site that runs NextGEN Gallery and the results were the same (sorry, can’t remember the specific folder, but it’s in there somewhere!).

Now as for plugins and theme updates, this got a little trickier because I tried the same above and that didn’t seem to work, and I really didn’t want to open up permissions on these folders … even though there’s apparently a way to mask them back to normal by inserting something like these into your wp-config.php file:

define('FS_CHMOD_FILE', 0755);
define('FS_CHMOD_DIR', 0644);

Instead, I inserted these into my wp-config.php file…

define('FTP_HOST', 'localhost');
define('FTP_USER', 'username');
define('FTP_PASS', 'password');

You may have noticed as I did many times throughout this ordeal that if WordPress tries to make an update, but can’t because it doesn’t have the right permissions, it will jump to a screen asking for FTP credentials and then make the changes it wants to do via FTP instead. For the longest time I just entered these manually out of frustration, but now that I think I’ve settled on as close to a “solution” for this as I can get, the above three lines prevent it from prompting me for credentials and I’m now able to install, update, and delete plugins and themes from within WordPress just as if I was running under SuPHP!

Admittedly, I am a little curious to know if there are any other security flaws with having some folders owned by nobody, but from what I can tell it’s still feasible and loads safer than 777. And I get to keep running APC, which I’ve now thrown enough memory at to keep roughly 99% of the php files from all of my sites caching out of system memory instead of parsing off the disk, so that’s a nice little speed improvement that you may have noticed around here!

…but if you do know something I should know about setting up permissions and ownership this way, do be a good samaritan and let me know, though, would ya? Right now I’m cautiously content … so take that for what you will… 😕

a healthy blog post thing for … 2014?

So I’ve been thinking about weight loss stuff again over the past couple of days…

Yeah, it’s been a while! 😯

I don’t know … maybe it’s the 5 pounds less that I weighed in on the scale yesterday – mostly on account of being sick for the past week and a half, but this topic has been on my mind yet again and I think I want to talk about it. And this is going to seem odd because despite this big, old blog just recently passing 800,000 words, in the last couple of years I’ve kind of steered clear of talking about weight loss and dieting efforts – frankly, I think, because I did so much of it early on and it feels a little embarrassing to keep writing the same stuff over and over again.

It’s true that a lot of what I’m going to write is probably stuff I’ve said already, but who knows – maybe I’m finally in a better place to actually be able to do something about it.

In a way, there’s a lot to be learned in looking back at those failed attempts. One high level thing that I noticed just now is that for each time that I fell off the wagon, it was easy to cite some big thing that had just happened that threw us all for a loop – got married, got a puppy, got a house, dealing with pregnancy stuff – and the funny thing is, despite having the mother of all excuses to be thrown just down the hall from me, thankfully sleeping soundly at this very moment, I guess that almost-34-year-old Scott has learned that … there’s always going to be something to throw you off your game…

For the next few years it will be baby, or maybe even another baby, and then school, then teenagers, then high school … holy cow, how did this turn into a post that whipped through the next twenty years of my life in the better part of a sentence?!  😯

I think the takeaway from it all is just what I’ve said before – I need to find a way to maintain a healthy diet that fits with my day-to-day life because if big chunks of time were only sporadically available in my 20’s, I can tell already midway through that my 30’s aren’t looking any better and I don’t even want to think about the decades after that!

The funny thing is, despite my existence feeling kind of topsy-turvy right now with the introduction of a new human to care for, at the same time this is kind of perfect timing to start making some changes like this in my life for the better. My current work arrangements after the baby was born have had me working from home almost exclusively, which means that in both a bad way and a good way, the refrigerator is only a 15-second walk away from me at any point during my day.

What this should mean in the positive way is that instead of eating whatever I can scarf down in the car on the drive in for breakfast, there’s really no reason I shouldn’t be eating something simple and delicious like a quick omelette or some scrambled eggs and juice every single morning.

photo

And for lunch, not having questionable cafeteria food within walking distance (and super good, 400-calorie cookies…) and tons more fast food options a quick drive away, there’s really no reason I shouldn’t be throwing together the types of lunches that I always avoided taking to work – sandwiches that would get soggy sitting in the fridge, pretty much anything not frozen for simplicity’s sake.

Snacks can be healthy stuff like fruits and vegetables that I don’t have to carefully portion out in the morning when I’m already running late.

My tea can … well, there’s really not much different about the tea because that’s where I actually started drinking it in the first place, but I can start that again, too!

And that’s all just food!!!

I’m not going to ramble here incessantly because just like the changes I want to make, I’ve been reading a lot of posts that remind me that it’s small, consistent changes over time that will really make the difference in the long haul, so that’s what I want to do. Long term, I’d love to see a slightly more photogenic me by Christmastime so that I don’t have to be as crop-happy when choosing which family photos to post as I have been lately; in the short term, while I’m still trying to get over this sick stuff, I think I’m going to start making some small tweaks here and there and we’ll see what happens.

I’m sure we’ll talk again soon! 😉

movie thoughts … The Secret Life of Walter Mitty

MV5BODYwNDYxNDk1Nl5BMl5BanBnXkFtZTgwOTAwMTk2MDE@._V1_SX214_AL_[1]I’ve been wanting to see this movie for a while, but the wife didn’t want to. We finally sat down for a few quiet hours together and she gave it the ok promptly before falling asleep for roughly 85% of the movie, but whatever – welcome to married life… 😛

I actually really liked this movie, though!

If we’re being honest, and I see no reason why we wouldn’t be, the only part that didn’t really jive with me was Walter’s daydreams because sometimes they got a little too in depth for me … I can appreciate the concept that they were going for, but like when he had the battle with the new jerky boss guy, it more reminded me of one of those chicken fights from Family Guy than anything that fit the feeling of this movie.

It’s interesting to read the development notes on Wikipedia to see not only just how long it took them to actually get around to making this movie (1994?!), but also how much comedy is actually intended. I’ve never seen the original, circa 1947, but apparently it’s a very satirical story the first time around, whereas I rather enjoyed this as more of a dramatic adventure of a man who finally figures out that life has more to offer him than the plain and ordinary.

Also, not for nothing but I couldn’t picture any of the earlier actors slated for this role doing it any justice. Jim Carrey? Owen Wilson?? Borat?! 😕

All in all, I think the reason this movie kind of struck a chord with me was in a not trying to sound depressing-sort of way, in a lot of ways I could kind of see parts of my life today in the life that Walter Mitty played on screen. You work your job, day in and day out, and you do all of the things that you’re supposed to do, and one day you’ve been there for 15 years and suddenly you have to worry about randomly getting fired. I think a lot of people can relate to that story because you sort of hit a point in your life when you look around and think, “What have I really done with it all???”

Which is why I’ve also got this post flagged as a creative-type post because after watching this movie, I came up with what I think is a neat little project that I’d like to put together inspired by this movie. I don’t want to share too much just yet because it’s honestly going to take me a while to pull together – not necessarily time-wise, but more so because I need to spend some time going through old memento, a lot of which are up in Michigan that I don’t have easy access to right now.

Believe me, if I did I’d probably just stay up all night to do it tonight because I’m that excited and I don’t often have neat, little projects that are both this in depth without also requiring an ongoing commitment that I’ll have to figure out how to schedule later!

So look forward to that … I don’t know, sometime after the next time I get a vacation up north? I don’t know – we’ll see… 😉

But I really did enjoy this movie, and it made me do a lot of thinking about accomplishments and bucket lists and I guess just doing things each day that you’d actually be proud to look back on doing years and decades after the fact. Everyday life tends to be exactly that, but I don’t necessarily think that it has to be, and this movie was a quaint reminder that life is happening out there whether you go out and pursue it for yourself or not.

So why not?

🙂

iPhone Self-Repair Fail

A couple of months ago, the lock button on my iPhone stopped working.

Only having a few actual buttons on the phone, you don’t really realize how much you use something until you no longer have it. In this case, it never quite dawned on me that any time I go to set down my phone or put it back in my pocket, I hit that button first to prevent myself from accidentally butt dialing someone or playing a very unaware game of Angry Birds in my pocket.

There is a workaround where you can turn on AssistiveTouch that basically gives you a new menu with all of the physical actions you would normally do with your phone, but it’s kind of a pain in the ass and it now takes me three taps to lock my phone whereas before I could lock it as it was going into my pocket without a second thought.

Admittedly the phone is getting pretty old – I got it as a warranty replacement just inside of my first year, so even this device is 2.5 years old at this point. Unfortunately, my wife’s phone is still the original, making hers 3.5 years old and it’s kind of hard for me to run off and get mine replaced at the first sign of trouble when hers has had random issues (out of warranty) and we haven’t done anything about them yet…

😛

So anyways, I thought I’d try my hand at fixing the thing myself. I replaced a hard drive in one of my old iPods very long ago, so how bad could it be, right?!

iphone_open

As it turns out, iPhones are really complicated on the inside and all of the parts are extraordinarily tiny!!!

I first tried this video that talked about inserting a piece of paper where the button sits, and then even this video that shows how to locate and activate the button with a needle, but after about an hour of frustration, several scraps of paper, and one broken needle, I still can’t seem to find the stupid thing and I’m not about to pull out every last component like some other videos have shown.

It looks like it’ll probably finally be time for us to upgrade to new phones when the iPhone 6 comes out … presumably in just a few months??? 😕

I don’t want to be about politics.

I think I’m going in the wrong direction. Sort of.

I’ve gotten into a couple of big discussions/arguments on Facebook recently, and when I look back at them, not only are they eating up chunks of time that I could be using for anything else, but I don’t really think that they’re helping to move the needle in either direction, either.

This post is an elaboration of a tweet I posted earlier:

The problem I have is, I do feel like politics in general has become more relevant and important to me as I’ve gotten older … and yet whenever I try to have a discussion about it with anyone who doesn’t agree with me, I get very angsty and angry and regretful afterwards, usually wishing that I hadn’t even brought the thing up in the first place. And don’t get me wrong – I still think that both issues are very important in today’s world (#1 was the Hobby Lobby/contraceptive ruling, #2 was climate change denial in the media), but when I look back at the end of my day, I want to be content about what I did that day and spending hours upon hours arguing with my conservative relatives over things they’ve been arguing about their entire lives somehow doesn’t seem nearly as rewarding as hey, that thing you shared last night was pretty funny!

I originally posted that tweet above as kind of a joke,  but the more I think about it, the more this is something that I think I need to work on. Because as much as I’d like to change the world through social issues and science comprehension, I think I’ve personally got a better chance at doing it with funny jokes. That’s just me. 😉

So with that said, here’s some random stuff that I’ve recent found funny from around the Internet…

  1. Man Creates a Kickstarter to Make Delicious Potato Salad
  2. ClickHole (yes, the whole site)
  3. Independence Day Letter to America From the British
  4. Steve Hofstetter Gets a Heckler’s Girlfriend to Ditch Him
  5. Chainsawsuit – The Slope and How to Slip It

Hey, we almost made it through the list! I suppose when politics and humor clash, we’re just going to have to err on the side of humor and take it one step at a time… 😛

An Independence Day Note, from the other side of the pond…

I tried to do some digging on this thing to figure out its origin … at one point it sounded a lot like a John Cleese bit, but Snopes said no … so I think it might be as old as those funny forwards that we used to spam each other’s inboxes with before all of this other social media lunacy came about.

I think #7 is my favorite – I’d be perfectly fine with strong legislation with regards to vegetable peelers… 😉

Notice of the revocation of US Declaration of Independence 

To the citizens of the United States of America, in the light of your failure to 
elect a competent President of the USA and thus to govern yourselves, we hereby 
give notice of the revocation of your independence, effective today. Her 
Sovereign Majesty Queen Elizabeth II will resume monarchical duties over all 
states, commonwealths and other territories – except for Utah, a Mormon state, 
which she does not fancy. 

Your new prime minister (The Right Honourable Tony Blair, MP for the 97.85% of 
you who have until now been unaware that there is a world outside your borders) 
will appoint a minister for America without the need for further elections. 
Congress and the Senate will be disbanded. A questionnaire will be circulated 
next year to determine whether any of you noticed. 

To aid in your transition to a British Crown Dependency, the following rules are 
introduced with immediate effect: 

1. You should look up ‘revocation’ in the Oxford English Dictionary. Then look 
up ‘aluminium’. Check the pronunciation guide. You will be amazed at just how 
wrongly you have been pronouncing it. The letter ‘U’ will be reinstated in words 
such as ‘favour’ and ‘neighbour’. Skipping the letter ‘U’ is nothing more than 
laziness on your part. Similarly you will learn to spell ‘doughnut’ without 
skipping half the letters. You will end yourlove affair with the letter ‘Z’ 
(pronounced ‘zed’, not ‘zee’) and the suffix ‘ize’ will be replaced by the 
suffix ‘ise’. You will learn that the suffix ‘burgh’ is pronounced ‘burra’ – 
e.g. Edinburgh. You are welcome to respell Pittsburgh as ‘Pittsberg’ if you 
can’t cope with correct pronunciation. Generally, you should raise your 
vocabulary to acceptable levels. Look up ‘vocabulary’. 

Using the same twenty seven words interspersed with filler noises such as 
“like” and “you know” is an unacceptable and inefficient 
form of communication. Look up ‘interspersed’. There will be no more ‘bleeps’ in 
the Jerry Springer show. If you’re not old enough to cope with bad language then 
you shouldn’t have chat shows. When you learn to develop your vocabulary then 
you won’t have to use bad language as often. 

2. There is no such thing as “US English” and we will let Microsoft 
know on your behalf. The Microsoft spell-checker will be adjusted to take 
account of the reinstated letter ‘u’ and the elimination of ‘-ize’. 

3. You will learn to distinguish the English and Australian accents. It really 
isn’t that hard. English accents are not limited to cockney, upper-class twit or 
Mancunian – ‘Daphne’ in ‘Frasier’. You will also have to learn how to understand 
regional accents – Scottish dramas such as Taggart will no longer be broadcast 
with subtitles. While we’re talking about regions, you must learn that there is 
no such place as Devonshire in England. The name of the county is Devon. If you 
persist in calling it Devonshire, all American States will become shires – 
Texasshire, Floridashire, Louisianashire. 

4. Hollywood will be required at least occasionally to cast English actors as 
the good guys. Hollywood will be required to cast English actors to play English 
characters. British sit-coms such as ‘Men Behaving Badly’ or ‘Red Dwarf’ will 
not be re-cast and watered down for a wishy-washy American audience who can’t 
cope with the humour of occasional political incorrectness. 

5. You should relearn your original national anthem, ‘God Save The Queen’ but 
only after fully carrying out task. We would not want you to get confused and 
give up half way through. 

6. You will stop playing American football. There is only one kind of football. 
What you refer to as American football is not a very good game. The 2.15% of you 
who are aware that there is a world outside your borders may have noticed that 
no one else plays American football. You will no longer be allowed to play it 
and should instead play proper football. Initially, it would be better if you 
played with the girls. It is a difficult game. 

Those of you brave enough will, in time, be allowed to play rugby which is 
similar to American “football” but does not involve stopping for a 
rest every twenty seconds or wearing full kevlar body armour like nancies. We 
are hoping to get together at least a US Rugby sevens side by 2007. 

You will stop playing baseball. It is not reasonable to host an event called the 
‘World Series’ for a game which is not played outside of America. Since only 
2.15% of you are aware that there is a world beyond your borders, your error is 
understandable. Instead of baseball, you will be allowed to play a girls’ game 
called rounders which is baseball without fancy team strip, oversized gloves, 
collector cards or hotdogs. 

7. You will no longer be allowed to own or carry guns. You will no longer be 
allowed to own or carry anything more dangerous in public than a vegetable 
peeler. Because we don’t believe you are sensible enough to handle potentially 
dangerous items you will require a permit if you wish to carry a vegetable 
peeler in public. 

8. July 4th is no longer a public holiday. November 2nd will be a new national 
holiday but only in England. It will be called Indecisive Day. 

9. All American cars are hereby banned. They are rubbish and it is all for your 
own good. When we show you German cars, you will understand what we mean. All 
road intersections will be replaced with roundabouts. You will start driving on 
the left with immediate effect. At the same time you will go metric with 
immediate effect and conversion tables. Roundabouts and metrication will help 
you understand the British sense of humour. 

10. You will learn to make real chips. Those things you call French fries are 
not real chips. Fries aren’t even French, they are Belgian, though 97.85% of you 
(including the guy who discovered fries while in Europe) are not aware of a 
country called Belgium. Those things you insist on calling potato chips are 
properly called crisps. Real chips are thick cut and fried in animal fat. The 
traditional accompaniment to chips is beer, which should be served warm and 
flat. Waitresses will be trained to be more aggressive with customers. 

11. As a sign of penance 5 grams of sea salt per cup will be added to all tea 
made within the Commonwealth of Massachusetts, this quantity to be doubled for 
tea made within the city of Boston itself. 

12. The cold tasteless stuff you insist on calling beer is not actually beer at 
all – it is lager. From November 1st only proper British Bitter will be referred 
to as beer and European brews of known and accepted provenance will be referred 
to as Lager. The substances formerly known as American Beer will henceforth be 
referred to as Near-Frozen Knat’s Urine with the exception of the product of the 
American Budweiser company whose product will be referred to as Weak Near-Frozen 
Knat’s Urine. This will allow true Budweiser – as manufactured for the last 1000 
years in Pilsen, Czech Republic – to be sold without risk of confusion. 

13. From November 10th the UK will harmonise petrol (or gasoline as you will be 
permitted to keep calling it until April 1st 2005) prices with the former USA. 
The UK will harmonise its prices to those of the former USA and the Former USA 
will, in return, adopt UK petrol prices (roughly $6/US gallon – get used to it). 

14. You will learn to resolve personal issues without using guns, lawyers or 
therapists. The fact that you need so many lawyers and therapists shows that 
you’re not adult enough to be independent. Guns should only be handled by 
adults. If you’re not adult enough to sort things out without suing someone or 
speaking to a therapist then you’re not grown up enough to handle a gun. 

15. *Please* tell us who killed JFK. It’s been driving us crazy. 

16. Tax collectors from Her Majesty’s Government will be with you shortly to 
ensure the acquisition of all revenues due (backdated to 1776).