Out of Disk Space

If you all the sudden get database errors (select, cannot login, cannot write, etc) – and everything looks ok (from the database end of things) check to make sure you have not run out of disk space. How do I know? Well – let’s say last night I had to do a major fall clean-up. If you know me and my monitoring habits, this will sound a bit confusing because one of the many things I monitor is disk space, but when your hosting company accidentally halves your disk space – trouble can occur, and quickly. I have not had many issues at all with Liquid Web – but this was major…and handled a little slower than I would have liked.

Nano Tip

I have been doing a lot of work recently on a remote server and have needed to use a text editor – so I decided to use the ever-so-easy nano. Problem is – the files I am working on are very long and editing them is not fun. I finally decided to look through the man pages (I am an emacs person myself) and found something that ended up saving me tons of time…”go to line number”. If you are editing a file and know you need to edit something on line 1245, you would type in:

nano +1245 master.css

and it would open the file to line 1245 so you do not need to scroll down. Thank you man pages!

w3c link checker.

I have been working on a project with a few clients where they are moving all their static content (as well as creating some dynamic content) into a CMS. They have about fifty pages done and wanted to check the links on their site to see what was broken so I directed them to the W3C link checker. I had not thought about that W3C tool in awhile, but I wanted to mention it here because it is a great free way to check the links on your site. When using this tool, make sure to check the check the “Check linked documents recursively, recursion depth” to make sure it follows all your links.

Find Your Location

If you ever are not sure of the path to one of your scripts of files (.htpasswd), you can easily find out by creating a new PHP file, and then copying the following code into the file:

After you save the file, view it in your browser and you will see the location of your file. No more guessing if it is /home/username/public_html/ or some other naming convention that your host might use.

jappler recommends: do not use godaddy.com for hosting.

Over the past few months I have had the chance to look at a number of hosting companies and their “control panels” by working with a number of clients. It seems as a number of people flock to godaddy.com because of it’s price (really cheap), but I have learned – once again – that you get what you pay for. If you want to have a very simple 1-5 page static web site, go for it – use whatever host you want. If you want anything else, after working with over 20 hosting companies, I can easily say that I would not go with godaddy.com. Why?

  • The admin area (control panel) is horrible in general. Not intuitive at all.
  • No backup on demand (or scheduled) available
  • Working with .htaccess files is a pain – as they do not work right away, there is a “wait time”.
  • The admin area (control panel) is slow and sometimes even times out
  • Free support is almost non-existent
  • Creating a database is not instantaneous
  • Paid support (talk to someone) is a joke (at least in my experience)
  • I am not alone in my recommendation

I could go on, but I have a busy day ahead of me. What would I recommend? First of all, I have found that working with cPanel is very nice and easy to use control panel. After that, there are a number of good and bad hosts you can weed through. Personally, I have had excellent uptime and support from Liquid Web, but anything is almost better than the godaddy.com hosting.

Get Serious About Backups

If there is one thing I cannot stand more than anything when it comes to computer support – it is failure to have a backup strategy. If you have pictures, email, documents, music, videos, etc that you consider valuable – do something about it. There are many ways to easily backup your personal data and I wanted to throw out another option if you are not using a remote backup system: Jungle Disk.

With Jungle Disk, you can easily, cheaply (15¢ per gigabyte), and securely transfer and store your data using Amazon.com’s S3 â„¢ Storage Service. I have all my data backed up to a 500 gigabyte FireWire external drive every night, but if something were to happen to my house, or my computer/drive was stolen – I am left with nothing. Knowing all my pictures, documents, music, and anything else I really need or want is available off site makes me sleep easier – and it will for you too.

Never had a drive failure or any data loss? You will – so you might as well prepare now.

debugging web site/database lessons.

After spending a frustrating day yesterday working with a client, their web site overload issues, and the hosting “advanced support” I am worn out. The issue: extremely high traffic database driven web site – when moved into the production environment on a dedicated server – would spike the processors’ load to 100% and would then need to be restarted. I got called to help solve the problem. The “advanced support” blamed it on the CMS and that is where I stepped in. The first thing I wanted to see were the server logs. (Apache and MySQL to start) After a long and frustrating time on the phone with the “advanced support” they were finally convinced I knew what I was talking about and gave me shell access to the server so I could tail (tail -f logname_log) the log in order to see what kind of error messages were generated. Mind you – my client had been dealing with the “advanced support” for two days at this point and not once did they look at the log files. Within a few seconds I was able to see the errors that were causing Apache and MySQL to run out of control and within a short while, I had a solution.

The lesson here – and it seems like I have tried to get this across many times before – if you are experiencing server issues of any kind – DNS, email, web, database – always check the logs first. The log files will either tell you what is wrong right away, or give you something to search for on your search engine of choice. The other lesson of the day: if you are have a content management system that uses a lot of database queries on a very busy site – make sure you you are using some sort of caching. (such as the MySQL Query Cache)

CSS and z-index.

I have been busy working on an excited project that uses some pretty complicated layouts. I was originally hired to optimize and clean up the XHTML/CSS so it would work in IE 6, IE 7, Safari, and Firefox, but now am busy working on producing the clean XHTML/CSS from the start. I needed to brush up on my understanding of how z-indexes work, and I found an excellent tutorial that I wanted to share: Understanding CSS z-index.

Work Smarter

When every hour you spend impacts your bottom line, I have learned a few tricks to working smarter.

  • Do not be a slave to email. When I am working on projects, email can be a continuous distraction. “I will just see what x client wants really quick” can easily turn into a mental distraction as I try and work out the issue. Worse, I will drop everything that I am working on to address the issue. In the past few months I have learned to focus on one task or a group of tasks at a time, then break, check email, and move onto the next task or group of tasks. I also pick an hour or two to just focus on answering email messages. This allows me to stay focused and get tasks completed and off my plate.
  • Pick a work schedule and stick to it. Start work and end work at a reasonable and consistent time. If I know I will work from 8am-4pm, I can budget my work and play time accordingly. I may not want to always work at 8am, but I know I do not want to work at 7pm either. Setting a schedule allows me to differentiate work and play time – making both much more enjoyable.
  • Realize not everything is an emergency. This was extremely difficult for me when I first started consulting. Just because a client emails at 11pm does not mean I need to email them back within 30 minutes. Set boundaries (and a schedule) so you can differentiate between a true emergency (server down) and a client’s request to change colors (not an emergency).
  • Build in time for business development. I use Mondays to do all my accounting, company web site updates, marketing, etc that will help me advance my company’s position for future growth. Current clients are very important, but so is getting the next client. Do not fall behind!

There are a lot of ways to work smarter and I would appreciate any other suggestions.