Chris Worfolk's Blog


Restarting Apache on Gentoo

January 29th, 2013 | Life, Tech

Normally, you can restart Apache using the restart command for the init.d script.

/etc/init.d/apache2 restart

However, you may encounter the following error.

chris@server /root $ sudo /etc/init.d/apache2 restart
 * Stopping apache2 ...[ ok ]
 * Starting apache2 ...
 * start-stop-daemon: /usr/sbin/apache2 is already running 

This is due to a bug in the init.d script. You can resolve this with a one line change.

vim /etc/init.d/apache2

Change line 105 for the one below (they should look very similar).

while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \

Save it and run the restart command again to check it has worked.

chris@server /root $ sudo /etc/init.d/apache2 restart
 * Caching service dependencies ...                                                                              [ ok ]
 * Stopping apache2 ...                                                                                          [ ok ]
 * Starting apache2 ...

If you get an output like the above, you’ll know it’s worked.

Mr Vice President

January 28th, 2013 | Public Speaking

Turns out, I’m the new Vice President of Education for White Rose Speakers.

White Rose is a Toastmasters group, that meets on the 2nd and 4th Wednesday of each month, at the Jury’s Inn Hotel in the city centre. If you’re interested in improving your communication and leadership skills – why not come down to our Open Meeting on Wednesday 27th February? Or indeed any of our meetings, as guests are always welcome!

Beanstalkd

January 27th, 2013 | Limited, Programming

Do you need a work queue system but think a message queuing system like Rabbit or Active MQ would simply be too complicated? Probably not, but imagine you did. Enter Beanstalkd. The super simple work queue daemon.

I went down to Leeds PHP for the first time in a while last week, where there was a talk about Beanstalkd. It’s effectively a FIFO queue – you can put a message in the end, and have another process take a message out of the start, the effect being that you can take some of the load off server intensive processes, and do them later when you’re not busy.

I had a play around with it in PHP, using the Pheanstalk and it really is a simple as that to work. You create a connection to your Beanstalkd server, and then just push and pull messages from the various queues, that you can create on the fly, like Mongo.

Quest for Six

January 26th, 2013 | Distractions

Last week, the San Francisco 49ers defeated the NFL’s number one rated team (statistically), the Atlanta Falcons, at their home stadium, the Georgia Dome, to win the NFC Championship title. There is a full report on A Brit Talks Football.

To be precise, it’s the sixth Championship title the 49ers have won, and the first since 1994 season, when they beat the Dallas Cowboys. But the quest continues – this books them a place in the Super Bowl, against the Baltimore Ravens. The 49ers are five for five on Super Bowl victories so far – will they keep their perfect record?

It’s gone!

January 23rd, 2013 | Life

Last Friday, we went for dinner at Chaophraya.

However, to my horror, I found they had removed their Thai curry, in a Yorkshire Pudding, on a steak dish from the menu! This, of course, was the greatest food ever known to man, and as such I will be writing a strongly worded letter to the management, insisting the dish is reinstated. Anyone who wishes to sign the petition, get in touch.

MaxClients (150) is not an integer multiple

January 23rd, 2013 | Life, Tech

Starting Apache on Gentoo, you may get warnings similar to the following.

chris@server ~/lime $ sudo /etc/init.d/apache2 stop
Password: 
 * Stopping apache2 ...
WARNING: MaxClients (150) is not an integer multiple
 of ThreadsPerChild (35), lowering MaxClients to 140
 for a maximum of 4 child processes,
WARNING: MaxClients (25) must be at least as large
 as ThreadsPerChild (35). Automatically
 increasing MaxClients to 35.                                                                                    [ ok ]
chris@server ~/lime $ sudo /etc/init.d/apache2 start
 * Starting apache2 ...
WARNING: MaxClients (150) is not an integer multiple
 of ThreadsPerChild (35), lowering MaxClients to 140
 for a maximum of 4 child processes,
WARNING: MaxClients (25) must be at least as large
 as ThreadsPerChild (35). Automatically
 increasing MaxClients to 35.

You can resolve these warnings by editing your mpm file and changing ThreadsPerChild so that MaxClients becomes a multiple of it. In this case, setting it to 25 should do the trick.

sudo vim /etc/apache2/modules.d/00_mpm.conf

Change the values and save the file. Now restart Apache and it should stop the warnings.

You could also change MaxClients, but this would only resolve the first warning, and not the second.

Driving in Russia

January 22nd, 2013 | Video

Good luck in Glasgow

January 21st, 2013 | Foundation

After three and a half years of serving on the board of trustees for the Foundation, Gijsbert has stepped down.

He recently accepted a position as a Reader at the University of Glasgow, and as a consequence will be leaving Leeds next month. We would like to thank him for all the work he has done over the years and wish him the best of luck in his new position.

NFL divisional playoff round

January 20th, 2013 | Distractions

Last weekend saw the NFL divisional playoff round. It was almost certainly the best weekend of American football that there has been this season. The Baltimore Ravens caused a major upset, when, at the longest odds to win the Super Bowl, eliminated the Denver Broncos, who were the favourites at the time, from the competition.

The San Francisco 49ers beat the Green Bay Packers to proceed on to the NFC Championship match, while the Atlanta Falcons kicked a winning field goal with only 31 seconds on the clock to beat the Seattle Seahawks in a tail biting finish. Only the New England Patriots’ confident victory over the Houston Texans really failed to provide such excitement.

You can read all about the matches over on A Brit Talks Football. Tonight the championship round takes place to determine who goes to the Super Bowl – you can follow my updates on Twitter.

Christmas party

January 19th, 2013 | Life

Last week, we went out for the Worfolk Limited Christmas party. It was a very small affair – even with all the directors and employees attending, and partners, that still only left myself and Elina. Given the small number, I had decided to hold off until January to avoid large roaming gangs of noisy office employees.

We went to Anthony’s Restaurant, not just because it was located just round the corner, or because it is one of the restaurants in Leeds city centre that I’ve never eaten at but also because of the intriguing possibility of their taster menu.

This was an eight course meal where you don’t know what you’re getting – apparently because the chef just makes it up as they go along – which is brilliant. We ate our way through four starters, two mains and two desserts, along with a home made loaf of bread – each!

It was rather quiet in there – indeed, we had the place to ourselves for the first hour, before two other couples turned up, and that was their entire business for the night. That is simply a cost issue though – it certainly wasn’t because of the food, which did not disappoint.

I have little idea of what I ate in most of the courses, despite an explanation from our waitress. But it was all delicious, if a little rich – by the sixth course, I was starting to think I was on sauce overload. At 10pm, we waddled out of the restaurant, stuffed. My kind of Christmas party.