Archive

Archive for the ‘Web’ Category

Audioboo

July 28th, 2010 Jonathan No comments

I heard about Audioboo – a sort of Youtube for audio clips – the other day on BBC Click. I decided to give it a go, since I fairly often embed audio clips in my blog, simply by hosting and linking to MP3s and letting the user’s browser handle the playback. This doesn’t always work out for the best.

So here’s my first attempt at uploading content to Audioboo and embedding it in my blog.

Categories: Audio, Web Tags: , , , ,

Newbie’s guide for Linux Apache web servers

June 3rd, 2010 Jonathan No comments

Today a friend (from a Windows background – still a friend?! :P ) asked me how to go about setting up a LAMP (Linux, Apache, MySQL & PHP) server. I wrote him a few notes, not only on how to configure the LAMP stack, but also on how to configure a Linux system properly from scratch, and how to do so securely. There are millions of guides out there that explain how to serve web pages with Apache, but not many of them explain the basics of setting up a secure system too.

I’ve edited these notes slightly to make them suitable for a wider audience, but in essence it’s the same stuff. Hope it’s useful!

OS installation

I recommend using CentOS. It doesn’t really matter whether you choose 32-bit (i386) or 64-bit (x86_64) but use ideally use 64-bit unless there’s a reason not to.

Boot from the CD or DVD of your choice. It doesn’t matter whether you use the full DVD, or the network install CD.

Choose the text-based installer from the boot prompt by typing linux text. The text installer doesn’t install as much extra rubbish as the GUI installer.

In most cases the default options are good enough. One option you should change is to use an NTP time server. This is especially important with virtual machines, since they suffer badly from clock drift.

Choose a strong root password. You will only need it once again. After that, you won’t even even need it for logging on, so there is no need to pick anything memorable. In fact, you are best off choosing a long, random string of mixed-case letters and numbers.

When it comes to choosing packages, deselect as many of the groups as possible. We will add the packages we need individually later on.

Let the installer run its course, and reboot.

Users and passwords

Upon first boot, log in as root using the password you picked before. Now create new user accounts and set passwords:

useradd yourusername
passwd yourusername

Now for setting sudo access. This is like “run as admin” on Windows. Type visudo. In the text file that opens, read down to the line that says

root    ALL=(ALL)       ALL

Duplicate it twice by pressing yyp. Go into insert mode by pressing i and change the username root to your username. When you are done, hit Esc and type :wq to save and exit. Gotta love vi commands ;)

To disable remote root login via ssh, edit the file /etc/ssh/sshd_config using your favourite editor. If you don’t already have a favourite editor, use vi.

Find the line:

#PermitRootLogin yes

and uncomment it and change the value to no:

PermitRootLogin no

Restart the ssh daemon by doing

sudo /sbin/service sshd restart

From now on you can gain root access by using the sudo command, and you won’t need to log in as root again. Log out now by typing exit and re-login as your own user. Forget the root password forever.

Installing packages

First we add a couple of third-party software repositories that have useful stuff.

sudo rpm -Uvh http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm

Let’s get rid of the stuff we don’t want or need. There are no doubt more than things that can be removed than I’ve listed here, but they can be removed later.

sudo yum remove bluez* pcsc*

Update the system so you’re sure that that latest versions of all software are installed.

sudo yum update

Now we can install the stuff we want for LAMP!

sudo yum install httpd mysql-server php php-mysql

If you are wanting to use any PHP modules/libraries they can be installed here too, such as the commonly-used graphics library gd.

Services

Let’s start the two daemons for Apache and MySQL, and tell them to start on boot.

sudo /sbin/service httpd start
sudo /sbin/service mysqld start
sudo /sbin/chkconfig httpd on
sudo /sbin/chkconfig mysqld on

Apache in its default state will run out of the box. MySQL just needs a root password setting.

mysqladmin -u root password NEWPASSWORD

From now on it’s advisable to GRANT access to specific users on specific databases/tables. Go read about MySQL users.

Firewall

Let’s assume you want HTTP on port 80 open to the world. Open /etc/sysconfig/iptables for editing, and add this line.

-A RH-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

Save and close, and run this to make the changes live.

sudo /sbin/service iptables restart

Editing configs

The main config file for Apache is at /etc/httpd/conf/httpd.conf. It doesn’t need any changes for basic operation, but if you edit it you need to restart the httpd service to pick up the changes.

If you get serious with web publishing from a LAMP platform, you will probably want to read about name-based virtual hosts.

Adding content

In its basic configuration, you should add PHP scripts, HTML pages and other content like images and stylesheets to /var/www/html/. You do not need to restart the daemon for it to pick up new content.

When debugging pages, you will probably find it handy to refer to the error log, at /var/log/httpd/error_log.

Tip: Open two SSH windows to the server – one for editing stuff, and the other for watching the log scroll by as events occur. Use Ctrl-C to break out of it. Do this:

sudo tail -f /var/log/httpd/error_log
Categories: Guides, Linux, Networking, Web Tags: , , , , ,

A little bit of downtime

May 14th, 2010 Jonathan No comments

On Saturday 15th May (tomorrow) this blog (as well as my photo blog and the Photo Challenge) will be going down for a while in the afternoon and evening.

I host with Ridgeon Network, owned by my mate Chris. Tomorrow some of the servers are being relocated to a new rack and so will be temporarily offline.

I’ll post again when we’re back online :)

Categories: Web Tags: , ,

servepics.com

March 15th, 2010 Jonathan 1 comment

A while back, my younger brother Edmund wanted a photo blog, just like his big brother’s :)

I set him up with a free subdomain from No-IP. The address used to be edmund.servepics.com. I couldn’t fault the service from No-IP, but unfortunately free domains don’t only attract impoverished teenage photographers. They attract spammers and phishers, too.

As a result, the entire servepics.com subdomain is blacklisted by:

  • MSN Messenger. Sending a message including a link to his blog is blocked for an “unknown reason”.
  • Bristol University’s malicious content filtering.
  • My blogs. Any comments or links from his blog are automatically sent to spam, no matter how many times I mark it as not spam.
  • Everyone’s email servers. Any email from this domain is binned by most email providers.
  • Countless other people and services who don’t like online criminals.

So I decided it was time he became a man, and I signed him up for his own domain. You can now see his photos at www.edmundgazeley.co.uk. Enjoy!

Categories: Photography, Web Tags: , , , , , ,

I didn’t buy that!

March 3rd, 2010 Jonathan No comments

And hot off the press, another fail entry.

I placed an order with Amazon, and received this confirmation email.

Screenshot - Amazon email

I sure don’t remember ordering an ARRAY(0x6b390274), but hey, if it’s free…

Categories: Fail, Web Tags: , , ,

Web 2.0

December 14th, 2009 Jonathan 1 comment

Today I signed up for Twitter – not for personal reasons but because I needed it for work. Of course I’ve heard about it in the past as the leading micro-blogging service, but it hadn’t interested me in the slightest.

I have used Facebook since its early days (when you could only get in if you had an academic email address!), primarily to keep in touch with friends. When they brought out the status updates feature, I couldn’t see the point. Even less so having something like Twitter that’s purely status updates.

There are so many ways these days to get content out there and onto the web. But I can’t see the point in many of the newer sites.

Facebook

Like I said, I use Facebook as a way to keep up with friends whom I don’t see very often. While I was at school, MSN Messenger was all the rage, but now we’re a bit more grown up we don’t all have time to sit on MSN all night. So Facebook is a convenient way to keep in touch from time to time – given that email is only really used for work these days.

But my only friends on Facebook are friends in real life. I don’t meet people through Facebook. For me, it’s just a direct replacement for emailing friends or chatting on MSN. I don’t broadcast my life to the world. I can’t see why they’d care.

Twitter

Which brings me onto Twitter. I can’t imagine that anyone would be interested in snippets of my daily life. If they’re that interested, they can text me and ask. As I mentioned, I now have a Twitter feed and you can follow me if you want – but I don’t recommend it. I’m not intending to write anything interesting – only to use it for following boring feeds like these from the University of Bristol.

Blogs and websites

I’m more interested in personal websites, often in blog format. Maybe it’s because I used the web for years before these social, collaborative sites popped up, and the only resources available were traditional websites.

I’ve had my own website for over a decade now, in one form or another. When I was a kid, I didn’t have much of interest to say and there was nothing on the site. Nowadays I have two blogs: this one, mainly for technical articles, guides, reviews and so on; and my photo blog where I publish photos that I have taken.

Flickr

I’m a geek, and so I have my own server and I run these blogs from scratch using WordPress. Obviously such an approach isn’t going to work for everyone, which is why I like sites like Flickr. It’s a really easy way to get your work online. I set up my own Flickr page some time ago, before I decided where I was primarily going to host my photos.

As you can see, there’s hardly anything on it and only two comments. I’ve worked a bit harder to promote my official photo blog, which also gives me the freedom to customise it exactly as I want, and here I have had thousands of views of my photos.

In summary

I’m not saying that “Web 2.0” is a bad thing – I’m just saying it only works for me in limited ways.

I want to publish my articles and photos in a more traditional format, and I only use Facebook because most of my mates don’t use MSN any more.

Cities I’ve Visited

November 22nd, 2009 Jonathan No comments

As much as I hate Facebook for its annoying apps, there are one or two good ones.

Cities I’ve Visited is one such app that I like. You can add new cities either by scrolling, zooming & clicking, or by typing in a name. I like maps so I find it pretty interesting to see where I’ve been.

The application itself uses the Google Maps API so it’s interactive. Unfortunately the embedded version of this app for blogs is just a static image. You can’t change the zoom level or centre point, which is annoying, since you can see I’ve never been to America or Asia.

One day I might have a go at building my own app for fun. It shouldn’t be horrifically difficult to build a simple, single-user app for having an interactive map with points on it. The difficult parts are making it multi-user, and having a system for adding cities by name (rather than by grid reference).

I could even steal the work of my colleague, who built a map of wireless hotspots at Bristol University.

Categories: Web Tags: , , ,

Photo Challenge

November 14th, 2009 Jonathan 1 comment

For some time, I’ve been taking part in Stu’s Tuesday Challenge.

Recently, Stu has had great success with his East Midlands wedding photography business and so doesn’t have time for the Challenge any more.

So I’ve taken over the Challenge and rebranded it the Photo Challenge (so I’m not tied to a Tuesday). I hope the regular contributors on Stu’s blog will continue to take photos for the Challenges. It’s also an ideal opportunity for new photographers to try their hand at some of the challenges and get some feedback.

Why not give it a go?

Photoshop disasters

October 17th, 2009 Jonathan 3 comments

In the past, I’ve enjoyed reading Photoshop Disasters. Today I was delighted to spot my own Photoshop Disaster in Dorothy Perkins.

Photoshop disaster

Photoshop disaster

Looks to me as though they’ve just chopped her fingers off to resemble pockets.

Categories: Photography, Web Tags: ,

Readership demographics

October 7th, 2009 Jonathan No comments

I’ve been using awstats to collect statistics on visitors to my blog since July 2009. I’m a sucker for pretty graphs, so I’ve made a few :)

Operating systems

First and foremost, which operating systems are visitors running?

Operating systems

Operating systems

Good to see a disproportionately large number of Linux users! It’s probably a self-selecting audience to a certain extent though, as many of the posts on this blog are Linux guides or musings.

Linux distributions

So what distributions are the visitors running?

Linux distributions

Linux distributions

Overwhelmingly Fedora, it would seem. Again, perhaps no surprise as most of the articles here are about Fedora or CentOS.

Windows versions

Should I be worried that some of my visitors are still running Windows 98, Me and NT? Should I be concerned that there are also many hits from Windows 2003 and 2008, the server editions?

Windows versions

Windows versions

Browsers

And, of course, a chart of the browsers.

Browsers

Browsers

Unsurprisingly, Firefox blows everything else out of the water. “Others” included Netscape, Konqueror and FeedDemon.

Interestingly, the proportion of Mac users is far greater than the proportion or Safari users – which implies that Mac users are probably running Firefox instead.

Categories: Web Tags: