Showing newest posts with label system-administration. Show older posts
Showing newest posts with label system-administration. Show older posts

7.08.2009

Ubuntu Add/Remove Program List Empty

For future personal reference (and maybe others as well), installing Adobe Air tends to break the Add Remove app in Ubuntu.  Here's the solution, in a terminal, if you will.




Code:

sudo apt-get --reinstall install gnome-app-install

read more...

1.30.2009

How good system administration is like new underwear

I can't remember the last time I bought my own underwear.  I may not have EVER bought any for myself.  Each Christmas, there's typically a few new pairs of boxers under the tree with my name on them.  Well, more precisely, my name is on the wrapping paper that the underwear come in, not actually on the boxers themselves (because I'm either too old now or much too young to have people labeling my clothes for me).

But I never have to worry about underwear.  There's an unseen process chugging along that keeps my clothes drawers replenished with fresh undergarments.  It's a constant.  The underwear is just there and it just works.

Good quality system administration is like new underwear because it's a constant, it's just there, and it just works.

If the development team is worried about placating the system administration team or if the dev team constantly has to work around various odd limitations in the system, then you're system administration is not like new underwear at all.  It's like a sock that has holes.

You don't want to worry when you put on your socks in the morning that your big toe might shoot out of your sock into the cold morning air, right?  Is there a more uncomfortable feeling?  Similarly, you don't want to launch your new app and have to cross your fingers that the database is going to hold up.  (Perhaps I'm starting to mix metaphors here with all the underwear and socks talk)

But my point is this... When your dev team has to worry about the system administration, they're going to spend more time talking about and coming up with solutions to issues that could probably be addressed by more robust system administration.  That makes your programming projects take longer.  And that's costing you money.  Real countable money.

So get yourself a good admin.  Pay them wisely.  Give them new toys to play with.  And never worry about your underwear again.

.
read more...

12.20.2008

Google Adsense and Google Analytics may be blocked by McAfee

I can't confirm what's going on but I believe that at least McAfee and maybe other firewall appliance providers recently starting blocking googlesyndication.com in the software of their appliances.  It started happening at work this week where all of a sudden Google Adsense and parts of Google Analytics were unavailable to us.  When I traced it, it was all requests to *.googlesyndication.com, mostly pagead2.googlesyndication.com.  Once we created an entry within our McAfee appliances to allow those addresses through, everything went back to normal.  YMMV.

.
read more...

12.15.2008

Development Environment layout using Linux, Apache, PHP, and Subversion

Some of the age old questions I face lately are:
  • What's for dinner?

  • Should I accept that friend request on Facebook for the friend of a friend of a friend that I knew 15 years ago?
  • What's the best development and test environment layouts for PHP using Apache as a web server with Subversion for version control for multiple developers?

Some of you may be asking yourselves the same questions.  The choice of dinner is a personal one.  I won't go into that except to say that everyone loves a good burrito.  Spicy!  And you probably don't care about my take on Facebook etiquette since your friends list probably dwarfs mine.

But I do have some definite thoughts on the layout of development environments.  And I find that there's a huge lack of information about this on the interweb, so here you go.

We use Linux, Apache, PHP, and subversion in our development environment and so these instructions will be biased towards these topics but I think you can apply this method using various other technologies.

I like to give each developer their own development web site and development database.  I find it's easier for everyone to have their own individual sandbox to play in.  We give them each their own domain using their initials, something like rzdev.domain.com for me and vbdev.domain.com for another developer, Vinny Bag-o-Donuts.  We set the Apache directories up on the Linux dev box in a similar fashion:

/var/www/rzdev.domain.com/
/var/www/vbdev.domain.com/


This has a few benefits.  If I need to show Vinny something with my site development, I can just send him the link to http://rzdev.domain.com/broken-page.  I can make changes to code, even major infrastructure code and not break anything for the other developers.  We do the same thing with the databases, prefacing them with our initials.

Now, since our dev boxes use Linux, we set up Samba for sharing on these web directories.  This means that all the devs can edit files and use source code management on the Linux server itself or on their Windows machines (we use either Eclipse or Zend Studio and create projects on the shares, that's a whole different posting!).

This dev site layout is closely linked to the way we use Subversion for version control.  When we start a new site or application, if we can split out the development evenly enough, we'll just have everyone work from the trunk version of the code, with each developer working on their own little section. Each developer puts the trunk in their Apache dir and we edit the Apache configs to reflect this:

/var/www/rzdev.domain.com/trunk/
/var/www/vbdev.domain.com/trunk/


The root of the dev sites typically look like this:

/var/www/rzdev.domain.com/trunk/docs ( your Apache document root )
/var/www/rzdev.domain.com/trunk/lib ( non-public PHP library code )

When we commit code changes in Subversion, we have a hook that updates our main development site here:

/var/www/dev.domain.com/trunk

Again, that site can be seen on the web at http://dev.domain.com/  This way, we can do integration testing on our code to make sure our new code doesn't break code from someone else within the dev site.

Now, the important thing here is that the Quality Assurance (QA) and Testing people ( if you're lucky enough to have them ), don't use any of these previously mentioned sites for their testing.  Why not?  Well, because if they're doing a good job and are therefore sufficiently anal, they're going to complain when code is changing on the site they're looking at.

So we give them their own test site and database that's viewed on the web at http://test.domain.com/ and setup in apache at:

/var/www/test.domain.com/trunk/docs
/var/www/test.domain.com/trunk/lib

The developers will meet and create the list of files and database changes that get moved over to the test site.  How the actual moving is done doesn't really matter.  If you have the time and energy to set up some Ant or Phing tasks, that works great.  But copying/rsyncing files and running some SQL on the test database works just as well.  The most important part is that the developers meet to decide which part can go to test.  Otherwise, you could have code going to test and eventually production that might not be fully vetted.

When QA finds bugs in test.domain.com, they can send them to the developers.  The developers can instantly start working on fixing the bugs in their own dev space at rzdev.domain.com and not affect the other developers or the ongoing testing of the application.  Pretty nice right?

Advantages of this approach
  • Uses source code management
  • Developers can unit test their own code
  • Developers can do integration testing between each other's code
  • Developer A typically doesn't destroy code or data that developer B is using
  • Developers don't destroy code or data that QA/testing is looking at
  • Developers can both edit files and use source code management in either Linux or Windows environment
  • Very scalable.  Adding new developers into the mix is as simple as adding their respective sub domains and databases (of course, this can also be viewed as a disadvantage, see below)
  • Less bugs make it to production

Disadvantages
  • Lots of sysadmin overhead initially and with each subsequent domain added.  You have to set up all those developer sites, rzdev, vbdev, etc.  Same overhead when using branching within subversion.  Plus, you have to setup all those databases and setup the config code to connect to the appropriate database for each developer domain.
  • Lots of file space for all the sites and databases.
  • Confusing for lone wolf and gunslinger developers who are used to overwriting production or each other's development code (too bad for them!)

So what do you think?  How do you setup YOUR PHP development environment?

..
read more...

6.20.2008

Firefox 3 is my panacea

So one of my biggest technological hurdles has been overcome, I can finally switch folders in gmail since I upgraded to Firefox 3.  Sounds small, I know, but I was one of the few afflicted by this weird bug on both my work and home machine.  And I got to use the word "panacea" in a grammatically correct title.  Ahh, life is good.
read more...

2.18.2008

Using Subversion externals property for WordPress upgrades

I find that upgrading apps like WordPress, Drupal, Symfony and open source PHP apps is simple for less complicated environments, but once you start adding in things like new directories, custom themes/modules, source code control as well as separate development, test, and production systems, the upgrades start to get pretty hairy.

Take WordPress for example. A typical upgrade of WordPress involves copying the new WordPress files over your existing files. Then you have to copy back safe versions of things like wp-config.php, .htaccess (if you're using it), as well as any custom themes/modules from the wp-content/ directory. Not to mention any of your own directories that should exist alongside your wp-includes/ and wp-content/ directories. After that you can run the upgrade.php file.

These upgrade steps aren't terrible. They're quite a bit better then most open source apps out there but they still suffer from a few problems:
  1. If you have your code, including your WordPress install, in Subversion or another source code control system, you have to commit all the files that change with each WordPress version. There may be files added, deleted, etc. You'll have to keep combing thru "svn status" messages to figure out everything you need to do to get all the WordPress files into your repository. This can be painful. And take a long time.
  2. WordPress is specifically written so that you don't ever have to muck with the guts of it. You create themes and plugins for added functionality. So, since you're not maintaining the code that powers WordPress, do you really need all those deltas in your Subversion repository? I think not.
  3. What do you do with your own code in directories that sits alongside wp-includes/? What if it’s in a Subversion repo?

The WordPress site also has instructions for using Subversion with your site. Here, they advocate the use of “svn switch” to update your site. This is much more manageable and solves a few of the above problems. Most svn users can probably can get away with this method. But unfortunately not me.

I have additional directories on some of my sites that I need to add into my WordPress install. So I have to copy/move them into the WordPress dirs which gets tough. And then my “svn status” will get all wonky because my WordPress dir is under one repo and my code is under another. This was endlessly confusing for me.

So I found myself looking for a way to completely wall off my WordPress install from the rest of my files. I was reminded recently of the use of the Subversion externals property and my mind started buzzing with possibilities. With "externals," I can say:
Pull the stable WordPress code from WordPress.org and put it into this directory named /docs/wp/

Then my other directories, which are under my own local subversion repo can exist at /docs/dir1, /docs/dir2, etc. Of course, some Apache Alias magic is needed to make all this work.

Here's the way I set it up for my some of my projects. So far so good. This is a bit hairy to set up but subsequent upgrades are a breeze. I use this across development, testing, and production systems (how to get those environments to work with WordPress will be another entry)

First off, the previous Apache document root for domain1 was at /www/domain1/docs, so the WordPress files wound up like this:

/www/domain1/docs/wp-content/
/www/domain1/docs/wp-includes/

But I also have a lot of dirs that sit alongside of wordpress like this:

/www/domain1/docs/dir1
/www/domain1/docs/dir2

We're going to wind up changing that.

Create an subversion external property in /www/domain1/docs for WordPress
[code]
$$ cd /www/domain1/docs
$$ export SVN_EDITOR=vi ( or your editor of choice )
$$ svn propedit svn:externals .
[/code]
vi starts up and you can add the following line:

[code]wp http://svn.automattic.com/WordPress/tags/2.3.3[/code]

Save and exit
[code]$$ svn commit
$$ svn update [/code]

( This downloads the WordPress code from the above address into your wp/ directory. Now we are cooking. )
  • Now, /www/domain1/docs/wp is where all your WordPress code lives.
  • Copy wp-config.php to /www/domain1/docs/wp/
  • Copy .htaccess to /www/domain1/docs/wp/
  • Create a link from the stock wp-content/ dir to your personal wp-content dir like this

[code]$$ cd /www/domain1/docs/wp
$$ rm -Rf wp-content/ ( use -Rf with care please! )
$$ ln -s /www/domain1/docs/wp-content wp-content
[/code]
  • In Apache config, set document root for this domain to /www/domain1/docs/wp
  • Put wp-content/ dir and any other non-WordPress dirs/files into /www/domain1/docs
  • Create an alias for wp-content/ and any other non-WordPress dirs/files in Apache config

[code]
Alias /wp-content /www/domain1/docs/wp-content
Alias /dir1 /www/domain1/docs/dir1
Alias /dir2 /www/domain1/docs/dir2
[/code]
This looks like a lot of work, but it's really only a lot the first time around. Next time WordPress has an upgrade:
[code]
$$ cd /www/domain1/docs
$$ svn propedit svn:externals . ( change the tag to new version of WordPress )
$$ cd wp/
$$ rm wp-content (to remove the link)
$$ svn update (to update to new version of WordPress)
$$ rm -Rf wp-content/
$$ ln -s /www/domain1/docs/wp-content wp-content
[/code]

Everything after the propedit in this group can and should be scripted which will basically give you a 2 step process for upgrading WordPress, while keeping you wp-content/ dir under local source code control, as well as leaving room for any other directories or files your site might require.

This technique will probably also work with Symfony although I haven’t tried it yet.
read more...

2.17.2008

"SSL Error: certificate verify failed" for Amazon S3 using s3sync

Amazon has changed their certificates for SSL access to the S3 service.  If you are receiving this error and you are using s3sync, you can look here for new certs for SSL access to S3.

Long term though, this is a problem with my (and possibly your) backup solution.  Look here for more info.  Specifically this bit:
The certificate chain supporting Amazon S3 SSL is an implementation detail of the system that may change from time to time. A robust application should not depend on the Amazon S3 SSL certificate being signed by a particular certification authority. However, you can depend on the fact that we will only use reputable CAs that are widely supported by existing user-agents. The easiest way to select root CAs to bundle with your application is to simply import the set from a modern web browser with a large market share.

read more...

1.17.2008

You know you’ve made it when the spammers start using your name.

All of a sudden, I have a bunch of returned email in one of my inboxes. Looking thru it, it appears that some spammer has been sending email thru various open relays around the world and using random names at this domain as the email address of the sender.
At first I freaked out thinking they were coming from my server. I looked around the box and didn’t see any evidence of abuse. And I’m not in any server blacklists either. On a whim, I tried connecting to some of the sending servers specified in the emails and sure enough, I could send email out from a couple, so I don’t believe there’s anything fishy going on with my server. I’ve notified the appropriate people regarding the open relays.

Most normal people will never have heard of my site. It’s not famous or popular. So when they get an email from an address at this site, they should immediately know that it’s spam. It’s not like sending an email out from a site that a lot of people use like the dozen “service at paypal” emails I receive each week. I’m just a rinky-dink site about programming that earns a few dollars a month in advertising, not even enough to cover my costs.

But I can see the spike in traffic this is creating as people either open the spam email or look at the sender and want to know more. (question – exactly who are these people that have time to research every single spam item they receive? I think I want their job ). With traffic going up, bandwidth usage goes up, and eventually costs go up. Traffic going up because more people are reading my site is great. Traffic going up because people are ticked off at me is not so great.

I’m still perplexed as to how to get this spammer to stop using my domain name as the sender’s address.
read more...

11.14.2007

Gmail 2.0 crashing Firefox with extreme prejudice

It's mostly when clicking different folders like "spam." I wasn't sure what was going as this just started happening the past 3 days when I noticed that sure enough, I've been moved over to Gmail 2.0. I tried disabling and then finally uninstalling all my add-ons (plugins) to Firefox to no avail. Selecting "older version" in the top right nav of the gmail page made the problem go away. If you're listening google, please fix this.

UPDATE:  you may need to select "older version" every day or at least a couple of days a week since gmail doesn't seem to remember that setting.  And even the latest Firefox 2.0.0.11 with no extensions has this problem.
read more...

8.22.2007

SECURITY ERROR: package in channel "pear.phpunit.de" retrieved another channel's name for download!

Odd Pear error today. Trying to install PHPUnit3 on a newish server. Following the instructions at the PHPUnit Pocketguide. Here's the steps I did and the error I received. I'm not sure at this point if this is a bug in the Pear installer or if there's a problem with the way the PHPUnit channel is configured so I don't know where to file this.

[code]php# pear channel-discover pear.phpunit.de

Adding Channel "pear.phpunit.de" succeeded
Discovery of channel "pear.phpunit.de" succeeded

php# pear install phpunit/PHPUnit

SECURITY ERROR: package in channel "pear.phpunit.de" retrieved another channel's name for download! ("pear.php.net")
Cannot initialize 'channel://pear.phpunit.de/PHPUnit', invalid or missing package file
Package "channel://pear.phpunit.de/PHPUnit" is not valid
install failed

php# pear version
PEAR Version: 1.6.1
PHP Version: 5.2.1
Zend Engine Version: 2.2.0[/code]

Installing the code manually (the second set of install instructions listed) works just fine however. On to my unit testing!
read more...

7.20.2007

Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

Ran into this error recently... here's how to fix it, assuming you have OpenSSL already installed on your system.  For OpenSSL your PHP config values look like this:

--with-openssl[=DIR]    Include OpenSSL support (requires OpenSSL >= 0.9.6)

So, if you've compiled from scratch, you can just recompile adding this flag to your configure command.
read more...

4.11.2007

How to for SSH, Subversion (SVN), Putty, Tortoise, and Zend Studio 5.x using svn+ssh

Attempting to connect my new Windows machine with Zend Studio 5.1 using svn+ssh to an svn repository on Linux, I am obliged to once again stand on the shoulders of giants that have come before me. Here's some "how tos" that got me through it.
  • Logemann Blog - Subversion / TortoiseSVN SSH HowTo - Soup to nuts on how to set up both the server end as well as the client end of this ordeal. Includes ssh, ssh-keygen for generating keys, installing keys on client via Putty and Pageant, and using the ssh tunnel built to grab the repo via TortoiseSVN.
  • Zend.com Forums: Zend Studio => HOW-TO: Using SVN+SSH in ZS 5.5 - More ssh, ssh-keygen, installing keys on client via Putty and Pageant, and using the ssh tunnel with Zend Studio. (This seems to be missing one step for Zend to work though which is included next)
  • SVN - SSH connection produces errors - This post from the Zend knowledgebase adds the mysterious SVN_SSH environment variable that magically makes this work for Zend. NOTE - while they show this using the path to TortoisePlink.exe, you may also use Putty's Plink.
read more...

4.10.2007

How to create and use multiple profiles using the Profile Manager of Flock

Similar to an earlier post about using multiple profiles with the Profile Manager of Firefox, it is possible to do this with Flock as well.

To start the Profile Manager in Windows, follow these steps:
  1. Close Flock completely (select File > Exit from the main menu)
  2. Select Start > Run… from the Windows Start menu
  3. Change directories to your Flock install (typically C:\Program Files\Flock\flock> )
  4. Enter flock.exe -p and press OK.
  5. Remember to check/uncheck the “ask this at startup” box.
read more...

11.17.2006

How to create and use multiple profiles using the Profile Manager of Firefox

What's cool about this is that you can use one profile with all your nice web developer extensions set up and another for quick browsing with no extensions installed.  I find using a few extensions tends to bog Firefox down (even still today) so doing without some when I'm just cruising around killing time is quite nice.

The following was lifted from the mozilla site if memory serves me.

In order to create a new profile, you use the Profile Manager.

To start the Profile Manager in Windows, follow these steps:
  1. Close Firefox completely (select File > Exit from the main menu of Firefox).
  2. Select Start > Run... from the Windows Start menu.
  3. Enter firefox.exe -ProfileManager and press OK.

On Linux or Mac, start Firefox with the -ProfileManager switch, e.g. ./firefox -ProfileManager (this assumes that you're in the firefox directory)

// end lift
read more...

7.10.2006

Load this Firefox bookmark in the sidebar

Bookmark a page in Firefox. Right click on the bookmark and select "properties." There's an option for "Load this bookmark in the sidebar." If you check that button, every time you click on that bookmark, it will open up in your sidebar. Pretty darn handy. Can't believe I didn't know about this before. Of course, the only things I bookmark locally anymore are internal apps.

This doesn't work in SeaMonkey though.
read more...

7.05.2006

AOL Instant Messenger – Triton, Norton, Password problems

So I thought I’d forgo using my GAIM today, even though it's totally working correctly... and even though it completely connects to all my instant message accounts... and see if the new AOL Instant Messenger called Triton did anything interesting. It turns out it does not. The thing hardly even works. Ugh. Why do I even bother?


Frustration # 1

When I installed it, it left my old AOL messenger in there instead of just upgrading that one.



Frustration # 2

I couldn’t figure out which ports to open on my Norton software firewall. Even though I explicitly gave AIM6.exe permission to access the Internet, it was trying to use some odd port that I don’t have opened. I’m afraid it’s too new for the port info to be out in the wild yet. This one’s a deal-breaker for me, but it gets worse.



Frustration # 3

I had forgotten my password so I clicked the “forgot password” link which brought me to https://my.screenname.aol.com/ where I was able to answer some pre-determined security questions and then change my password. However, while the screens there reminded me to only use letters and numbers for the password, the web form neglected to check for other characters.

So without realizing this restriction, I used a symbol in my password. Of course when you get into AIM Triton (with no firewall of course), it keeps coming back that your username/password is incorrect. Because it sees that symbol and freaks out. This one stumped me for a good few minutes. You have to go back and change your password to not use any funny characters. This is form validation 101 people. Filter input. And give appropriate error messages.

Back to GAIM I go.
read more...

12.21.2004

Personal Disaster Recovery for the Masses

A few people make fun of me because I have a personal disaster recovery plan for my computers, data, and applications that are located in my home. These people aren’t in the IT industry. Those in IT usually nod thoughtfully and muse, “I should do that too.”


At least once a month, I back up all my important data and documentation, burn it to some CDs and place it in one of those lockable fire-proof boxes. I include my bookmarks and any software that I’ve downloaded and installed recently, like some of the open source projects I’m trying out. If I’m working on a specific project from home, I copy the data to multiple machines daily and usually burn it to CD every couple of days.


I also put my address book in the fire-proof box in various file formats as well as actual print-outs. This includes all my business contacts, credit card and utility companies, insurance companies, etc. If a fire ever burns my place down, I just need to find that box in the rubble, open it up and start making calls. I think most people could benefit from this regardless of whether or not they’re in IT.


My software documentation usually includes step-by-step instructions for getting back up to speed should disaster strike. I try to document everything as I use it the first time so that documentation isn’t a separate chore. I still have a lot of work to do here but I am definitely making progress.


Well, this weekend, my Fedora linux box up and died. The power supply keeled over (at the ripe old age of 10 years). When the power failed it corrupted the hard drives because it wouldn’t let me boot back into linux. So, I had to replace the power supply and then just re-install linux. I had documentation on all the options to choose during install. I also had docs on installing/configuring Apache, mySQL, PHP, Perl and its modules.


Now, I am far from perfect and there were a few instances where I had to make educated guesses on setups but I was sure to add those into the docs as I went. There’s a kind of recursive nature to disaster recovery. The more disasters you have, the better you get at it I suppose.


The whole install and configuring process took me only about 5 hours. This could have been faster but my linux box is a Frankenstein, with most parts being pretty old and slow. I was pretty impressed that the whole process only killed one morning.
read more...