linux, Technology

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/

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.

Online Living

Friday Features

I’ve been on a bit of sensory overload…what with the financial crisis, the apparently shoe-in victory for Barack Obama, and preparing for a trip to the most magical place on Earth.  However, I’ve found some really useful and interesting things that I’ve been incorporating into my life recently.  I’m a gadget junkie, but even more, I’m addicted to “productivity tools.”  I love simple things that make life easier…even if they’re not all that simple.

For instance, emails and text messages me reminders to pay bills when they’re due, so that I don’t forget them.  Apparently Sandy can do lots of other awesome things…but who has the time to figure this crap out?

And so today, I bring you several things I’ve found useful, and a few not so useful things.

  • Microsoft Live Mesh – this is something that borders on revolutionary . . . but isn’t quite there yet.  (I think that’s Microsofts mission statement -“Almost, sorta, kinda, New and Awesome, but not quite.”)  It’s a “Tech Preview,” which I assume means that it’s actually buggier than Vista on release day.  The remote desktop features don’t work with Mac yet, but the online storage is accessible from a Web Browser.  Basically, this is like DropBox (which I use and love) with social networking features built in.  I can see this being useful in business as well.
  • In the online storage world, I’ve been looking for a solution for backing up pictures online.  I’ve fallen in love with Picasa.  The desktop app is great (way better than iPhoto on Macs) for organizing and doing basic edits.  To me it’s much simpler to use than Flickr, which I still can’t figure out.
    Seriously . . . a lot of these things are supposed to save us time, but it ends up taking more time to work with than it’s worth.  I’m still trying Flickr . . . but I think I’ll be staying with Picasa for now.
  • Ubuntu 8.10 is coming out in 6 days, and has a lot of new usability features built in, with a supposedly much less confusing installation, especially if you are partitioning your hard drive for a dual-boot situation.  I highly recommend.  This website is run off an ubuntu server, by the way.  Check out my series on setting it up.
  • Skype – This is old . . . but I’ve just begun using, and plan on featuring it in a blog about business tech and cost cutting ideas.  It’s a great way to keep up with friends and family who are away…and a great way to save on long distance calls in general ($2.95 per month for unlimited!)

Most of my finds are typically courtesy of Lifehacker.  It’s one of my first reads everyday.  However, Mashable tipped me off to Wigix.  Wigix is awesome, let me say.  It’s like a stock market for things you own or want to buy / sell.  Just like the market, there are buy and sell offers on the table for tons of things, and you can take one (execute) if you want to buy or sell at that price.  If not…put your own buy or sell order out.  As an ex-con -broker, this makes great sense to me, and it’s got an MLM feature with it too.  If you are the first to add an item or category, you make money off all of that product’s sales.  You also make money on referring other people.  So go check it out, and get a good glimpse at the ground floor of the company that will destroy eBay.

linux, Technology

Server Headaches

Over the last… oh… 8 months or so, I’ve been casually putting together a LAMP server to host my blog and personal website on, and give myself access to files from work, etc.  Last week, I believed I had it reasonably prepared for entrance into the World Wide Web.  My CPU then jumped up, slapped me in the face, called me a B!%^#, and attempted to destroy my server.
I forwarded my ports, and nothing worked.  So I decided to go editing config files for Apache.  That was all well and good, until I really screwed something up . . . not sure what.  This led me to uninstall my server programs: Apache, MySQL, PHP, and supporting modules.  I attempted to reinstall, but the computer flipped out everytime.
Several reboots, and some manual file cleaning later, I just wiped the hard drive and resinstalled Ubuntu.  Their sudo tasksel command, which I learned during this process, made the reinstallation of the LAMP server super easy and quick.  I had a little trouble using phpMyAdmin, until I linked it to my /var/www folder, reinstalled WordPress, et voila!  Back where I started.  With ports forwarded, I was still unable to access the server from the web.  I noticed later that I was connected to the IP for my modem, not the USABLE IP assigned to me by my ISP.  I must be honest:  I have no idea what that means.  Hopefully I’ll get the opportunity to call tech support and have them walk me through what to do with those IP addresses.
Anyone know if Apache should be configured past its initial installtion?  Is the server ready to go as soon as the IP address route properly, or do I need to configure apache for my domain?
All of this has led me down a very interesting chain of ideas.  In the coming months, I have a new website that should be launching, and I’m pretty excited about the idea.  It will hopefully be different from other things you’ve been seeing.


Ubuntu 8.04 Coming Soon!

I’m not a fan of Microsoft. I loved my old Apple Powerbook, but got rid of it awhile back, and hope to get a new Apple MacBook Pro some day soon. In the meantime, though, I’ve fallen in love with Ubuntu. I’ve played with Linux distros for 5 or 6 years now, and Ubuntu is the first I’ve seen that truly gives that polished, pretty, Consumer GUI feel that Mac or Windows does.
And I’m geeking out over the new version of Ubuntu being released in just 3 short days! I’ve been playing with creating my own LAMP server for several months for hosting this very blog, and even wrote about it at my blog’s old homepage (which is, by the way, where you can read my older stuff). Although I haven’t found the time or the patience to learn how to finish my setup, I plan to one day. 🙂
Even if you think Windows is the best thing in the world, I strongly encourage you to give Ubuntu 8.04 a try. This is first linux brand that I heartily recommend to non-ubergeeks. Even my wife uses Ubuntu with great ease. It’s secure, stable, and FREE! You can’t beat free, in my experience.