Fast, Reliable & Affordable Web Services
Highlights
  • email marketing ...
  • content management ...
  • fastest VPS hosting ...
  • new SEO techniques ...
  • Online business drivers ...

Malcolm McIlhagga

Servers are being hacked

Recently we’ve had a lot of new clients come to us with servers that have been hacked. It can be quite a lot of work to tie a server down and identify where it has been hacked and remove malicious code, but most important is the very specific expertise that is needed.

Most website development agencies don’t have the skill set to do this or to provide more hack resistant hosting. Often customers won’t pay for security expertise until something goes wrong: what we are seeing is more and more sites, particularly wordpress sites that we have had to rescue from hacking.

We advise a pre-emptive approach – secure your site now to avoid hacking.

Choosing an IT Consultant

Consultants’ bios on the web, more often than not, approximate their CVs’ and whilst it’s necessary to see their relevant experience and skills, this approach rarely gives you an insight into their personality or the core beliefs that drive them.

If you decide to employ a consultancy it makes sense that you trust and respect them as professionals and understand what business philosophies and methods they will practice to save you money and increase your profits.

You are paying for the consultants’ time and experience and expertise to achieve these core objectives.

We always start our first meeting with the same question, what do you really want for your life?
…not just for the business, but your life, that could simply be more leisure time or more time to spend with your family and friends  or just time to pursue other interests?

Ask yourself how we can help the business to fit you and not you to fit the business.
We guarantee this will help you achieve your business goals and have the life/work balance that you desire.

Of course, you may wish to employ us purely to help with your business needs and take a less personal approach to the consultancy process, which is the often all that is required.

At Powered by Humans all of us are working professionals who have had our own businesses; collectively we have a vast depth of experience and an impressive skill set to help you meet your defined goals. If you take the time to read our individual bios’ this is self-evident.

Contact us for a free initial meeting.

We hope you enjoy reading our bios’ and you are welcome to contact any of us via email with any questions you may have.

Your website front page

If I had £1 for every of time that I’ve seen or reviewed a website that is ostensibly fine, but the front page is a disaster, then I’d have enough to buy a new car. Not an expensive car, but definitely a small hatchback.

Designing a website front page is a subtle blend of user needs and business goals. Most front pages forget one or the other and that leads to user confusion and a business that is not achieving the goals it has set out for its website; whether they be product purchases, engaging the user in relevant information or messages or generating sales leads.

We can help you to identify your business goals, your user’s needs and translate them to appropriate layout and design for your front page within the template design that has already been produced by your website design company.

What do I want from a site now?

Many of us have BT Infinity at home or one of the other “fibre to the cabinet” offerings. It’s only recently that I have been able switch at home from basic ADSL to fiber. It’s not been without its problems, but thats another story.
Continue reading

Welcome

Welcome to the Powered by Humans blog. We plan to publish a range of short and accessible articles on IT, websites, marketing and sales over the coming months and years.

If there is anything you want to hear about then why not contact us.

magento and php 5.3

I’m running magento on Centos 5. And, as the Centos mainstream repositories do not support the required PHP version, I am using the very good remi repository.

Just recently remi started supporting PHP 5.3 and magnto is still on PHP 5.2 and does not work well with 5.3.

The main issue is that the split() function is no longer used and needs replacing by explode().

I was able to find all file that contained the split function with :

% grep -Rl “split(” *

and

% grep -Rl “(split(” *

and then open them and replace every call to split with explode.

I don’t why magento don’t provide a centos repository – that would help to avoid a lot of issues and would be a more holistic approach to what they are doing.

An Apple a day?

Actually they seem to be selling a great deal more than that. I’ve been reading the recent (not so recent) news of Apple’s sales figures. See:

http://blogs.eweek.com/applewatch/content/corporate/apple_q3_2008_by_the_numbers.html

http://www.apple.com/pr/library/2008/07/21results.html

This is important for Colrosa as a company that undertakes software product development for our clients.

It seems that Apple has made a 49% increase in sales (units sold) in desktops and a 37% increase in portables from Q3 in 2007 to Q3 in 2008. These figures are staggering and have a potential impact on the sorts of decisions software developers make on their choice of development platform and delivery platform for their software applications.

This slightly older article (May 2008):

http://blogs.eweek.com/applewatch/content/channel/macs_defy_windows-gravity.html

relates that “Apple’s retail market share is 14 percent, and two-thirds for PCs costing $1,000 [in the US] or more”, and this was prior to Apple Q3 figures announced in July.

I haven’t been able to find any figures on SME, corporate and home use market share, which of course would greatly impact this issue:

If I am considering developing a software product, do I: develop for MS Windows only, MS Windows and MacOS X or indeed MacOS X only?

However, this:

http://www.tuaw.com/2008/08/26/forrester-apple-nearly-quadruples-enterprise-share/

and other articles indicate a 4.5% penetration into the business market (Aug 2008) in general, much lower than the overall market share. Not being a market analyst I can’t say if the business market, being late adopters, are likely to follow the general or home use trend. It seems to me though that (logically, but without proof) this increase may be in the SME market, where personal preference can be more important than corporate IT strategy.

Cross platform development greatly limits the technologies and languages that one might choose to develop with, yet commercially is making more and more sense.

This is still an open question and one that is swayed by the vertical market that you might be developing for. It pretty clear that an application aimed at graphic designers would be more profitable if cross platform. Perhaps something in the legal sector would not benefit at all. But, what about an application of ubiquitous use across both the SME and corporate market? Where would we draw the line?

What are the development options?

Please post a comment if you know differently!

  1. C++ (option 1) with a common interface library, e.g. QT
  2. C++ (option 2) with separate interface code
  3. Java – compile once and debug everywhere.
  4. scripting and GTK (I haven’t really looked in to this, but understand that this would be possible)

Choices would depend on the simplicity/complexity of the UI design and therefore its percentage of the build. For example if I were building a local file indexing engine (a la spotlight for the mac) with a half a dozen user settable preferences and an on/off button I would not need to worry about re-writing the UI. If, however, I was building a diagramming tool, then my first concern would the the common UI tools between platforms.

The other important factor to consider is the additional cost to developing cross platform. My experience of developing cross platform in Java is that it is about 10-15% more expensive (depending on various factors), than developing for one platform.

My last thought on the matter is this: Mac users often have less choice in applications and are usually prepared to pay for something that works well, simply and with grace; right or wrong this is why they went for the Mac and MacOS X in the fist place. I believe that users are often as concerned about their experience with an application as they are about the raw features and as often as not confuse the two: rating more usable applications as more effective in getting a job done.

Setup of a Linux Web Server in 128Mb of Memory

Centos 5 as a LAMP Server in a Low Memory Situation

The results

Lets get right to the point! I’ve setup a working VPS Centos 5 LAMP server in 128MB of memory and it hasn’t gone into swap yet. It typically runs in just over 100Mb of memory and performs really well. So I thought I’d share the process of setting it up in our blog.

I have been using Gradwell to host our websites and our clients’ sites (and VOIP) for about a year now and I’ve been very happy with their service. However, I wanted the flexibility of control that my own server could provide, but I couldn’t justify the cost of new server and its hosting.

Finding a VPS Hosting Company

The solution of course was a virtual server for a number of reasons:

  1. cost
  2. manageability – no hardware to worry about (SEP)
  3. the green factor. VMs are more energy efficient and this fits with our ethos as a company.
  4. portability

I had look around, but decided to see if it was possible for Gradwell to support the features I needed through their hosting package first. They came back to me suggesting their new VPS hosting package (which isn’t on their website yet) and of course I was happy to with them.

When I had a look around there were quite a few different offerings. At the time of writing this article (July 2008) companies are either using VMWare or Xen, some were using Windows Virtualization.

As I’m already with Gradwell, I decided to go with their offering (Centos 5 on Xen). Not least because they offered a Centos 5 VPS, which is exactly what I wanted.

Other Factors to Consider

You may be looking to buy a VPS on a monthly basis to host your websites and databases, but do you want to host and manage these yourself:

  • email (pop or IMAP boxes)
  • email forwarding
  • DNS
  • backup – where are you going to host your off site backup?

In my case I did not – I have enough to worry about. The IMAP demon can be memory and CPU intensive and SPAM detection even more so. DNS should always be hosted on a machine other than your web server in my opinion and with off-site backup you really do need another machine – not a lot of choice there!

Specification

VPS systems are typically costed as a factor of memory, share of CPU (how many concurrent systems on a real machine) and disk space. Because I’m in the development cycle of the project that this VPS is really going to be used for and I only had a few small, low volume sites to host (and because upgrading memory is easy on a VPS) I’ve gone for their lowest memory spec. machine – 128MB.

The configuration was as follows:

CPU: sitting on a dual quad core machine under Xen
Memory: 128Mb
3GB of disk space
Standard Centos 5 install:
Apache 2.2.3
MySQL 5.0.22
PHP 5.1.6

With a small amount of memory we needed to optimize the set-up so that the system does not page. The rest of this blog covers the set-up and optimization of the new VPS server, service by service.

Optimizations

The first and obvious question to ask was what services do I not need?

I reviewed the running services and dropped the use of some by removing the S links in /etc/rc3.d:

  • I’ve removed the link S26hidd -> ../init.d/hidd located in /etc/rc.d/rc3.d to stop the hidd (bluetooth demon from starting)
  • I’ve removed the link S97yum-updatesd -> ../init.d/yum-updatesd located in /etc/rc.d/rc3.d to stop the yum notification demon running.
  • I’ve removed the link S90xfs -> ../init.d/xfs located in /etc/rc.d/rc3.d to stop the x font server which is not needed.
  • I’ve removed the link S18rpcidmapd -> ../init.d/rpcidmapd in /etc/rc.d/rc3.d to stop NFS server working as I don’t need to use NFS
  • I’ve removed the link S95atd -> ../init.d/atd in /etc/rc.d/rc3.d as not using the “at” command
  • I’ve stopped smartd – haven’t removed the link in rc3.d yet, as I not sure is is needed under Xen – this need more research. However, the server seems to be fine for the moment.

Backup

Normally I would use rsync to a remote machine. I don’t want to run rsyncd on my VPS and it is not running on the machine hosted by Gradwell that I’m backing up to, so I’ve used tar, sftp, cron and some shell scripts to implement the remote backup for the server. A little more bandwidth is used but it is the memory foot print that I am concerned with.

SSHD

There are other implementations of sshd that use less memory, however the ones I considered did not support sftp and I need that, so I’m sticking with the standard install.

DNS (bind)

I’m hosting this elsewhere – this saves memory!

MySQL

Mysql settings for low memory are well documented on their website. Most installs come with some suggest configurations in /usr/share/doc/mysql-server-{mysql-version}/. I actually adapted the file my-medium.cnf found there and incorporated those settings into /etc/my.cnf

here are the resultant settings:

port            = 3306
socket          = /var/lib/mysql/mysql.sock
[mysqld]
datadir=/var/lib/mysql
port = 3306
socket = /var/lib/mysql/mysql.sock
old_passwords = 1
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout

Updates and Yum

I’ve setup a cron job that switches yum-updatesd on for a short period during the night as a memory helper. During that time a cron script emails me if updates are needed on the system using the command `yum check-update`

Apache

I don’t use perl so I’ve have commented out the line:

LoadModule perl_module modules/mod_perl.so

from /etc/httpd/conf.d/perl.conf to save memory

Settings for low memory are changed to:

<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 4
ServerLimit 64
MaxClients 64
MaxRequestsPerChild 5000
</IfModule>
<IfModule worker.c>
StartServers 1
MaxClients 15
MinSpareThreads 3
MaxSpareThreads 7
ThreadsPerChild 3
MaxRequestsPerChild 200
</IfModule>

PHP

I have actually increased the min memory from 16M to 40M as many modern PHP applications (SugarCRM, Joomla, WordPress, etc) needs this as a minimum – better it runs and swaps if it needs to than not run at all.

Packages

In addition to the standard install I have installed:

  • emacs (needed for me – I can’t help but love it after all of these years)
  • php-mysql (need for everything and I’m not sure why it wasn’t installed already)
  • php-mbstring (need for SugarCRM)
  • php-imap (needed for sugar and other Webmail packages)
  • php-gd (needed for various PHP apps. for image manipulation)
  • vsftpd (joomla wants to ftp to the Unix platform because of file permissions)

Porting

These are a few notes on things I did to manage stress free porting of applications from the Gradwell hosted server. Some of these points may in principal be useful to you so I’ve left them in this blog.

MySQL based and static websites were dumped and tar(ed) up along with the Webroot and logs directory, sftp(ed) to the new server and setup. In most cases it was necessary to edit config files and .htaccess files (which I brought into httpd.conf as I was moving from Apache 1.3 to Apache 2.2).

Directories

I’ve to mirrored the way Gradwell hosts websites in their directory structure for compatibility, i.e.:

/home/[user]/webs/[domain]/htdocs
/home/[user]/webs/[domain]/logs

I’ve added this to /etc/skel so that new users get this structure.

Users

I’ve copied files over from the Gradwell server and they have my user (UID) with GID 1000, as this is the way Gradwell do things

All users have group user (GID=1000) It did exist as a group and had value 100 on my VPS, so I changed it to have value 1000. And, I have edited /etc/default/useradd and made GROUP=1000. Ported users need to have their UID set, new users don’t need their UID setting manually and the default GID is now set to 1000, so:

# useradd -n –password <password> <newuser>

is used to add a new user.

Checks and Monitors

I have setup an external HTTP monitoring service, a cron script to monitor server load and memory consumption with the ability restart services if needed and something to monitor disk space.

Feedback

I’d be interested to hear what others have done, so please feel free to leave your thoughts and comments.

Article by Malcolm